k22 FlashErase/program not working in HS Run mode

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

k22 FlashErase/program not working in HS Run mode

1,423件の閲覧回数
jaswanth
Contributor I

Hi All,

I am using TWR-k22f120M-eval kit. My application need the core clock to run at 120Mhz. So I configured it to run in HS run mode. but FLASH_Erase API is returning error (kStatus_FTFx_AccessError (errorcode 103)). but same FLASH_Erase API is returning SUCCESS if core clock is running at 80Mhz.

here is the non working code(HSRUN mode):

To simulate error scenario replace BOARD_BootClockRUN() with mcgConfig_BOARD_BootClockHSRUN() in flah example extracted from SDK.

is there any way to use flash API successfully in HS run mode?

0 件の賞賛
返信
2 返答(返信)

1,409件の閲覧回数
ErichStyger
Specialist I

Hi @jaswanth ,

you cannot program the flash in HSRUN mode. if using HSRUN you need to change the mode during flash programming and then go back to HSRUN. How I am doing this with the SDK you can see in

https://github.com/ErichStyger/MetaClockClock/blob/main/Firmware/ClockCommon/nvmc.c

ErichS_0-1619846596037.png

 

I hope this helps,

Erich

1,418件の閲覧回数
mjbcswitzerland
Specialist V

Hi

It is not possible to program flash in HSRUN mode on your device.
You need to reduce the speed to <= 80Mz and switch to normal RUN mode, do the programming , and then move back to HSRUN mode.

There are a number of restrictions in HSRUN mode that are all defined in the user's manual.

Regards

Mark