I have added the driver code to my own project , but when swapping, an error of "eraseStatus_Flag = ERASE_SWAPERROR" occured.
MCU: MPC5744p Q9
DRIVER: EEE_Driver_v1.2.0 (no modified)
Memory Layout:
main: as same as main function in ee_demo.c;
When the first block is full , it should be swapped. After swapping, the eraseStatus_Flag = ERASE_SWAPERROR;
I traced the procedure of EEE_Driver, and I found that before'FSL_FlashEraseStart' was exacuted, the block is full like below:
but after the funtion 'FSL_FlashEraseStart' being exacuted, the first block can not be erased succesfully. see below:
we can see that there were four bytes can not be erased.
this case coursed 'EE_ERROR_MISMATCH' error in function 'FSL_FlashRead' doing the 'BLANK_CHECK' in the after steps.
That's why swap failed.
What I want to kwno is how can I swap the blocks successfully?
I even moved all the code to RAM from ROM and then exacuted them , but the result is still same.
One thing need NOTE: I used the DEMO project of RAM, the result is sucessful. But when I run the DEMO of FLASH, I found that I cannot down load the .elf file to MCU. See below:
I also want to know the reason.
Solved! Go to Solution.
Hi,
first of all, let's try if the flash can be erased ever. Select in main menu: MPC5XXX -> Tools -> Program FLASH (Prepare only)
Then enter this command: flash.erase 0x00800000--0x00803FFF
Is this working?
Regards,
Lukas
Hi,
first of all, let's try if the flash can be erased ever. Select in main menu: MPC5XXX -> Tools -> Program FLASH (Prepare only)
Then enter this command: flash.erase 0x00800000--0x00803FFF
Is this working?
Regards,
Lukas
Thank you very much for your response. But it needs not to try, because I got the reason why SWAP failed.
when I moved the code from DEMO project to my own project, I lost the macro definition of "DCACHE_AVAILABLE".
So I have tried to add the definition of "DCACHE_AVAILABLE" to my own project, and glad to see the SWAP succesfully.