I'm porting a bootloader to my MK10DN512VLL10. Trouble verifying written bytes?

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

I'm porting a bootloader to my MK10DN512VLL10. Trouble verifying written bytes?

1,045 次查看
markosiponen
Contributor III

I'm porting a bootloader to my MK10DN512VLL10. I have used it in an MKL15Z128VFT4 before wihout problems.

When I execute a "Program Longword" and then read back the four written bytes I get a miss match. But if i single step my code it works.

If I disable the verification I can successfully download my application to flash with my bootloader.

I suspect the cache memory is the problem and it reads back the four bytes from cache memory and not from flash?

How do I make sure i really read back the four bytes from flash and not cache?

Update

I found this Flash cache invalidate.

So i tested to disable the cache before and after write to flash and it works.

    PFB0CR_restore = FMC->PFB0CR;

    FMC->PFB0CR = PFB0CR_restore | FMC_PFB0CR_CINV_WAY(15); <--- I selected all as I don't know what else to select

   

    execute_flash_command();

   

    FMC->PFB0CR = PFB0CR_restore;

0 项奖励
回复
1 回复

895 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello:

I see you found a solution/workaround in that other thread. I just wanted to confirm, is your issue resolved?

Regards!

Jorge Gonzalez

0 项奖励
回复