Launching demo Debug

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

Launching demo Debug

389 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by unix1970 on Sat Feb 22 13:15:54 MST 2014
Dear Forum,

I have the following problem and I'd be very pleased if you could help me:
I have a LPC11C24 and programm it with a LPC-Link. I changed the usual crystal to an 25MHz, but I want to drive the whole thing still on 12MHz.

If I try to debug it, it seems to flash but then sticks to 97% with "launching: ConfiguringGDB" and doesn't goes on.


I attached my changes in system_lpc11xx.c with the most important parts mentioned below.
It would help me so much if you could have a look at it. At the moment I don't see any light at the end of the tunnel.

Best wishes
Max

This is the console output:
LPCXpresso Debug Driver v6.0 (Dec 30 2013 11:03:03 - crt_emu_lpc11_13_nxp build 1222)
Looked for chip XML file in C:/nxp/LPCXpresso_6.1.4_194/lpcxpresso/bin/LPC11C24/301.xml
Looked for vendor directory XML file in C:/nxp/LPCXpresso_6.1.4_194/lpcxpresso/bin/nxp_directory.xml
Found generic directory XML file in C:/nxp/LPCXpresso_6.1.4_194/lpcxpresso/bin/crt_directory.xml
(  5) Remote configuration complete
Emu(0): Conn&Reset. DpID:  BB11477. Info: HID64HS12
SWD Frequency: 3000 KHz. RTCK: False. Vector catch: False.
Packet delay: 0  Poll delay: 0.
Loaded LPC11_12_13_32K_8K.cfx: LPC11_12_13 (32K Flash, min 8K RAM) Apr 22 2013 12:14:02  On-chip Flash Memory
NXP: LPC11C24/301  Part ID: 0x00000000
Connected: was_reset=false. was_stopped=false
v LPCXpresso Free License - Download limit is 256K
Writing 9268 bytes to 0000 in Flash (assumed clock: 12.0MHz)
Erased/Wrote page  0-2 with 9268 bytes in 1471msec
Flash write Done


I changed the code in system_LPC11C24.c to the following:

#define CLOCK_SETUP           1
#define SYSCLK_SETUP          1
#define SYSOSC_SETUP          1
#define SYSOSCCTRL_Val        1//0x00000000
#define WDTOSC_SETUP          0
#define WDTOSCCTRL_Val        0x000000A0
#define SYSPLLCLKSEL_Val      0x00000001
#define SYSPLL_SETUP          1
#define SYSPLLCTRL_Val        0x00000023
#define MAINCLKSEL_Val        1//0x00000003
#define SYSAHBCLKDIV_Val      0x00000001
#define AHBCLKCTRL_Val        0x0001005F
#define SSP0CLKDIV_Val        0x00000001
#define UARTCLKDIV_Val        0x00000001
#define SSP1CLKDIV_Val        0x00000001


   
/*----------------------------------------------------------------------------
  Define clocks
*----------------------------------------------------------------------------*/
#define __XTAL            (25000000UL)    /* Oscillator frequency             */
#define __SYS_OSC_CLK     (    __XTAL)    /* Main oscillator frequency        */
#define __IRC_OSC_CLK     (12000000UL)    /* Internal RC oscillator frequency */



Original Attachment has been moved to: system_LPC11xx_0.c.zip

0 Kudos
7 Replies

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Sun Feb 23 14:36:47 MST 2014
Are you sure that your crystal is working?

Are you sure that your board is working? Did you ever flash and run a program successful?
0 Kudos

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by unix1970 on Sun Feb 23 14:07:59 MST 2014
Nothing seems to happen :((  :((  :(( It still goes up to 97% and stops then
#define CLOCK_SETUP 1
#define SYSCLK_SETUP 1
#define SYSOSC_SETUP 1
#define SYSOSCCTRL_Val 0x00000002
#define WDTOSC_SETUP 0
#define WDTOSCCTRL_Val 0x000000A0
#define SYSPLLCLKSEL_Val 0x0000001
#define SYSPLL_SETUP 1
#define SYSPLLCTRL_Val 0x00000021
#define MAINCLKSEL_Val 0x00000003
#define SYSAHBCLKDIV_Val 0x00000001

What the hell do I do wrong? Flashing works fine but I want to debug!
Please help :((
0 Kudos

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Sun Feb 23 13:32:53 MST 2014

Quote: unix1970
Of course the main clock should run on 50MHz...



Then you should switch SYSOSCCTRL FREQRANGE to 25MHz:

#define SYSOSCCTRL_Val        0x00000002


and use [color=#f00]M = 2[/color] to get 50MHz main clock:

#define SYSPLLCTRL_Val        0x0000002[color=#f00]1[/color]


That's all...
0 Kudos

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by unix1970 on Sun Feb 23 13:23:38 MST 2014
Unfortunately I might didn't write it the right way. Of course the main clock should run on 50MHz or 48MHz.
Of course the internal clock is the easiest way but I'm not sure if it is precise enough to use CAN properly.
If that was possible it would be also much better for me, as I can reduce the size of my board. So IRC is actually my first choice.
I tried it with the internal clock but debugging is still not possible
0 Kudos

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Sun Feb 23 13:01:18 MST 2014

Quote: unix1970
...it should run on 12,5MHz...



That's not possible. With your crystal you can run it with M*25MHz.That's 25MHz or 50MHz...

With IRC you can run it with 12 MHz...


Quote: unix1970
Do you have some other ideas?


Could be a good idea to decide which clock source and main clock you are trying to get...

The simplest solution is of course to select IRC...
0 Kudos

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by unix1970 on Sun Feb 23 12:46:39 MST 2014
Thanks for your input! It already helped me finding some big mistakes but unfortunately the problem seems to stay the same.
As nothing seems to work at the moment, I wanted to run the controller with its internal clock, in the end it should run on 12,5MHz
For trying it with the internal clock, I chose the following preferences:
#define CLOCK_SETUP 1
#define SYSCLK_SETUP 1
#define SYSOSC_SETUP 1
#define SYSOSCCTRL_Val 0x00000000
#define WDTOSC_SETUP 0
#define WDTOSCCTRL_Val 0x000000A0
#define SYSPLLCLKSEL_Val 0x0000000
#define SYSPLL_SETUP 1
#define SYSPLLCTRL_Val 0x00000023
#define MAINCLKSEL_Val 0x00000003
#define SYSAHBCLKDIV_Val 0x00000001
#define AHBCLKCTRL_Val 0x0001005F
#define SSP0CLKDIV_Val 0x00000001
#define UARTCLKDIV_Val 0x00000001
#define SSP1CLKDIV_Val 0x00000001

I also uncomented the line you mentioned but it doesn't work. :((
Do you have some other ideas?
0 Kudos

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Sat Feb 22 17:29:53 MST 2014

Quote: unix1970
I changed the usual crystal to an 25MHz, but I want to drive the whole thing still on 12MHz.



I'm a little bit confused. So you want to use 12MHz IRC instead of your 25MHz crystal?

BTW:
#define SYSOSCCTRL_Val 1//0x00000000

is setting BYPASS  = now PLL is expecting a clock signal (no crystal!!) at XTAL1. Do you supply that?

Probably your wrong PLL setup is running until PLL is trying to work (in SystemInit())...
while (!(LPC_SYSCON->SYSPLLSTAT & 0x01));      /* Wait Until PLL Locked    */
0 Kudos