Interrupt while Flash write (HCS08 family)

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt while Flash write (HCS08 family)

425 Views
prasad1
Contributor I

Hi,

I am developing code for MC9SG8S08 microcontroller from HCS08 family. I have developed flash routine for burst programming as per reference manual of microcontroller.

While flash burst  write is going on and any timer/SPI  interrupt request received by CPU, will it generate any error? will be  flash write happen successfully? What should be taken care in this scenario.?

The flash region where flash write is going to happen contains no data which will used by ISR.

Thanks in advance. 

Labels (1)
0 Kudos
5 Replies

186 Views
kef2
Senior Contributor IV

S08 flash is not readable while it is being programmed. This means you not only have to move part of your flash erase/program code to RAM, but also have to disable interrupts for duration of program/erase operation. You could move some ISRs to RAM, but it's not possible to move interrupt vectors table to RAM.

Regards

Edward

0 Kudos

186 Views
prasad1
Contributor I

Hi Edward,

Thanks for quick reply.  flash program/erase region neither contains ISR code nor the DATA used by ISR. So is it ok to keep Interrupts on? I am using that flash to store some data only.

Thanks and Regards,

Prasad S Udawant

0 Kudos

186 Views
kef2
Senior Contributor IV

No, it‘s not OK. As I said, interrupt vectors table must be readable, and while programming it‘s not readable. If you start programming and some interrupt is triggered, CPU will read wrong address of ISR and jump into the weeds. Interrupts must be disabled.

Regards,

Edward

0 Kudos

186 Views
prasad1
Contributor I

Hi,

Thanks one again.But I still need some clarification. 

I am going to write only some bytes of one flash page. Interrupt vector table is located on other flash page. In this scenario also while programming/erasing flash  interrupt vectors table will not be readable?

 

Thanks  in advance.

Thanks and regards,

Prasad S Udawant.

0 Kudos

186 Views
kef2
Senior Contributor IV

Whole flash array/bank gets unreadable while being programmed/erased, not just page you erase program, whole array of pages. Small devices like SG8 have only single flash array. (Some big devices may have 2 big flash arrays. In such devices you could write/erase one array/bank while reading or executing code from another bank.)

Edward

0 Kudos