D-Bug 12 Hardware breakpoints for 9S12XDP512 Target

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

D-Bug 12 Hardware breakpoints for 9S12XDP512 Target

4,926 次查看
zdriver
Contributor I
I have recently changed over from 9S12DP256B to 9S12XDP512 CPU (Adapt9S12XDP512) and have not had success getting hardware breakpoints to work at all when debugging. I am using a BDM pod (microBDM12XG) to target the 9S12XDP512, the pod has D-Bug 12 on it. I use D-Bug 12 to set the breakpoint, the problem is target never stops on the breakpoint, it appears to set up okay. The code is in fixed flash space.
 
My question is does 9S12XDP512 support hardware breakpoints?, if it does, is there more setup required or a newer version of D-Bug12 that supports this?  I had a similiar problem when I started using 9S12C32 cpu, hardware breakpoint did not work, at that time an updated version of D-Bug12 was released which allowed breakpoints to work on that device. See text below;
 

D-Bug12 4.5.0a10

Copyright 1996 - 2004 Motorola Semiconductor

For Commands type "Help"

S>device

Device: S12XDP512, MC9S12XDP512

EEPROM: $0000 - $0FFF

Flash: $8000 - $BFFF Pages: 32 PPAGE at: $0030

RAM: $1000 - $3FFF

I/O Regs: $0000 - $07FF

Target Speed: 16000 KHz

S>usehbr

Using Hardware Breakpoints

S>br C007

Breakpoints: C007

S>g C000

R>stop

Target Processor Has Been Stopped

S>br

Breakpoints: C007

S>

 

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

2,204 次查看
imajeff
Contributor III
Hi zdriver,

You should probably give some disassembly starting at C000. I can't tell if you even have valid instructions there. Have you been able to single-step?

0 项奖励
回复

2,204 次查看
zdriver
Contributor I
Current project is 12K of code, so would be a bit much to post,  here is a short test program I wrote to demonstrate, list file follows;
 
Freescale HC12-Assembler
(c) Copyright Freescale 1987-2006
   Loc    Obj. code   Source line
   ------ ---------   -----------
                     
                     
                      
                                  
                     
                       XDEF          START           ; export 'START' symbol for RESET Vector 0
                       ORG $C000 ;This is program main location in top of fixed flash area
  a00C000 CF40 00     START         LDS #$4000 ;Set Stack (16384) Top of RAM
  a00C003 8601        REPEAT        LDAA          #1
  a00C005 C602                      LDAB          #2
  a00C007 87                        CLRA
  a00C008 C7                        CLRB
  a00C009 20F8                      BRA           REPEAT
 
 
 

After loading into flash, Program can be seen in the correct location, but execution did not stop at the breakpoint, I manually stopped it. Trace is working, here is D-Bug12 display;

S>fbulk

S>fload

**

S>br C009

Breakpoints: C009

S>g C000

R>stop

Target Processor Has Been Stopped

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE C007 4000 0000 0000 01:02 0 1101 0000

xx:C007 87 CLRA

S>t 2

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE C008 4000 0000 0000 00:02 0 1101 0100

xx:C008 C7 CLRB

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE C009 4000 0000 0000 00:00 0 1101 0100

xx:C009 20F8 BRA $C003

S>t 1

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE C003 4000 0000 0000 00:00 0 1101 0100

xx:C003 8601 LDAA #$01

S>

 

Moved the code into ram and had the same results, trace works but breakpoints don't;

Freescale HC12-Assembler

(c) Copyright Freescale 1987-2006

Loc Obj. code Source line

------ --------- -----------

                                      ORG $2000 ;Fixed ram

a002000 CF40 00 START LDS #$4000 ;Set stack 

a002003 8601 REPEAT LDAA #1

a002005 C602 LDAB #2

a002007 87 CLRA

a002008 C7 CLRB

a002009 20F8 BRA REPEAT

 

load

*

S>br 2009

Breakpoints: 2009

S>g 2000

R>stop

Target Processor Has Been Stopped

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE 2008 4000 0000 0000 00:02 0 1101 0100

xx:2008 C7 CLRB

S>t 4

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE 2009 4000 0000 0000 00:00 0 1101 0100

xx:2009 20F8 BRA $2003

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE 2003 4000 0000 0000 00:00 0 1101 0100

xx:2003 8601 LDAA #$01

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE 2005 4000 0000 0000 01:00 0 1101 0000

xx:2005 C602 LDAB #$02

PP PC SP X Y D = A:B CCR = IPL SXHI NZVC

FE 2007 4000 0000 0000 01:02 0 1101 0000

xx:2007 87 CLRA

S>

My next question is D-Bug12  ver 4.5.0a10 in a BDM pod compatible with 9S12XDP512 target? If not is there a newer version that is? Breakpoints work fine with 9S12C32 and 9S12DP256B targets I have used previously.
0 项奖励
回复

2,204 次查看
kef
Specialist I
XDP512 and DP512 have different breakpoints hardware. So D-Bug (I'm not familiar with) should take it into account. I thought that you have not XDP512 compatible D-Bug, but what's this:
 
CCR = IPL SXHI NZVC
 
Is IPL an interrupt priority level? IPL and 16bits wide CCR was introduced in S12X family and one of the first of S12X was 9S12XDP512. So you have at least some support for 9S12XDP512
0 项奖励
回复

2,204 次查看
zdriver
Contributor I
This version of D-Bug12 seems to have XGATE support, but not fully working. I can examine global addresses, but trying to stop the XGATE CPU fails.  I am not using XGATE yet, nor done any setup of it in my application, it will be in its out of reset state. See below, D-Bug12 seems to indicate the XGATE CPU is running, but is then unable to stop it, and then shows it not enabled depending which command I send it;
 

D-Bug12 4.5.0a10

Copyright 1996 - 2004 Motorola Semiconductor

For Commands type "Help"

S>gmd 7FC000

7FC000 CF 40 00 86 - 01 C6 02 87 - C7 20 F8 FF - FF FF FF FF .@....... ......

S>

S>XRD

XGate CPU Is Running, Can't Access Registers

S>XSTOP

Could not Stop the XGate CPU

S>XT

XGate Module Is Not Enabled

S>

 

With the above results I'm not sure what the XGATE is doing, not sure if it effects the lack of working breakpoint support. 



Message Edited by zdriver on 2007-06-16 03:41 PM
0 项奖励
回复

2,204 次查看
zdriver
Contributor I
Examined the debug module address space of the target board today of a working connection to a 9S12C32 and the non working 9S12XDP512. This space is at 0x0020-0x002F for both CPU's.
 
When I use the 9S12C32, I can see my actual breakpoint addresses and a few other registers change in the $20 -$2F register space when using D-Bug12 to set them.
 
When I connect to the 9S12XDP512, $20 - $2F is all $00 data and never changes at all when using breakpoints!   I realize that the registers are different in the 9S12X CPU but no changes were observed from the $00 state in any register.
 
I would be interested to here from anyone who has had success with a microbdm12xg Pod  and breakpoints when targetting a 9S12XDP512 processor.
0 项奖励
回复

2,204 次查看
zdriver
Contributor I
I submitted a service request on this topic today, hopefully  D-Bug12 will be updated to work with the 9S12X target. 
0 项奖励
回复

2,204 次查看
Alban
Senior Contributor II
Hello and Welcome Zdriver,

I can answer the first question.
Yes, hardware breakpoints exist and work on S12XD.

CodeWarrior HiWave Debugger is using them to debug in Flash.

Cheers,
Alban.
0 项奖励
回复