EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Makefile :Generate assembly file for LPC2103,GNUARM

Started by prab...@yahoo.co.in August 19, 2009
I am using LPC2103 and written isr code in C.I want to view that assmbley of isr code which is written in C.

I am using GNUARM and make file is as follows

ARM_OBJ = $(ARM_SRC:.c=.o)
THUMB_OBJ = $(THUMB_SRC:.c=.o)

$(TARGET).hex : $(TARGET).elf
$(OBJCOPY) $(TARGET).elf -O ihex $(TARGET).hex

$(TARGET).elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
$(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)

$(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
$(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@

$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
$(CC) -c $(CFLAGS) $< -o $@

all : $(TARGET).hex
whare i have to given -S option..

$(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
$(CC) -S -c $(CFLAGS) $< -o $@

gives error as

iles/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:Application/isr.o: file format not recognized; treating as linker script
/c/program files/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:Application/isr.o:1: syntax error
collect2: ld returned 1 exit status
i know gcc -S main.c gives main.s but in combined make file gives errir????
Anyone faced this issue please share ur knowledge??

Thanks,
Prabu

An Engineer's Guide to the LPC2100 Series

If you put your -S option there, you will get a .o file filled with
assembler output.
If you want to look at your assembler output I recomend you doing an

arm-elf-objdump --disassemble main.elf

(change arm-elf for your toolchain type).

2009/8/19

> I am using LPC2103 and written isr code in C.I want to view that assmbley
> of isr code which is written in C.
>
> I am using GNUARM and make file is as follows
>
> ARM_OBJ = $(ARM_SRC:.c=.o)
> THUMB_OBJ = $(THUMB_SRC:.c=.o)
>
> $(TARGET).hex : $(TARGET).elf
> $(OBJCOPY) $(TARGET).elf -O ihex $(TARGET).hex
>
> $(TARGET).elf : $(ARM_OBJ) $(THUMB_OBJ) $(CRT0) Makefile
> $(CC) $(CFLAGS) $(ARM_OBJ) $(THUMB_OBJ) -nostartfiles $(CRT0)
> $(LINKER_FLAGS)
>
> $(THUMB_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
> $(CC) -c $(THUMB_FLAGS) $(CFLAGS) $< -o $@
>
> $(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
> $(CC) -c $(CFLAGS) $< -o $@
>
> all : $(TARGET).hex
>
> whare i have to given -S option..
>
> $(ARM_OBJ) : %.o : %.c $(LDSCRIPT) Makefile
> $(CC) -S -c $(CFLAGS) $< -o $@
>
> gives error as
>
> iles/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:Application/isr.o:
> file format not recognized; treating as linker script
> /c/program
> files/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:Application/isr.o:1:
> syntax error
> collect2: ld returned 1 exit status
>
> i know gcc -S main.c gives main.s but in combined make file gives errir????
> Anyone faced this issue please share ur knowledge??
>
> Thanks,
> Prabu
>
>
>

--
Miguel Angel Ajo Pelayo
http://www.nbee.es
+34 91 120 1798
+34 636 52 25 69
skype: ajoajoajo



Memfault Beyond the Launch