Content originally posted in LPCWare by MX21 on Wed Jan 05 09:18:06 MST 2011
Good points. I'm using the NVIC_SystemReset() function in my code already, so if I could specify a fixed address for that function, I could then use "G <fixed address> T" force a reset.
Thanks,
MX
Quote: curtvm
I'm not an expert, but I think you are mistaken that a 'go' to address 0 will do anything useful. Address 0 holds the address of the initial sp value, so who knows what happens when trying to execute that address. Address 0x4 holds the reset address, but you can't just 'go' to that either. I am assuming that a 'go' command will actually load the pc with the value given, and set bit0 if the 't' option is given.
I would guess you could go a couple ways- either 'read memory' of the reset vector, then 'go' to that address.
Or if you want a 'true' reset, compile a function using NVIC_SystemReset() , get the compiled code for that function (a one time thing), write that code to ram, then 'go' to that ram address.
I don't know what state the 'go' command leaves behind, but a true reset would leave no doubt about what the state of the lpc is in when your code starts.
I could be wrong.