C90TFS Flash driver on K66F

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

C90TFS Flash driver on K66F

921件の閲覧回数
a8Chcx
Contributor V

Hi,

I am using "MK66FN2M0VLQ18" for my controller.

1) If my program is running in the first 256K range, I am trying to erase/program from 0x0004_0000 to 0x0007_FFFF, I get MCU RESET. It works fine if I disable interrupt during flash operation.

2) If I  am trying to erase/program from 0x0008_0000 to 0x001F_FFFF, it works fine. no need to disable interrupt.

Questions:

1) Can I run a program in block0 and erase/program area in block0 as well? Or I have to erase/program in other block?

2) If need to erase/program in other block, why does it work if I disable the interrupt?

3) Is there any way to erase/program in the same block as running block? Do I need to set callback function to fix it?

Thanks,

Christie

ラベル(1)
3 返答(返信)

678件の閲覧回数
mjbcswitzerland
Specialist V

Christie

As you have already experience you can erase/program in block 0 as long as you disable interrupts.

If you need to do it without disabling interrupts you need to ensure that none of the interrupts that can be called will need to access block 0 (which can't be accessed during erase/programming operations). This can be done by having the interrupt vector table in SRAM (of the other half of Flash) and all possible code that will be executed in the interrupt in either SRAM or the other half of Flash.

Regards

Mark

678件の閲覧回数
a8Chcx
Contributor V

Hi Mark,

I checked C90TFS flash driver, there is option to run in RAM.

Could you tell me how to use this feature in C90TFS?

Thanks,

Christie

678件の閲覧回数
mjbcswitzerland
Specialist V

Hi

I don't know of use the C90TFS driver so you will need to read its documentation for details.

However, it is always necessary to use SRAM to run the flashing code when working in the same block as the code is in (if it worked by disabling interrupts for you I assume that it is already enabled).

Generally though the flash driver is only a part of the overall solution - it won't solve details about where code is located and whether interrupts can be handled during flash operations; this is a system-wide design point beyond the driver.

Regards

Mark