Flash Read/ write problem for s12xdg

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

Flash Read/ write problem for s12xdg

455 Views
Pinak
Contributor II

I am working on flash bootloader on xdg128.

 

For communication with bootloader I am using serial port with interrupt.

 

But if I dont disable interrupt while actual flash read/write operation are going on the code hangs.

 

As per program flow chart for xdg128(as mentioned in datasheet), nothing is written about disabling interrupt.

 

Also as per flowchart if i check CBEIF bit for writing next word, writing fails. It works if some delay is given between them.

 

Why so.

Labels (1)
0 Kudos
1 Reply

269 Views
kef
Specialist I

Flash memory is not readable while any flash command is in progress (erase, blank check, program etc). You need to disable interrupts before, and reenable them only after flash command is complete. Also part of your flashing code, which clears CBEIF and waits until CBEIF is set, should execute from RAM or another memory, which is readable while flash is being programmed, erased etc.

0 Kudos