Electron SoS Code 7

Hey guys,

I have an electron that is occasionally SoSing with a Code 7 pattern (Exit).
There isn’t great documentation on this mode of failure. It seems to be specific to the device, other parts running the same firmware/app aren’t experiencing this issue.

What does Code 7 usually mean? If I wanted to setup JTAG debugging, where would be a good place to put breakpoints, in system firmware?
Thanks!

Hi @ahigginscassidy,

Can you tell us more about what version of system firmware you’re using, which version of the Electron, and share details on your application firmware? What is it doing, etc. Or can you share any details of how you’re powering the device, what it’s connected to, etc?

Thanks,
David

1 Like

Hey Dave,

This device is running System Firmware 0.5.3. Right now it’s just idling with our production app. It’s powered via USB (but it’s behavior doesn’t change when powered via 3v3). It’s currently connected to our production circuit board. I’ve verified it’s behavior when it is not connected, the problem isn’t with our board.

Firmware wise, it’s running the same application as a hundred other devices, none of which have this Code 7 error. I’ve replicated the setup (same code paths) on another device and it performs normally.

This was a production device that has since been replaced, and it’s replacement is performing normally with the same external hardware setup. My next steps are going to be to wipe the device completely and check it’s behavior, but I want to be sure there isn’t any more information I can pull off of it while I have it reproducing this error.

Hi @ahigginscassidy,

Hmm, 053 is a rather old version of system firmware, do you see this issue when using a more recent version? It’s possible you’re hitting some old bug that’s long since been fixed?

I’m not personally familiar with typical “exit” SOS errors, so maybe someone else can chime in. But it’s hard to recommend more without knowing basics about the schematic or what your firmware is doing.

Thanks!
David

You get this type of “exit” error when some code calls _exit() or _abort(). These calls do not exist in the the Particle deviceOS itself but I have seen these come in with newlib, the C library of standard functions that Particle devices use.

I would look around your code for any calls to the standard C functions, particularly string handling functions (begin with str) or similar. One of these functions is likely having a fatal exit or abort. This could also be a bad keys situation and the crypto lib is aborting, but I have never seen that happen with this error before.

As to why this particular device and not the others–maybe some string or pointer is empty or has garbage values in emulated EEPROM or the locked DCD region; it’s hard to say.

Maybe dumping the bootloader and DCD flash on the failing device and a good device and then comparing them could show something. There should be differences in the keys and user emulated EEPROM if you are using it, but not elsewhere. In DFU mode:

dfu-util -d 2b04:d00a -a 0 -s 0x8000000:0x100000 -U dump1.bin

Use your favorite hex editor to compare the two dump files–it should be quick.

3 Likes