This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF51822 running as SPI Slave - After weeks of running, MISO gets stuck high only during transactions - Is firmware freezing? Or something else?

Hello, I am using an nRF51822 chip, configured to run as a SPI slave. The device receives commands from master, sends commands out of the radio, and relays back RF payloads to the master (all through the SPI communication). Everything works perfectly for weeks, but eventually something happens and we notice that commands are no longer being sent out of the radio, and the MISO pin is stuck high during chip select (e.g. when chip select is high, MISO is low... when chip select is low(active), MISO goes high). 

Does this mean that my firmware is frozen? And if so, would the SPI slave still operate like this and keep MISO high only during transactions?

If this truly is the case, is there a way to detect that the firmware is frozen, and reset the device automatically?

Thanks and any help/advice is greatly appreciated!

  • Hi Matt, 

    Its hard to say if the CPU is running code or not without seeing any log output or debugging the nRF51822. You could modify you firmware to toggle a GPIO everytime it sends data via SPI, that way you will know if the CPU is executing or not when the SPI issue occurs. 

    If the code is indeed not running, then you could enable the Watchdog Timer on the nRF51822 and then write to the reload register periodically. If the code hangs and does not reload the watchdog register then the nRF51822 will reset. 

    Best regards

    Bjørn 

Related