Flash Access Error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
3,108件の閲覧回数
renka
Contributor II

I'am currently working with K26f processor with KDS3.2 and KSDSK v1.3. Core clock is 180Mhz,Flash Clock is 25.71 Mhz as Processor Expert recommends...

I imported Flash Driver component into my project,selected the address to erase in internal flash,but FlashErase () returns me error 0x20 - Flash Access Memory.Following is my code after importing "Flash Driver Component" from Component Library.

#define LAUNCH_CMD_SIZE 0x100
pFLASHCOMMANDSEQUENCE g_FlashLaunchCommand = (pFLASHCOMMANDSEQUENCE)0xFFFFFFFF;
// Array to copy __Launch_Command func to RAM.
uint16_t ramFunc[LAUNCH_CMD_SIZE/2];

uint32_t destAdrss = (uint32_t *)0x0001efff ;
// Set command to RAM.
g_FlashLaunchCommand = (pFLASHCOMMANDSEQUENCE)RelocateFunction((uint32_t)ramFunc , LAUNCH_CMD_SIZE ,(uint32_t)FlashCommandSequence);
INT_SYS_DisableIRQGlobal();
uint32_t result = FlashEraseSector(&flash1_InitConfig0,destAdrss,FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE,
g_FlashLaunchCommand);
INT_SYS_EnableIRQGlobal();

result backs to me error 0x20 - Flash Access Error....

What's wrong here?

Thanks in advance.

1 解決策
2,709件の閲覧回数
mjbcswitzerland
Specialist V

Hi

pastedImage_1.png

This will explain if you are in HSRUN mode. To program flash you need to be in RUN mode (max. 120Mhz CPU clock).

Regards

Mark

元の投稿で解決策を見る

4 返答(返信)
2,709件の閲覧回数
renka
Contributor II

Thank you very much. It's working.

0 件の賞賛
返信
2,710件の閲覧回数
mjbcswitzerland
Specialist V

Hi

pastedImage_1.png

This will explain if you are in HSRUN mode. To program flash you need to be in RUN mode (max. 120Mhz CPU clock).

Regards

Mark

1,855件の閲覧回数
fitz-nguyen
Contributor I

The solution work !!! 

this help me alot. Thank for very helpful advise. 

Regards.

0 件の賞賛
返信
2,709件の閲覧回数
abdullahkahrama
Contributor IV

I was having kStatus_FLASH_AccessError while using FLASH_Erase command with Kinetis SDK 2.2 with a K02F microcontroller.

I was puzzled why it had such an issue until I saw your answer. Thank you very much. I really appreciate your this and other countless helps to the community.

0 件の賞賛
返信