MPC5775K eeprom

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

MPC5775K eeprom

2,317 Views
ronliu
Contributor IV

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

162493_162493.bmp分区.bmp

Labels (1)
0 Kudos
6 Replies

1,565 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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:

Example MPC5748G Flash RW 

https://community.nxp.com/docs/DOC-106580 

Regards,

Lukas

0 Kudos

1,565 Views
ronliu
Contributor IV

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

11.png

21.bmp

0 Kudos

1,565 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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;

pastedImage_1.png

Where does it crash in your project? Which instruction?

Regards,

Lukas

0 Kudos

1,565 Views
ronliu
Contributor IV

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

1052.bmp

620.bmp

0 Kudos

1,565 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

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

0 Kudos

1,565 Views
ronliu
Contributor IV

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

0 Kudos