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

nRF51822 requiring re-flash (exposed SWDIO/SWDCLK pins?)

I am experiencing an unusual and hard-to-reproduce issue with some custom PCBs containing a nRF51822-QFAA, S110 v5.2.1, with 10K external pulldown on SWDCLK, and a 10-pin SWD header. Some of my test units have no physical enclosure, and my test users are occasionally returning the boards in a state where they fail to start the program despite repeated power-cycling. However, on connecting a the programmer, the program still appears to be there (haven't tried to verify contents, but nRFgo Studio shows two code regions). When simply re-flashed and power cycled, the boards successfully come back to life!

This happens even though my program code contains no instructions that erase or write to flash. It also is only happening with my test units that have no enclosure. I haven't yet been able to create a procedure to repeatably enter this state.

  1. Is there a possibility that some incidental shorting (or even drops of water!) between some combination of SWDIO, SWDCLK, GND, VCC on the SWD header is causing the Debug Interface Mode to begin, and that this is causing the MCU to enter a state that is not recoverable by power cycling alone?

  2. Is some unintended write or erase of the flash memory the only possibility, or are their other non-volatile registers I should attempt to examine?

  3. Is there more protection I can provide, electronically or in software, to avoid this issue in production?

I appreciate any leads toward investigating or reproducing this very strange phenomenon! Thanks,

Mike

Parents
  • What I discovered was that shock cause displacement of the battery which momentarily power off and on the device. The action of on/off rapidly may have cause a current spike. This may be the cause of Flash being erased. It happens only when the device is running. What exactly is the cause, I have no idea. I added a bigger capacitor like 22uF helped to prevent power loss for a short period, enough to solve the problem for small shock. For bigger shock, we added a rubber sponge on the battery door that helps to hold batteries in place. With those 2 solutions seems to solved the problem. We didn't get Flash erase report since. Of course you can use a more sophisticated power regulator circuitry but would add up costs. Our device was low cost consumer electronics, every cents we save counts.

Reply
  • What I discovered was that shock cause displacement of the battery which momentarily power off and on the device. The action of on/off rapidly may have cause a current spike. This may be the cause of Flash being erased. It happens only when the device is running. What exactly is the cause, I have no idea. I added a bigger capacitor like 22uF helped to prevent power loss for a short period, enough to solve the problem for small shock. For bigger shock, we added a rubber sponge on the battery door that helps to hold batteries in place. With those 2 solutions seems to solved the problem. We didn't get Flash erase report since. Of course you can use a more sophisticated power regulator circuitry but would add up costs. Our device was low cost consumer electronics, every cents we save counts.

Children
No Data
Related