Hi,
I'm working with the MPC5775K now. I see there is an EEPROM part in the MCU.I'd like to use the EEPROM to store some data.But the module couldn't work correctly. Did anyone here had experience to make it work well? Who could share some example codes? Thanks a lot.
Best regards,
Ron
Hi,
there are EEPROM Emulation drivers and Standard Software Drivers for flash:
http://www.nxp.com/files/run_time_software/device_driver/MPC5xxx_EEE_DRIVER.exe
http://www.nxp.com/files/product/software/C55_JDP_SSD.exe
SW examples for MPC5775K are included in both of them.
Example for EEPROM Emulation drivers uses four EEPROM blocks in low address space.
Then you can take a look at these examples:
https://community.nxp.com/docs/DOC-106580
Regards,
Lukas
Lukas,
Thanks.
I rewrite the driver code in the MPC5775K based on the example 'MPC5748G_Flash_RW'.I test the driver code. But the program just goes dead when I try to call the driver function. I'd like to use all of the four blocks to store files and read them back. But, it still doesn't work now...
Regards,
Ron
Hi,
I tested the code and it works as expected on my side:
//unlock mid block 0x00FB_8000 - 0x00FB_FFFF
C55FMC.LOCK0.R &= 0xFFFEFFFF;
//erase the mid block
C55FMC.MCR.B.ERS = 1;
C55FMC.SEL0.R = 0x00010000; //select the mid block
*(unsigned int*)0x00800000 = 0xFFFFFFFF; //interlock write
C55FMC.MCR.B.EHV = 1;
while(C55FMC.MCR.B.DONE == 0);
C55FMC.MCR.B.EHV = 0;
C55FMC.MCR.B.ERS = 0;
//program one page in the mid block
C55FMC.MCR.B.PGM = 1;
*(unsigned int*)0x00800000 = 0x11111111; //interlock write
*(unsigned int*)0x00800004 = 0x22222222; //up to 8 words (one 256bit page) can be programmed at once
*(unsigned int*)0x00800008 = 0x33333333;
*(unsigned int*)0x0080000C = 0x44444444;
*(unsigned int*)0x00800010 = 0x55555555;
*(unsigned int*)0x00800014 = 0x66666666;
*(unsigned int*)0x00800018 = 0x77777777;
*(unsigned int*)0x0080001C = 0x88888888;
C55FMC.MCR.B.EHV = 1;
while(C55FMC.MCR.B.DONE == 0);
C55FMC.MCR.B.EHV = 0;
C55FMC.MCR.B.PGM = 0;
Where does it crash in your project? Which instruction?
Regards,
Lukas
Lukas,
Thanks.
The first line causes the crash. When the crash occurs, I'm not able to control the program. What is halting executing ?
I see that you are using a software to see the ROM data. What's that?
Regards,
Ron
Hi,
could you share your project? It will require some debugging to find the root cause.
I use Trace32 debugger from LAUTERBACH DEVELOPMENT TOOLS
Regards,
Lukas
Lukas,
I found that it would work correctly if I create a new project. So I disable all the initialization of peripherals. It could work too. It really disturbs me now. I haven’t found which peripheral conflicts with eeprom.
Regards
Ron