EmbeddedRelated.com
Forums

Re: LPC2148 - startup from reset

Started by Paul Curtis July 8, 2008
HOW TO DEBUG A PROGRAM THAT DOESN"T START UP IN CROSSWORKS
=========================================================
1. Ensure hardware is in the NOT-RUNNING STATE.
2. Attach JTAG cable and run CrossWorks.
3. Connect to the selected target interface (Target > Connect...)
4. Attach the debugger to the target (Debug > Attach Debugger).
5. Stop the CPU (Debug > Break).
6. Figure out where you are and why you think you're stopped.

It's not difficult. Why make it so?

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

> -----Original Message-----
> From: l... [mailto:l...] On Behalf
Of
> tomi
> Sent: 08 July 2008 14:40
> To: l...
> Subject: [lpc2000] LPC2148 - startup from reset
>
> I have problem with automatically start programs on LPC2148 and LPC2138.
>
> This is simple example from book: http://www.sendspace.com/file/xyhrt7
>
> int main(void)
> {
> int pkey = 0;
> int key;
> LEDDIR |= LEDY;
> KEYDIR &= ~(S1|S2|S3);
>
> while(1)
> {
> if(!(KEYPIN & S1))
> {
> LEDSET = LED0;
> LEDCLR = LED1;
> }
> else if(!(KEYPIN & S2))
> {
> LEDSET = LED1;
> LEDCLR = LED0;
> }
>
> key = KEYPIN & S3;
> if(pkey && !key)
> {
> LEDPIN ^= LED2;
> }
> pkey = key;
> }
>
> }
>
> Program works only after JTAG reset. On hardware reset and power on -
> program won't start.
> I have compiled this program with Crossstudio with defined
> STARTUP_FROM_RESET and WinARM witth different startup.s files - without
> effect.
> With LPC2129 I don't have these problems, every program start
automatically.
>
> What's wrong ? LPC2138/48 require additional settings ?
>
>

An Engineer's Guide to the LPC2100 Series