QE128 serial bootloader and Flash write in RAM ?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

QE128 serial bootloader and Flash write in RAM ?

2,464 次查看
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

标签 (1)
0 项奖励
回复
4 回复数

1,099 次查看
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 项奖励
回复

1,099 次查看
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 项奖励
回复

1,099 次查看
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 项奖励
回复

1,099 次查看
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 项奖励
回复