kanni1303
Full Member level 3
- Joined
- Jun 29, 2012
- Messages
- 164
- Helped
- 12
- Reputation
- 24
- Reaction score
- 11
- Trophy points
- 1,298
- Location
- Chennai, Tamil Nadu, India
- Activity points
- 2,709
Hi,
I came across this following code, and my understanding from it as, the particular memory is erased and the same address is pointed by a function. Using this function pointer the address is invoked. my questions is what will the behavior is accessing or jumping to an erased memory, most case it will reset, but which one causes it to reset....??? the watchdog is disabled.
This code is taken from microchip bootloader application note.
I came across this following code, and my understanding from it as, the particular memory is erased and the same address is pointed by a function. Using this function pointer the address is invoked. my questions is what will the behavior is accessing or jumping to an erased memory, most case it will reset, but which one causes it to reset....??? the watchdog is disabled.
This code is taken from microchip bootloader application note.
Code:
pFlash = (void*) (0x9D006000 + 0x1000);
result = NVMemErasePage(pFlash);
// Assert on NV error. This must be caught during debug phase.
ASSERT(result == 0);
void (*fptr)(void);
fptr = (void (*)(void))(0x9D006000 + 0x1000);
fptr();