Problem accessing 9S12XEP100 memory region 0x5000->0x7FFF

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

Problem accessing 9S12XEP100 memory region 0x5000->0x7FFF

960 Views
imurphy
Contributor III

Hi,

 

According to the reference manual (page 35), memory region 0x4000->0x7FFF of the 9S12XEP100 is Unpaged FLASH. I am using the region 0x5000->0x7FFF to store 'const' read-only data.

 

The memory region is programmed OK by the BDM, along with the code which is in 0xC000->0xFFFF. When the processor is reset the debugger shows the region 0x5000->0x7FFF is filled with the right values.

 

But, if the software is started then halted, the region 0x5000->0x7FFF shows different (wrong) values.

 

What could be causing this? The software uses the small memory model and I thought in this memory model 0x4000->0x7FFF will always access the same region as it's an un-paged area?

 

Thanks, Ian

Labels (1)
0 Kudos
Reply
3 Replies

656 Views
HSW
NXP Employee
NXP Employee

Did you set the ROMHM bit (bit 1) in the MMCCTL1 register (0x0013) ?

0 Kudos
Reply

656 Views
imurphy
Contributor III

Hi,

 

I just checked and it looks like that bit is set.

 

There is legacy code that uses the FLASH in region 0x4000->0x4FFF and I assumed it was accessed through the local address space.

 

Maybe this is not the case and I will try and find out.

 

Thanks, Ian

0 Kudos
Reply

656 Views
kef
Specialist I
  • I just checked and it looks like that bit is set.

So this explains why you can't read data in 0x4000.

ROMHM=1 - Disables access to the Flash or ROM in the lower half of the memory map (0x4000-0x7FFF).These physical locations of the Flash or ROM can still be accessed through the program page window. Accesses to 0x4000–0x7FFF will be

mapped to 0x14_4000-0x14_7FFF in the global memory space (external access).

0 Kudos
Reply