Skip to contentSkip to conversation

LED-D2,D3 on LN2410SBC

U-Boot-Users Shakthi Kannan 2 participants 2 messages Jan 10, 2006

lore
Share & tools
lore
#0 lore raw

Greetings!

I am trying to get the leds, D2 and D3 to glow on the LN2410SBC board from littlechips.com. I am using u-boot-1.1.1 My code:

/*
* led.c
*/

#include <common.h>
#include <exports.h>

int main (int argc, char *argv[])
{
int *r_gpbcon = 0x56000010;
int *r_gpbdat = 0x56000014;

app_startup(argv);

printf ("r_gpbcon = %x\n", *(r_gpbcon)); *(r_gpbcon) = ((*(r_gpbcon))&~(0xf<<10))|(0x5<<10); printf ("r_gpbcon = %x\n", *(r_gpbcon)); printf ("r_gpbdat = %x\n", *(r_gpbdat));

*(r_gpbdat) |= (3<<5);
printf ("r_gpbdat = %x\n", *(r_gpbdat));

return 0;
}

The Makefile I use to build it:

# Makefile

# Tools

CROSS = /usr/local/arm/2.95.3/bin/arm-linux-

CC   = $(CROSS)gcc
AS   = $(CROSS)as
LD   = $(CROSS)ld

OBJCOPY = $(CROSS)objcopy
TARGET = led
BASE = 0x30100000
CFLAGS = -g -Os -fno-strict-aliasing -fno-common
-ffixed-r8 -msoft-float -D__KERNEL__ -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/arm/2.95.3/bin/../lib/gcc-lib/arm-linux/2.95.3/include
-pipe -DCONFIG_ARM -D__ARM__ -march=armv4 -Wall
-Wstrict-prototypes

INCLUDE = -I/home/shaks/code/ln2410sbc/uboot-1.1.1/include -I/usr/local/arm/2.95.3/lib/gcc-lib/arm-linux/2.95.3/include

LIBSTUBS = /home/shaks/code/ln2410sbc/uboot-1.1.1/examples/libstubs.a

LGCC =
-L/usr/local/arm/2.95.3/bin/../lib/gcc-lib/arm-linux/2.95.3 -lgcc -L/home/shaks/code/ln2410sbc/uboot-1.1.1/examples -lstubs

LIBSTUB_INCLUDE =
/usr/local/arm/2.95.3/bin/../lib/gcc-lib/arm-linux/2.95.3/include

LDFLAGS = -g -Ttext $(BASE) -e main

all:
$(CC) $(CFLAGS) $(INCLUDE) -c $(TARGET).c -o
$(TARGET).o
$(LD) $(LDFLAGS) $(TARGET).o -o $(TARGET) $(LIBSTUBS)
$(LGCC)
$(OBJCOPY) -O binary $(TARGET) $(TARGET).bin
2>/dev/null

clean:
rm -f *~ *.o *.bin $(TARGET) semantic.cache*

I copy the led.bin file to /tftpboot in my host system, and I copy it to the board using "tftp 0x30100000 led.bin". It runs, but, leds d2 and d3 won't glow.

Can anyone tell me what I am doing wrong and how I can get this up and running?

Thanking you,

SK

--
Shakthi Kannan, MS
Software Engineer, Hexaware Technologies
[E]: shakthimaan at yahoo.com [M]: (91) 98407-87007
[W]: http://www.shakthimaan.com [L]: Chennai, India

__________________________________________
Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less.
dsl.yahoo.com

#1 lore raw
Quoted 3 lines · In message <[email protected]> you wrote:

I am trying to get the leds, D2 and D3 to glow on the LN2410SBC board from littlechips.com. I am using

This board is not supported by the public source tree. You should ask the guys who ported it to this board.

Quoted 1 line

u-boot-1.1.1 My code:

Why don't you use current code?

Quoted 2 lines

Can anyone tell me what I am doing wrong and how I can get this up and running?

I suggest you start with a working example (examples/hello_world.c) and add your code step by step there. make sure your hardware really uses the memory mapping you assume.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The faster I go, the behinder I get.                 -- Lewis Carroll