MC9S12DG128 Does boot from power on condition

By Kris P. : Mar 6, 2023 at 06:40 PM (18:40 hours)
Staff: Takao Y. : 3 comments

I'm working with some code that was ported from a MC9S12DP512. The code performs a ram test after some initialization is done. After running the ram test, the processor will no longer run from a power on condition. The only why the code runs is if it is executed using a debugger. The ram test checks memory from 0x2000 to 0x3FFF. If I load a different version of firmware that does not check the ram on a second board, it works perfectly.

No matter what firmware I load on the first board, it won't run from a power on condition. Any idea why and how to fix this?



The clue that it only works when being debugged indicates a few things:
1) Interrupts are probably disabled
2) Watchdog is probably disabled
3) RESET vector is pointing to the wrong address (like RAM address)



Interrupts are enabled, the watchdog timer is enabled and the reset vector is pointing to the correct location. I believe that the ram test is not working as intend and that some processor default settings are being modified by the ram test. I'm looking for a way to restore the processor default settings.