Dear experts,
I am a novice with this processor, but got a task recently: reset EPC5200 programmatically.
Under 'reset' I mean - force to execute bootloader same way as it occurs on power cycle.
Here is the code I've got from team lead:
// Turn ethernet off
Ethernet::Close();
//mask all interrupts
ICTL->cprimmsk = 0x1FFFF;
//wait to make sure everything is off
SystemUtils::MSleep(1000);
void(*localProgramAddressFPtr)(void) = reinterpret_cast<void(*)(void)>(0xFFF00000 + 0x100);
//call the reset routine
(*localProgramAddressFPtr)();
But instead of rebooting, the application freezes.
What I am doing wrong? Might there be a different way to accomplish? Some standard API call etc.
Thank you,
Alex
Hi
Thank you for contacting us.
Please let us know your NXP chip part number, thus we can assign right engineer for your issue.
Thanks,
Jun Zhang
The MPC5200 hardware does not have possibility to produce the same reset as POREST. It is possible to produce HRESET assertion only.
The simplest is the following for HRESET assertion:
produce Machine check exception and HRESET assertion
produce HREST using watchdog.