EmbeddedRelated.com
Forums

Problem Starting Up LPC2138 Board

Started by Geoffrey Wossum November 2, 2007
Hi all,

I'm trying to get started on a custom board using an LPC2138. To jump start
things, I got an eval of the Rowley Cross Studio for ARM, and installed the
LPC2000 CPU support package. I can compile programs using Cross Studio, and
download them using lpc21isp. Problem is, nothing happens.

To start out, I just took a blinky example that goes with a Keil eval board.
It's simple, and the IO lines it uses aren't hooked up on my board. I've
included the source at the end of the message.

Looking at the dissassembly, I figured out I needed to define
STARTUP_FROM_RESET if I ever wanted it to do anything (I don't have a JTAG).

I'd expect to see the IO lines toggling, but I see nothing. I've tried RAM
and flash builds, ARM and THUMB builds, debug and release, all do nothing.
My external 10.0 MHz crystal and 32 kHz crystals are both oscillating, but
no other indication the part is doing anything once programmed.

Anyone have any ideas?

TIA,
---
Geoffrey
--begin--
#include

int main(void)
{
unsigned int delay;
unsigned int flasher = 0x00010000;

IODIR1 = 0x00ff0000;

while (1) {
#if 0
for (delay = 0; delay < 0x10000; delay++) {
}
#endif

IOCLR1 = ~flasher;
IOSET1 = flasher;

flasher = flasher << 1;
if (flasher & 0x01000000) {
flasher = 0x00010000;
}
}
}
--end--

An Engineer's Guide to the LPC2100 Series

----- Original Message -----
From: "Geoffrey Wossum"
To:
Sent: Friday, November 02, 2007 10:47 PM
Subject: Re: [lpc2000] Problem Starting Up LPC2138 Board
> On Friday 02 November 2007 05:25:53 pm Leon wrote:
>
>> > Looking at the dissassembly, I figured out I needed to define
>> > STARTUP_FROM_RESET if I ever wanted it to do anything (I don't have a
>> > JTAG).
>> >
>> > I'd expect to see the IO lines toggling, but I see nothing. I've tried
>> > RAM
>> > and flash builds, ARM and THUMB builds, debug and release, all do
>> > nothing. My external 10.0 MHz crystal and 32 kHz crystals are both
>> > oscillating, but
>> > no other indication the part is doing anything once programmed.
>>
>> How have you defined STARTUP_FROM_RESET?
>
> Went into the project properties for my executable in Cross Studio and
> added "STARTUP_FROM_RESET=1" in the "Preprocessor Definitions" setting
> under
> the "Preprocessor Options" section.
>
> I dissasembled the resulting firmware to verify that this actually gets
> the
> CPU going at reset_handler, rather than having spin at reset_wait.

That should be OK, it works for me. I use a JTAG interface, though.

Leon
Hi,

> I'm trying to get started on a custom board using an LPC2138. To jump
> start
> things, I got an eval of the Rowley Cross Studio for ARM, and installed
> the
> LPC2000 CPU support package. I can compile programs using Cross
> Studio, and
> download them using lpc21isp. Problem is, nothing happens.
>
> To start out, I just took a blinky example that goes with a Keil eval
> board.
> It's simple, and the IO lines it uses aren't hooked up on my board.
> I've
> included the source at the end of the message.
>
> Looking at the dissassembly, I figured out I needed to define
> STARTUP_FROM_RESET if I ever wanted it to do anything (I don't have a
> JTAG).
>
> I'd expect to see the IO lines toggling, but I see nothing. I've tried
> RAM
> and flash builds, ARM and THUMB builds, debug and release, all do
> nothing.
> My external 10.0 MHz crystal and 32 kHz crystals are both oscillating,
> but
> no other indication the part is doing anything once programmed.
>
> Anyone have any ideas?

Debug using JTAG, that's what it's there for.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors
On Saturday 03 November 2007 03:51:04 am Paul Curtis wrote:

> > I'm trying to get started on a custom board using an LPC2138. To jump
> > start
> > things, I got an eval of the Rowley Cross Studio for ARM, and installed
> > the
> > LPC2000 CPU support package. I can compile programs using Cross
> > Studio, and

> Debug using JTAG, that's what it's there for.

I got a Segger J-Link, hooked it up. Code seemed to be working fine. Then I
realized the example code I had used the macrotrace pins on port 1, which
aren't available when using the JTAG. Even before I had the JTAG, the JTAG
port was enabled.

Works great now. Thanks for the ideas!

---
Geoffrey