Hello All,
I have searched the Forum but I don't see an answer to my particular situation so I am hoping someone out there has done something similar.
Processor - 56F8323
Codewarrior Version - DSC56800/E 8.1.1a
I use a section of the Data FLASH to store some configuration data. What I am trying to do is to implement a Factory Reset where this data is erased and then I need to restart the code so that way the Firmware will think it was just powered up for the first time after assembly.
I can erase the FLASH but my issue is with how to restart from address 0x0000.
1) I turned on the Watch dog and the plan was to just sit in a loop until the Dog caused a reset after I erase the FLASH. The problem I am having is the Dog seems to reset the code everytime I break in Debug mode. I know the datasheet specifically says the Dog's timer stops running when halted in debug but for some reason it is still running and I am getting a reset.
2) With the Watchdog not doing what I want then my next attempt at a solution is to erase the FLASH then execute a reset command. I have not found any kind of method to perform a Software reset. I looked for an ASM opcode, a Reset Macro or function but I am just not seeing anything.
So my question is - Can someone point me to some good information on how to fix the Watchdog when in Debug mode OR can someone point me to a good software reset method?
Thanks in advance.
Solved! Go to Solution.
OK, I found a simple solution and it works just fine for my application:
Data_IFsh1_EraseSector(FLASH_Init); asm(jmp 0x00);
Just erase the FLASH sector then jump to address 0x000. It was just a little to simple for me to see at first.
If anyone has a better way I would be glad to hear it.
OK, I found a simple solution and it works just fine for my application:
Data_IFsh1_EraseSector(FLASH_Init); asm(jmp 0x00);
Just erase the FLASH sector then jump to address 0x000. It was just a little to simple for me to see at first.
If anyone has a better way I would be glad to hear it.