lpcxpresso board without Code-Red under Linux

Hi all,

I recently aquired a lpcxpresso board (1769), which has still to arrive.

What bother me is that LPC-Link part of that board is closed and only works

with the Code-Red LPCXpresso suite, at least debugging. Even if I activate

that suite, there is still that 128k Flash limit - thats just 1/4 of the flash availabe.

I successfully compiled code for the stm32 with codesourcery lite /arm eabi,

and downloaded + debugged it with whitequark-stlink on a stm32-discovery.

Is anyone aware of a similiar way of doing this for the lpcxpresso ?

Compiling should not be the problem, given I sort out the linker script and

the libs. But using linux, I’m unable to download the code to the board.

Something like Flashmagic.exe (which is Windows only) would be nice,

an gdb server would be even better.

Or is there some way (say - software) to access the lpc1769 on the board

directly via serial bootloader (with limited hardware efforts) ?

A while back I took a very brief look at [lpc2k under Ubuntu. I don’t remember the exact problem but I know it didn’t seem insurmountable. Since openOCD was already working for me I didn’t spend any time on lpc2k. I’ll take another peek and report back.](http://www.pjrc.com/arm/lpc2k_pgm/)

It turned out it was also a problem of search keywords…

After posting, I continued searching, but not limited to the lpc176x controller.

That way I stumbled across lpc2k. I did compile it successfully (Suse 11.2),

but not yet test - I’m still waiting for the boards to arrive. The hardware interface

is ready, it’s basically just level-shifters for RxD, TxD and DTR, were the latter is

used to pull down the BOOT pin of the uC during reset to start it into ISP mode.

There is a ‘lpctool’ software I found at http://www.bettyhacks.com, which basically

does the same, and a little more, it seems.

I don’t have/use a JTAG adaptor yet - I would need a 3.3V/1.8V compatible one,

because there is this Beagleboard lying around. So this serial interface seems ideal.

One questions remains. Is there any gdb server that supports that kind of serial

ISP interface ? Going to seach myself in the meantime…

You’re well ahead of me at this point. After a segfault with the old binary I tried to re-build from old source, which would take some time to configure properly. Perhaps I’ll download the version with gtk2 support and try again later.

I’ve read about people configuring Eclipse to flash via serial. I assume it calls a shell script… I’m not aware of any gdb server with serial flash support but that doesn’t mean it doesn’t exist.

lpc2k did not so well for me at first. The binary crashed immediately, and the build (V1.05)

failed because of missing gtk-devel packets. After installing the latter, the build succeeded, and the

executable started to the window shown in the doc. If it really works I see when the boards finally arrive.

I think lpc21isp should work too, despite of it’s name. I remember there was a note

Concerning Eclipse you are probably right. An easy way would be to call the flasher in a post-build step.

However, I’m not a great fan of Eclipse. Beside of not being intuitive, it’s rather bloated.

CodeBlocks and Geany do well for me, and they are easier to configure. CodeBlocks even integrates the

debugger. I got it working for the STM32, using the mentioned whitequark-stlink as gdb-server.

A lot of this ‘free’ development tools for uC’s, including ARM/Cortex M3 come packaged with eclipse and

some vendor-build gcc version. Code-Red and Atollic TrueStudio are examples. They offer a free version

to get their product to the market, but cripple it enough to sell their full versions eventually.

From a hobby perspective, 1K++ $ or € for a full version is far above the pain threshold.

Maybe I find a serial gdb-server - I’m going to post any positive results.

Concerning an ISP based GDB server - I think there is no one.

First, I searched for something like this, without an result.

Second, I had a closer look at the ISP protocol (see doc.# UM10360)

There are none of the commands one would expect for debugging, such as

setting/removing breakpoint and reading register contents.

Unless NXP did not document it.

But I think the ISP is just an easy and save method for OEM customers to

provide an interface for field SW updates. These are often handled by personnel

with limited tools and knowledge of device internals. With JTAG, one would

eventually have to mess around with code protection issues…

Since Code-Red is also Eclipse based, it comes with separate GDB server, which

is called crt_emu_cm3_nxp. Calling it with ‘-help’ from the command line reveals

that is also usable for standalone flashing of the controller.

I need to check if it works with gdb (thus can be used by any gdb-aware IDE,

such as CodeBlocks), and if the the same flashing/debugging restrictions apply.

I used lpc2k for a long time to download to my boards under ubuntu, as you all found out you need to compile from source. Once of the boards it failed to recognise. It’s a couple of years since I did this, and I’m @ work, but in one of the files in as array of chip type vs ID’s. It’s possible you may have to add your chip type and ID. once you do that, it will work fine !