Hi All,
I am trying to reset the CPU in the middle of a debugging session. I am using Application Interrupt and Reset control register by setting the SysResetReq bit in the SCB block. (this preserves the current debugging session also).
However, as I am using ASM its a bit cumbersome. This is the code snippet I am trying to use..
AIRCR EQU 0xE000ED0C.
.
Any feedback/input help will always be appreciated.
Thanks!!
BR,
\ksnf3000
Hi Ali,
It works if I add a small segment of code like a delay loop. Don't know why!!
So, now is there a way I can come out of this reset/startup? I mean I want that the CPU only resets once and then resumes say from the LDR R5 instruction. Any ideas on how can this be achieved?
\Kashif
Hi Kashif
__ " It works if I add a small segment of code like a delay Loop. Don't know why!!"
delay is to Wait until reset happen (How many cycles is device-specific);
__ after a reset ,program execution always start at Reset _Handler
Ali
Yeah got it!! Thanks!
Also, could you provide your input on my 2nd query? "So, now is there a way I can come out of this reset/startup? I mean I want that the CPU only resets once and then resumes say from the LDR R5 instruction. Any ideas on how can this be achieved?" Means that I want this reset to happen only ONCE everytime the code runs and then come out of this reset loop and continue working.
I am trying something like this but I dont think its working.
The SYS_NVFLAGSSET, as I understand, is a general purpose flag register. I am trying to set its flag so that on reset it checks the value and comes out of this reset loop. Not sure if this is right.
Hi Jon,
Thanks for your reply. However, I did observe that the debugger points to the Reset_handler in the startup code once the code has run (without providing a local request). Strange, or is there something that I maybe missing?
Would be glad if you can clarify this?
My query is that I would like to implement a conditional CPU reset i.e only once should the CPU reset and after reset it should continue from where it stopped (since its in the debug mode) and not enter a reset loop.
When your CPU has taken the reset, execution will resume from your defined reset handler. At this point you will by definition have exited from your reset wait loop.
From the ARMv6-M Architecture Reference Manual:
In ARMv6-M, the AIRCR provides a mechanism for a system reset, see Application Interrupt and Reset Control Register, AIRCR. Setting the AIRCR.SYSRESETREQ control bit to 1 requests a reset by an external system resource. The system components that are reset by this request are implementation defined. A Local reset is required as part of a system reset request.
Setting the SYSRESETREQ bit to 1 does not guarantee that the reset takes place immediately. A typical code sequence to synchronize reset following a write to the relevant control bit is:
DSB; Loop B Loop;
This excerpt is from the ARM Architecture, so some behaviours are implementation-defined. You need to look at the documentation for your specific system.
In general though I'm not sure I understand your problem. You have a halting debug session and you want to trigger a reset of the CPU. To this end you embed instructions to request a reset, which will cause execution to resume at the reset handler. This is the behaviour defined by the architecture. You can continue to debug, but you have effectively thrown away your program state because you triggered a reset.
So, what problem are you trying to solve?
Well this is the problem I'm trying to solve actually.I want to preserve the SRAM contents of my system so that even after a soft-reset (done by the program), I am able to view the SRAM contents effectively from the point where I left the system at reset. The interval between the reset and the accessing of the SRAM will be varied later.
Thanks!
The state of SRAM in your system after a soft reset will be determined by the design of your specific system. You need to consult the manufacturer's documentation for that.
If I understand correctly, your software requires the ability to initiate a soft reset while preserving some amount of state in the SRAM. Is this data or are you executing out of SRAM at this point? You have suggested earlier that you would like the system to resume execution where it left off after triggering the reset. This is not the behaviour of the hardware so you would need to implement your software such that after the reset handler has executed and you have re-initialised your CPU, you pick up the state and resume whatever processing you suspended to do the reset.
Hi,
We had got complementary 10 number of kit with name as below from ARM University
Please send the Datasheets for the above mentioned Kit.
Please send some DSP Example testcases to be executed on this Kit.
Please send some general microcontroller based Example testcases to be executed on this Kit.
Thanks& Regards
Dr.Sayed Abdulhayan
Electronics& Communication Department
Dayananda Sagar College of Engineering
Visvesvaraya Technological University
Bangalore,India-560078
Mob-00-91-9986096513