[arm-gnu] cs3 adding support for a new family of nxp - lpc, bug report

Martin Velek martin.velek at gmail.com
Thu Sep 13 09:33:18 UTC 2012


Hello,

I have downloaded a 30 trial version of codesourcery (mentor)
toolchain -  Sourcery CodeBench 2012.03-28 to try it. Because the nxp
lpc1788 (cortex m3) is not supported (or board with some lpc1788), I
have generated a new Board definition based on Keil MCB1760. The nxp
lpc1788 has slightly different interrupt vector model than the
predefined in CodeBench (lpc1769). From that reason, I have copied
lpc17xx-isrs.S, lpc17xx-vector.S and lpc17xx-names.inc to my project
folder and added lines like .long__cs3_isr_uart4, etc. to
lpc17xx-vector.S. The same with lpc17xx-isrs.S and lpc17xx-names.inc,
I have only copied the lines and added a new suffix with a proper name
like uart4, lcd, etc.

Now, when I compile it, I get error
lpc17xx-vector.o:(.cs3.interrupt_vector+0xe0): undefined reference to
`__cs3_isr_uart4'. To get rid of this message, I have defined the
__cs3_isr_uart4  in lpc17xx-isrs.S

	.weak	__cs3_isr_uart4
	.globl	__cs3_isr_uart4
	.set	__cs3_isr_uart4, __cs3_isr_interrupt
	.type	__cs3_isr_uart4, %function
__cs3_isr_uart4:
	b .

but this wastes a rom memory. Other interrupts, if not used, are
mapped to a default handler __cs3_isr_interrupt. I do not know, how to
make the linker to replace this symbol __cs3_isr_uart4 with an address
of  __cs3_isr_interrupt if the interrupt is not used.

With wasting of memory is related my second post. I am trying to
create a second stage bootloader which should fit into first sector
(4096 B). For that reason, I would like to reduce the size as much as
possible, e.g. by removing functions like frame_dummy,
__do_global_dtors_aux, __cs3_start_c, etc. It is only possible when I
remove libraries (cs3, cs3unhosted) in a linker script (GROUP) and set
flags -nostartfiles, -nodefaultlibraries, -nostdlib. When I do this, I
get an error about reporting a bug, so I am doing it:

/home/velek/CodeSourcery/Sourcery_CodeBench_for_ARM_EABI/bin/../lib/gcc/arm-none-eabi/4.6.3/../../../../arm-none-eabi/bin/ld:
BFD (Sourcery CodeBench 2012.03-28) 2.21.53.20110905 internal error,
aborting at /scratch/janisjo/2012.03-arm-eabi-release/obj/binutils-src-2012.03-28-arm-none-eabi-i686-pc-linux-gnu/bfd/elflink.c
line 9102 in elf_link_output_extsym

/home/velek/CodeSourcery/Sourcery_CodeBench_for_ARM_EABI/bin/../lib/gcc/arm-none-eabi/4.6.3/../../../../arm-none-eabi/bin/ld:
Please report this bug.

The project is in the enclosure.

Thank you for any help

Regards
Martin Velek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lpc1788.zip
Type: application/zip
Size: 20858 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/arm-gnu/attachments/20120913/3759f5da/attachment.zip>


More information about the arm-gnu mailing list