MPC5748G FlashDriver program three blocks fail continuously

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5748G FlashDriver program three blocks fail continuously

718 Views
Ada_Lovelace
Contributor IV

HI All,

I  code the Flashdriver to write APP data to address:0x01200000 to 0x01280000. I write the flashdriver

code to ram address, then Bootloader use it to erase and write data.

But when I test the code , I found it that it has a problem:

0x01200000 ~ 0x0123FFFF , it could write data successfully.

0x01240000 ~ 0x0127FFFF, it could write data successfully.

0x01280000 ~ 0x012BFFFF, it could write data fail.

Ada_Lovelace_0-1658380790624.png

Ada_Lovelace_1-1658380866547.png

Then I change some methods to test it, I put the flashdrvier code to Bootloader without ram,but Block 0x01280000 write fail all the same.

Then I test another way, set the breakpoint when it is programing the data to flash 0x01280000 address .

I debug it , it could write the data by step over , but when I run it  without breakpoint, it will fail to write data to only Block 0x01280000.

Ada_Lovelace_2-1658381172729.png

Then I change  the block address,  three blocks , it will fail at the third one.

I  reference the flashdriver code about MPC5748G-Flash_RW-GHS614_v1-1, why it will cause the 

problem when  I operate three flash addresses continuously?

I put the code it out, can anyone tell me how to solve it ?

Ada_Lovelace_3-1658381413731.png

 

Ada_Lovelace_4-1658381430220.png

 

 

Tags (1)
0 Kudos
3 Replies

711 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I have two ideas:

1. You wrote:
"I debug it , it could write the data by step over , but when I run it without breakpoint, it will fail to write data to only Block 0x01280000."
This is typical symptom of Read-While-Write error. I can see that all three mentioned blocks belong to partition 7. That means there's no problem with programming code (I can understand from your description that the code is running from RAM) but it could be caused by interrupt. Did you try to disable interrupts before the programming?

2. Is data cache disabled? Or did you try to invalidate the cache after programming?

And what does it mean that it "fails"? You just can't see your data in that block or is machine check exception IVOR1 triggered? If so, what is the content of MCSRR0 and MCSR core registers? This could help to find what accessed the flash.

lukaszadrapa_0-1658388672730.png

 

Regards,
Lukas

0 Kudos

704 Views
Ada_Lovelace
Contributor IV

HI,Lukas

1. I do not use interrupt in the Bootloader. I try to put the flashdriver code in the bootloader (not in RAM), the third block do not write data. It's 0xFF.

2. I do not enable CACHE, it will not cause IVOR1 triggered. I want to write the three block's data into the 

addree, but only the third block has problem, the data is not expected, it's all 0xFF. 

But when I debug the code , the third block can be write the expected data into the address by the breakpoint. It means I can write the third block by the step over. But It's 0xff when I run the project without breakpoint. You can see the image.

I do not understand why it will cause the problem like this, what should I check to solve it ?

0 Kudos

695 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

After running this code without breakpoint, could you double check if that block in still unlocked in LOCK2 registers? What is the state of PEG bit in C55FMC_MCR register?

What about other bus masters? Are they running? I mean other cores or DMA...

Regards,

Lukas

PS. My next answers may be delayed due to summer vacations in our team.

0 Kudos