Interrupt while Flash write (HCS08 family)

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

Interrupt while Flash write (HCS08 family)

946 次查看
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. 

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

707 次查看
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 项奖励

707 次查看
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 项奖励

707 次查看
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 项奖励

707 次查看
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 项奖励

707 次查看
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 项奖励