Hello hello!
So I know coming to this segment of the forum with a fresh topic and a nightmarish topic like “custom board” is bad form, but I could use some help just verifying a few things to make sure I didn’t do this completely wrong.
Things about my setup:
-
I’m working on a linux box, on a custom LPC2388 board of my own design, I can give plenty of details if needed, just ask and ye shall get snippets of the schematic! [Here is a quick picture of what currently assembled if you want to get an idea of what I’m working on.
-
I compiled arm-elf-gcc and the related tools (ld, ar, as, newlib) using the instructions and script [here, though I modified them to use binutils-2.20.1, gcc-4.4.0, and newlib-1.18.0 instead of the versions listed.
-
I compiled Openocd-0.4.0 using the following: “/configure --enable-ft2232_libftdi” I had libftdi installed and this compiled and installed fine. I had originally tried “./configure --build=i686-pc-linux-gnu --host=arm-elf --enable-ft2232_libftdi” but this had an error with the fact that there was no usleep defined for the arm platform. I guess since I’m depending on the embeddedICE I don’t need to compile the host side?
-
I’m using the Olimex arm-usb-ocd, and the default configuration for this included with the openocd distribution for it
-
For the openocd configuration for the lpc2388 I have a slightly modified version of the lpc2378 file included with the openocd distribution. The modified lines essentially expand the “working space” to use all 64kB of ram (as opposed to the lpc2378’s 32kB of ram) and changed the chip name to “lpc2388”. Everything else looked right, and I couldn’t find something to replace the “_CPUTAPID 0x4f1f0f0f” but openocd appears to detect it anyway.
-
I compiled the following program which I believe should be correct:
#include <stdio.h>
#include "lpc23xx.h"
// This makes sure that the code protect bits are set to a *known* safe value
// This turns off code protect and allows the JTAG to continue functioning
// DO NOT REMOVE THIS CODE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
const unsigned crp __attribute__((section(".ARM.__at_0x1FC"))) = 0x00000000;
// DO NOT REMOVE THIS CODE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
int main(int argc, char *argv[]) {
IODIR0= 0x00000000;
IODIR1= (0x01 << 20);
IOSET1= 0xFFFFFFFF;
while(1) {
}
return 0;
}
The Problem:
So I start up openocd and get the following:
Open On-Chip Debugger 0.4.0 (2010-05-28-21:00)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
500 kHz
Info : clock speed 500 kHz
Info : JTAG tap: lpc2388.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787, part: 0xf1f0, ver: 0x4)
Info : Embedded ICE version 7
Error: EmbeddedICE v7 handling might be broken
Info : lpc2388.cpu: hardware has 2 breakpoint/watchpoint units
Which looks correct to me, except the “Error: EmbeddedICE v7 handling might be broken” Should I be concerned about that?
I then connect using telnet, run “soft_reset_halt” and upload my code using “flash write_image main.elf” and try to run the code by telling it to continue from address 0. It seems to get into the bootloader or something, gets stuck in THUMB mode, and never exits. I’ve also gone ahead and tried to unplug my jtag programmer and disable the debugging to see if the code runs properly after that, but the LED never lights up like I keep hoping it will.
This is my first ARM project, so I’m not too sure how to proceed from here, I think I’ve figured out a lot of it on my own, but I’m not sure if I’ve done any of it properly. Any help would be greatly appreciated! Thank you for taking the time to read all of this!
----EDIT----
Of course just after I made this post I read the errata: Apparently if you leave VBAT (for the RTC module) floating the device cannot start up (or at least in Rev B, which is what I’m using). I’ll go ahead and do a greenwire fix and see if I’m still having issues. If I’m not I’ll go ahead and delete this post! Sorry to clog up the forum!
----EDIT 2----
It still isn’t working! Please someone: HEEEELLLLPPP!!](Nutaksas Research: Installing Gnuarm ARM Toolchain on Ubuntu 9.04)](http://www.scuzzstuff.org/scuzzbox/scuzzbox_part1_assembled.jpg)