[arm-gnu] GCC and NXP 1769 bare metal

g4 at novadsp.com g4 at novadsp.com
Thu May 24 21:31:20 UTC 2012


Greetings.

Thanks for the tooling. Invaluable.

I'm trying to assemble the right spell for compiling and linking bare 
metal apps (FreeRTOS/lwip/FatFS) on the NXP 1769 using the arm-none-eabi 
compiler/linker.

Currently the main problem is 'C' runtimes. By way of example the 
compilation command line arguments are (eliding is mine):

arm-none-eabi-gcc.exe ./.../mmc.o -c -fmessage-length=0 -fno-builtin 
-ffunction-sections -fdata-sections -mcpu=cortex-m3 -mthumb -MMD -MP 
-Ir:/data/...

arm-none-eabi-ld -nostdlib -Map="rbmap" -Trb_debugld  
-or:/data.../rb.axf -L R:/apps/Mentor/lib/gcc/arm-none-eabi/4.6.1/thumb

The problem here is that I end up with a handsome (edited) listing of 
undefined references as shown below:

./obj/system_lpc17xx.o: In function `SystemCoreClockUpdate':
system_lpc17xx.c:(.text.SystemCoreClockUpdate+0xb4): undefined reference 
to `__aeabi_uldivmod'
system_lpc17xx.c:(.text.SystemCoreClockUpdate+0xd8): undefined reference 
to `__aeabi_uldivmod'
system_lpc17xx.c:(.text.SystemCoreClockUpdate+0x154): undefined 
reference to `__aeabi_uldivmod'
system_lpc17xx.c:(.text.SystemCoreClockUpdate+0x178): undefined 
reference to `__aeabi_uldivmod'
system_lpc17xx.c:(.text.SystemCoreClockUpdate+0x1ee): undefined 
reference to `__aeabi_uldivmod'
./obj/system_lpc17xx.o:system_lpc17xx.c:(.text.SystemCoreClockUpdate+0x212): 
more undefined references to `__aeabi_uldivmod' follow
./obj/main.o: In function `prvTaskStatsCommand':
main.c:(.text.prvTaskStatsCommand+0x1a): undefined reference to `strcpy'
main.c:(.text.prvTaskStatsCommand+0x20): undefined reference to `strlen'
./obj/main.o: In function `prvRunTimeStatsCommand':
main.c:(.text.prvRunTimeStatsCommand+0x1a): undefined reference to `strcpy'
main.c:(.text.prvRunTimeStatsCommand+0x20): undefined reference to `strlen'
./obj/main.o: In function `prvManuallyPlaceLargeDataInAHBRAM':
main.c:(.text.prvManuallyPlaceLargeDataInAHBRAM+0x7c): undefined 
reference to `memset'
./obj/spi-interface-to-sd-card.o: In function `prvWriteFilesToDisk':
spi-interface-to-sd-card.c:(.text.prvWriteFilesToDisk+0x8c): undefined 
reference to `memset'
./obj/spi-interface-to-sd-card.o: In function `prvReadBackCreatedFiles':
spi-interface-to-sd-card.c:(.text.prvReadBackCreatedFiles+0x94): 
undefined reference to `memset'
.//obj/queue.o: In function `prvCopyDataToQueue':
api_msg.c:(.text.err_tcp+0x3a): undefined reference to `fflush'
api_msg.c:(.text.err_tcp+0x3e): undefined reference to `abort'
queue.c:(.text.prvCopyDataToQueue+0x44): undefined reference to `memcpy'
queue.c:(.text.prvCopyDataToQueue+0x7a): undefined reference to `memcpy'

My first questions are these:

1. Which runtime libraries should be referenced when linking?
2. Linker scripts are a bit of a mystery - the NXP has 512K contiguous 
flash and 64K RAM in 2 possibly contiguous banks. Are there pro-forma 
scripts I can use?

Any help greatly appreciated.

ATB

Jerry





More information about the arm-gnu mailing list