Debugger hangs when setting CCLKCFG register

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

Debugger hangs when setting CCLKCFG register

512 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mikael.tangert on Thu Jul 29 00:34:33 MST 2010
When setting the clockdivider in the system_LPC17xx.c in the systemInit routine
"LPC_SC->CCLKCFG   = CCLKCFG_Val;      /* Setup Clock Divider  "
the debugger hangs with error like
15: Target error from register access
Cannot complete transaction even after slowing speed.

The clksrc is still IRC and the CCLKCFG_Val is 3 so  I think the new CPU clock will temporarily be 1 Mhz.
The program works fine when freerunning without jtag debugg & LPC-link.
What to do?

/Regards
==========================================================
Win XP SP2
LPCXpresso Build id: LPCXpresso v3.4.0 [Build 187] [23/06/2010]
com.crt.lpcxpresso
LPC-link from LPC Xpresso 1343 board
JTAG interface from LPC-link to  LPC1752 without JTAG-rtckl
0 项奖励
回复
3 回复数

476 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mikael.tangert on Thu Jul 29 07:40:35 MST 2010
Hello again.
Just to be more exakt...

I checked what differ.

- The debugger doesn't hang when going from cpu clk division by 1 to 3. (I had changed the code when setting higher CPU freq)

- The debugger still hangs when going from cpu clk division by 1 to 4. (the original situation when I reported this morning)
0 项奖励
回复

476 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mikael.tangert on Thu Jul 29 07:22:25 MST 2010
Thanks it works now so I'm satisfied for the moment. But in fact I was suspicious to the under the feet issue and tried to set a breakpoint some instructions ahead before but I left it since It doesn't helped then and since I'm really not sure of what going on in every part.  However now I'n able to reset the program and single step through the clock initialisation and also look onto the Sysctl/peripheral variable in the monitors window changing from 0 to 3 (i.e. div by 1 resp 4).
0 项奖励
回复

476 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Jul 29 01:24:58 MST 2010
When you change the clock speed and/or oscillator source, you are  also changing the speed of the debug connection. As you are stepping the  code when this happens, the debugger is no longer able to connect, as  you have changed the connection 'under it's feet'.

The way around this is to set a breakpoint after you change the speed  and RUN to the breakpoint. The debugger will then resync the debug  connection, when the breakpoint is hit. This is not possible when single  stepping.
0 项奖励
回复