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

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

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

650件の閲覧回数
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 返信

500件の閲覧回数
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 件の賞賛
返信