QE128 serial bootloader and Flash write in RAM ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QE128 serial bootloader and Flash write in RAM ?

1,729 Views
pbouf
Contributor I

Hello all,

 

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.

 

My question:

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.

 

Thanks,

Pierre

Labels (1)
0 Kudos
4 Replies

364 Views
peg
Senior Contributor IV

Hello,

 

For the umpteenth time......

 

You cannot read/execute from and programme/erase in the same flash array at the same time!!!

 

RTFM or the forum, or both

 

0 Kudos

364 Views
pbouf
Contributor I

I'd really like you to point out the exact location of this saying in the QE128 reference manual or any other manual.

 

Anyway, you helped greatly.

 

Thank you.

0 Kudos

364 Views
pbouf
Contributor I

OK, mea culpa. I found this sentence in the 346 pages of the reference manual. It says it all.

 

"It is not possible to read from a flash block while any command is executing on that specific
flash block."

0 Kudos

364 Views
Francois
Contributor I

Hello,

I'm new with DZ60 and what I've done is to put the minimum ROM reflash routines

in EEPROM (it doesn't takes a lot of space) without interrupt capabilities .

The rest of the reflash routines (decoding of data from a .mot or .s19 file)

are in a protected area of the ROM. 

 

francois

0 Kudos