How to get the EEPROM in the memory map on 9s12XEQ384

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

How to get the EEPROM in the memory map on 9s12XEQ384

1,621 Views
erichnast
Contributor I

I am using all of the DFLASH on this part; 32768 bytes.

I am using all of the EEPROM on this part; 4096 bytes.

 

After I have used debugger to load the program I can see both the DFLASH at 0x10_0000 and the EEPROM at 0x13_f000.  The program runs, I can write to both these memories and I can read from both memories.  So I am feeling successful.

 

But if I power the unit down, and turn on the power again then the EEPROM is no longer in the memory map. The unit runs, but the EEPROM now has different values in it.

 

I have tried to set MMCCTL1 = EEEIFRON; and it does not help me.

 

I have used the FTM to read EEPROM Emulation Query and it gives me DFPART = 0xffff and ERPART = 0xffff.

I then set the DFLASH for Full Partition DFLASH as it appears not to be setup.  This gives me an ACCERR error in FSTAT.

 

I clear the FSTAT error.

Then I Enable the EEPROM emulation using the FTM and it gives me an error.

I clear this FSTAT error and do the EEPROM Emulation Query and it gives me DFPART = 128 and ERPART = 16 which is correct.

 

But the EEPROM memory is not visible at 0x13_f000.  There is RAM here as I can change this memory address range by editing it with the debugger.

 

I hope all of this makes sense!  I am sure I have something missing, but I cannot guess where.

Labels (1)
0 Kudos
Reply
1 Reply

964 Views
RadekS
NXP Employee
NXP Employee

Hi Erich,

It seems that you don’t have partitioned DFLASH for using it as EEEPROM or your partition is not correct.

The DFPART = 128 and ERPART = 16 is not valid configuration. If you want to use whole DFLASH for EEPROM emulation, please use DFPART = 0 and ERPART = 16 in (Full) Partition command.

Please look at attached short S12XE EEE description and example codes.

Please look also at my additional comments here:

https://community.nxp.com/message/810608#comment-810608

and here:

https://community.nxp.com/message/590798#comment-590798

The partition information could be erased only by mass erase command in special mode. The simplest method is executing unsecure command in Code Warior debugger menu ->MultilinkCyclonePro->Unsecure…

This way you will get completely erased MCU and you can execute (Full) Partition command again.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply