problem with memory mapping!  thanks all!

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

problem with memory mapping!  thanks all!

1,118 Views
jeffzxg
Contributor I

Hello everyone!

i have a problem with memory mapping. For some reason ,I want to remap the register address space: 0x0000-0x3FFF, ram address space:0x0400-0x37FF, and eeprom:0x3800-0x3FFF. I use mc9s12dp512, P&E USB multilink interface tool. The process as follows.
1. modify the prm files ,
/* RAM */
      RAM           = READ_WRITE    0x0400 TO   0x37FF;
/* EPROM */
EEPROM        = READ_ONLY     0x3800 TO   0x3FFF;
2. in the start12.c file , join these commands :
INITRG = 0;
INITRM = 0;
INITEE = 0x31;
  3. then in the main.c file ,define a globle const variable
const volatile unsigned char tst1 @ 0x3c00 = 0x0a;
  
problem is  when run into the main() function, in my opinion, the tst1 should equal 0x0a, but actually , tst1 = 0xFF.  And the address content is also 0xff through memory window.

thanks for help ! 

Best wishes!

 

eeprom_test1.zip

Message Edited by t.dowe on 2009-10-21 12:43 AM
Labels (1)
0 Kudos
1 Reply

287 Views
nandu
Contributor III

Hello,

 

I think you have to check the following two conditions thoroughly ...

 

1. You have initialized both the registers "INITRG" and "INITRM" to the same value of zero in start12.c file. That means, you are telling the device to allocate the same memory for MCU Registers and for RAM.

 

2. I think you can not allign the RAM with start address of "0x0400" and EEPROM with "0x3800" in your prm file.

 

I suggest you to check the freescale application note AN2881.pdf which is attached with this post to properly modify your memory mapping.

 

AN2881.pdf

Message Edited by t.dowe on 2009-09-16 10:29 AM
0 Kudos