When I debug my program on a K22F eval board, I examine the RCM SRS0 and SRS1 registers.
I find that the SW bit is set, not the POR bit.
Is this expected? If so, is it possible when using the debugger on the K22F to detect the different startup modes, such a POR and WDG?
I am using the J-LINK SWD evaluation debugger.
I could use a hardware J-Link debugger that is required.
Hello Keith,
The problem is that when you program/enter debug session with debuggers like J-Link they always send a reset command through the register SYSRESETREQ. This is the reason why you always see the SW bit set when you are in the debug session.
If you want to see the POR bit set, I would recommend you to make a program that attaches this bit to a led of your board. When you enter to the debug session to load this program you will see once again that the SW bit is set. Now you need to exit the debug session and do a power cycle. After the power cycle you should be able to see that the LED is turned on, since now the reset was due to a Power-On Reset and not a software reset sent by the debugger.
To sum up, each time you enter to the debug session you will see the SW bit set due the command that the debuggers send to make a reset.
Hope it helps!
Victor.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Victor - Thank you for the clarification. I have a version of K22 with sticky bits. I will to at those for an alternative for debugging.