SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By Blue_Science_Geek
Let me just say that I am new to ARM, but not new to this field. I have been working with PIC's the last few years and want to get into ARM for personal projects.

Windows 8.1
Eclipse Luna
Most recent WinARM
LPC11U68 Demo board from NXP

So I downloaded eclipse, installed CDT, and connected it with the GCC Arm compiler. I have eclipse compiling code and I think its working. It produces a list file that makes sense to me as its primarily just loads and stores needed anyways. My code is very simple, I just turn off PIO2_18 as can be seen in the code below. I have an LED connected to power and then back to the pin. A low signal would then illuminate the LED.
Code: Select all

#define GPIO_ADDR_PIO2_18		   0x4004413C
#define DIR2 (((volatile unsigned int *) (0xA0002008)))
#define PORT2 (((volatile unsigned int *)(0xA0002108)))

int main (void) {
	//setup pin functions
	*GPIO2_18 = 0x0000;
	//setup pin direction
	*DIR2 = (1 << 18);
        *PORT2 = (1 << 18);
	//disable clock to conserve power
	while (1)    /* Loop forever */
		*PORT2 = (0 << 18);
I setup a linker file to put the .text section at 0x0000001C. This is the start of code after the reset vector table.

The only output from eclipse that I can get are a .elf and a .hex file. I need a .bin as the LPC11U68 appears as a thumb drive to load code. In order to do this I am using arm-elf-objdump. I dont remember the exact command off the top of my head though. This produces a .bin file that I than copy and paste into the LPC board. When I reset/apply power it jumps right back into the bootloader as if my code was never even installed.

Anybody have any experience with this? Are there any specific toolchain settings I need to know of?
One thought that I had was the format of the ELF file. Is there any ELF parser out there that can read the elf file and give me a view of what it has?
Another thought is that there is actually more initialization needed. Is this so?

I just need a push in the right direction...
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]