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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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

1,441 次查看
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

标签 (1)
0 项奖励
回复
3 回复数

1,137 次查看
HSW
NXP Employee
NXP Employee

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

0 项奖励
回复

1,137 次查看
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 项奖励
回复

1,137 次查看
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 项奖励
回复