Kirk Humphries

debug problem

Discussion created by Kirk Humphries Employee on Jan 30, 2006

This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.

 

Posted: Mon Jul 25, 2005  9:17 pm

 

I'm using CodeWarrior and P&E's USB multilink (ML-12) to debug a 9S12XDT512 system. I'm examining the area at$1000. This should be ram, but the debugger (True-Time Simulator &Real Time Debugger) is showing me a ghost of the register area at $0000. There are some funny things going on with the EEPROM area also. I'm guessing this is a P&E problem, not CodeWarrior. I get the same results using the onboard USB BDM on a freescale/axiom DEMO9S12XDT512 system. Any ideas?

 


 

Posted: Tue Jul 26, 2005  6:57 am

 

Check if you have defined RAM, EEPROM regions and the base address for registers as part of the startup code. If you haven't, define using INITRM, INITEE and INITRG. This should solve the problem.

 


 

Posted: Tue Jul 26, 2005  9:14 am

 

Actually, this is quite explainable. The area $1000..$1FFF is controlled by the RPAGE register and the address $1000 can be considered as offset 0 into the RPAGE=0 page. With this setup you do actually end up in the register space.

 

I think (not sure, I'm not so in hardware), you can setup the debugger to display the $FC1000 to $FC1FFF RAM area when you are looking at $1000. Or, more simply, just look at $FC1000 .

 


 

Posted: Tue Jul 26, 2005  9:26 am

 

Hi.

 

Yes, we intentionally decided to display the logical memory for ram, eeprom and flash banks.

 

So at (logical) Memory $1000, you always see the ram of RPAGE=0.

At (logical) Memory $FC1000, you always see the ram of RPAGE=$FC.

 

At (logical) Memory $8000, you always see the ram of PPAGE=0.

At (logical) Memory $FE8000, you always see the ram of PPAGE=$FE.

 

This memory display was imported from HCS12 devices support, but we understand that a real physical vision of the bank is more appropriate for the S12X series. The next CodeWarrior release will adopt this display choice for all HC(S)12(X) parts.

 

Meanwhile:

 

The Debugging Memory Map user interface dialog let you change the display as you want. However, you can change the default settings if you edit the "hc12.ini" file database stored in the "prog" folder of your CodeWarrior installation.

 

Backup your original file, then replace the sections here below. In your projects, you will have to "Revert to Default" in the Debugging Memory Map user interface. New projects will use the default anyway from "hc12.ini".

 

Of course, we have other methods to upgrade this file in a clean manner, but I will need more time to give you a solution. Please contact me if you need more help.

 

Regards,

 

Code:

[MCUID03F0]   ;0x03F0=MC9S12XDP512  DMM_MODULE0=global£memory£1 0x0 0x100000 11 14 0 2 1 1  DMM_MODULE1=global£eeprom 0x100000 0x40000 12 14 1 2 1 1  DMM_MODULE2=global£memory£2 0x140000 0x2c0000 13 14 0 2 1 1  DMM_MODULE3=global£flash 0x400000 0x400000 14 14 1 2 1 1  DMM_MODULE4=Registers 0x0 0x800 1 5 0 2 1 1  DMM_MODULE5=eeprom 0xc00 0x400 100 5 1 2 1 1  DMM_MODULE6=flash£4000 0x4000 0x4000 103 5 1 2 1 1  DMM_MODULE7=flash£C000 0xc000 0x4000 104 5 1 2 1 1  DMM_MODULE8=xgate£memory 0x0 0x10000 16 15 0 2 1 1  DMM_MODULE9=DBGTBH-DBGTBL£fifo£registers 0x24 0x2 4 1 0 1 1 1  DMM_MODULE10=ram 0x1000 0x3000 102 5 0 2 1 1  DMM_MODULE11=banked£ram 0x11000 0xfe1000 107 12 0 2 1 0  DMM_MODULE12=banked£eeprom 0x10800 0xfe0400 106 13 1 2 1 0  DMM_MODULE13=eeprom£window 0x800 0x400 9999 5 0 2 1 0  DMM_MODULE14=banked£flash 0x18000 0xfe4000 105 11 1 2 1 0  DMM_MODULE15=flash£window 0x8000 0x4000 9998 5 0 2 1 0  HASDBGMODULE=0  DBGMODULEADR=0x0020  VECTORMINADR=0xFF00  S12XDEVICE=1  XGATEMODULEADR=0x380  XGATE_RAM_SIZE=0x8000  HCS12X_FLASH_SIZE=0x80000  FLASHERASEDVALUE=0xFF  BANKWINDOW0=BANKWINDOW PPAGE ON 0x8000..0xBFFF 0x30 32 0xE0  BANKWINDOW1=BANKWINDOW DPAGE ON 0x1000..0x1FFF 0x16 5 0xFB  BANKWINDOW2=BANKWINDOW EPAGE ON 0x0800..0x0BFF 0x17 4 0xFC  RANGE0=HWBPM REMAP_22BITS RANGE 0x4000 0x7FFF 0xFD  RANGE1=HWBPM REMAP_22BITS RANGE 0xC000 0xFFFF 0xFF  BDIK_AEF_ARMING_CMD0=reset  BDIK_AEF_ARMING_CMD1=bdi flash.erase addr=e08000  BDIK_AEF_ARMING_CMD2=bdi flash.erase addr=e88000  BDIK_AEF_ARMING_CMD3=bdi flash.erase addr=f08000  BDIK_AEF_ARMING_CMD4=bdi flash.erase addr=f88000  BDIK_AEF_ARMING_CMD5=bdi flash.load  BDIK_AEF_DISARMING_CMD0=bdi flash.idle  BDIK_AEF_DISARMING_CMD1=reset  SDI_AEF_ARMING_CMD0=TARGETRESET  SDI_AEF_ARMING_CMD1=FLASH  SDI_AEF_ARMING_CMD2=FLASH SELECT  SDI_AEF_ARMING_CMD3=FLASH UNPROTECT  SDI_AEF_ARMING_CMD4=FLASH ERASE  SDI_AEF_ARMING_CMD5=FLASH ARM  SDI_AEF_DISARMING_CMD0=FLASH UNSELECT  SDI_AEF_DISARMING_CMD1=FLASH DISARM  SDI_AEF_DISARMING_CMD2=TARGETRESET  FCS=mc9s12xdp512.fcs   [MCUID03F1]  ;0x03F1=MC9S12XDT512  DMM_MODULE0=global£memory£1 0x0 0x100000 11 14 0 2 1 1  DMM_MODULE1=global£eeprom 0x100000 0x40000 12 14 1 2 1 1  DMM_MODULE2=global£memory£2 0x140000 0x2c0000 13 14 0 2 1 1  DMM_MODULE3=global£flash 0x400000 0x400000 14 14 1 2 1 1  DMM_MODULE4=Registers 0x0 0x800 1 5 0 2 1 1  DMM_MODULE5=eeprom 0xc00 0x400 100 5 1 2 1 1  DMM_MODULE6=flash£4000 0x4000 0x4000 103 5 1 2 1 1  DMM_MODULE7=flash£C000 0xc000 0x4000 104 5 1 2 1 1  DMM_MODULE8=xgate£memory 0x0 0x10000 16 15 0 2 1 1  DMM_MODULE9=DBGTBH-DBGTBL£fifo£registers 0x24 0x2 4 1 0 1 1 1  DMM_MODULE10=ram 0x1000 0x3000 102 5 0 2 1 1  DMM_MODULE11=banked£ram 0x11000 0xfe1000 107 12 0 2 1 0  DMM_MODULE12=banked£eeprom 0x10800 0xfe0400 106 13 1 2 1 0  DMM_MODULE13=eeprom£window 0x800 0x400 9999 5 0 2 1 0  DMM_MODULE14=banked£flash 0x18000 0xfe4000 105 11 1 2 1 0  DMM_MODULE15=flash£window 0x8000 0x4000 9998 5 0 2 1 0  HASDBGMODULE=0  DBGMODULEADR=0x0020  VECTORMINADR=0xFF00  S12XDEVICE=1  XGATEMODULEADR=0x380  XGATE_RAM_SIZE=0x5000  HCS12X_FLASH_SIZE=0x80000  FLASHERASEDVALUE=0xFF  BANKWINDOW0=BANKWINDOW PPAGE ON 0x8000..0xBFFF 0x30 32 0xE0  BANKWINDOW1=BANKWINDOW DPAGE ON 0x1000..0x1FFF 0x16 5 0xFB  BANKWINDOW2=BANKWINDOW EPAGE ON 0x0800..0x0BFF 0x17 4 0xFC  RANGE0=HWBPM REMAP_22BITS RANGE 0x4000 0x7FFF 0xFD  RANGE1=HWBPM REMAP_22BITS RANGE 0xC000 0xFFFF 0xFF  BDIK_AEF_ARMING_CMD0=reset  BDIK_AEF_ARMING_CMD1=bdi flash.erase addr=e08000  BDIK_AEF_ARMING_CMD2=bdi flash.erase addr=e88000  BDIK_AEF_ARMING_CMD3=bdi flash.erase addr=f08000  BDIK_AEF_ARMING_CMD4=bdi flash.erase addr=f88000  BDIK_AEF_ARMING_CMD5=bdi flash.load  BDIK_AEF_DISARMING_CMD0=bdi flash.idle  BDIK_AEF_DISARMING_CMD1=reset  SDI_AEF_ARMING_CMD0=TARGETRESET  SDI_AEF_ARMING_CMD1=FLASH  SDI_AEF_ARMING_CMD2=FLASH SELECT  SDI_AEF_ARMING_CMD3=FLASH UNPROTECT  SDI_AEF_ARMING_CMD4=FLASH ERASE  SDI_AEF_ARMING_CMD5=FLASH ARM  SDI_AEF_DISARMING_CMD0=FLASH UNSELECT  SDI_AEF_DISARMING_CMD1=FLASH DISARM  SDI_AEF_DISARMING_CMD2=TARGETRESET  FCS=mc9s12xdp512.fcs



 

 


 

Posted: Wed Jul 27, 2005  2:33 am

 

I get it. Thanks. Is this in the documentation somewhere?

 


 

Posted: Wed Jul 27, 2005  3:48 am

 

One more thing. I can get the debugger to display ram page $fb1000, which shows me the ram that gets mapped to $1000 in the CPU's space. However, the little automatic symbol window says "core ram page fb". It does not display the actual symbols for the ram variables. However, if I point the debugger's memory window at $1000, I get the automatic symbol names for the variables (handy!), but the actual data is a ghost of the IO registers at $0000 (worthless). Is that really the way you intended it to work???

 


 

Posted: Wed Jul 27, 2005  12:35 pm

 

This was a "convention" in the debugger.

 

Since CW12V40 (and one P&E Multilink USB20 service pack for CW12V31), the new Debugging Memory Map GUI/Manager gives the possibility to display as you want. The GUI has a report window giving live details about the way the chip memory is accessed.

Regards,

Outcomes