I am using the MC9S08QE128 and I am writing a boot loader to copy application code in the lower flash locations. Looking at the serial bootloader in AN2295, I see that the erase and write flash subroutines are copied in RAM and then executed from there. In my boot loader, I try to run the write command without copying the code in RAM, in other words I run it from the boot loader ROM directly since the boot loader must not overwrite itself by design. When I step trace the code with the BDM the write command works everytime but when I let it run full speed (F5 in the TrueTime debugger) the CPU goes wild (I assume it resets) and the debugger gets lost. More precisely I get ILLEGAL_BP and Triggers A & C occurred errors in an unpredictable way.
Do I absolutely have to copy and run the flash command routines from RAM ? Can you help me otherwise ?
Some sample C code would be terrific.