My company has been running into an issue with the NRF51822 where the MCU appears to enter debug mode unexpectedly and I wanted to see if any others had experienced the same problem.
I've read through the messages in the forum describing the possible need for a pulldown on the SWDCLK line to avoid noise, however I haven't seen others reporting exactly the same problems that my company has been seeing.
We've seen an issue with MCUs entering debug mode without a pulldown on the SWDCLK line, and recently ran some tests with a 470 ohm pulldown and still saw a device enter debug mode.
In addition, even though the device appeared to be in debug mode based upon the current draw and operation of the device, it still responded to a pin reset, which I believed shouldn't be possible when a device is in debug mode unless a write is done to the NRF_POWER->RESET register to enable pin reset.
- Our device has a lifecycle of running at full power for 60 seconds, going in and out of IDLE mode for 59 minutes, and then going into STOP mode. At this point, the device would restart the cycle if a button on our device was pressed.
- While not in debug mode, the device draws ~4uA while in IDLE, and ~500nA while in System OFF.
- While in debug mode, the device draws ~1.2mA while in IDLE, and ~4mA while in what we believe is Emulated System OFF.
- After running through a calibration test that uses BLE to connect and disconnect from the device a few times over a period of one hour, we've found approximately 1% of our devices seem to be in debug mode.
- We are sure that our devices were not in debug mode prior to starting this calibration test.
- We are fairly certain that the devices are in debug mode after the calibration mode as the current draw matches the power numbers described above, but still operates exactly as we'd expect.
After reading the forums, we've found other reports of devices going into debug mode due to noise on the SWDCLK line, so we put a 470 ohm pulldown on that line.
Even with the 470 ohm pulldown, we have found at least one device that entered debug mode while running through our hour long calibration process. Note that we do have a fairly long trace on the SWDCLK line, so we used a strong pulldown.
Sometimes when we find devices in debug mode, they still reset when we use the reset pin. My understanding is that this should not occur if a device is in debug mode unless a write is done to NRF_POWER->RESET.
- Has anyone seen devices enter debug mode, even with a strong pulldown on SWDCLK?
- Has anyone seen a device that enters debug mode, but can still be reset via the reset pin?
- Is there anything other than noise on SWDCLK that can cause a device to enter reset?