Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 5 months ago.
Offline compilation with gcc4mbed & eclipse
Hey Guys I was wondering if you have any ideas that might help with this issue.
I have made some changes to the standard library and I have things working with the online complier. Now I want to switch to the offline alternative described here https://mbed.org/cookbook/eclipse-for-building-and-debugging. I have exported the project from the online compiler as (GCC Sourcery). When I try to build I get this errors:
../../external/mbed/LPC1768/GCC_ARM/cmsis_nvic.o: In function `NVIC_SetVector': cmsis_nvic.c:(.text.NVIC_SetVector+0x0): multiple definition of `NVIC_SetVector' LPC176x/./mbed-NXP/cmsis/LPC1768/cmsis_nvic.o:/home/canut/mbed-dev/adamgreen-gcc4mbed-8234d7c/samples/FileTest/mbed-NXP/cmsis/LPC1768/cmsis_nvic.c:15: first defined here ../../external/mbed/LPC1768/GCC_ARM/cmsis_nvic.o: In function `NVIC_GetVector': cmsis_nvic.c:(.text.NVIC_GetVector+0x0): multiple definition of `NVIC_GetVector' LPC176x/./mbed-NXP/cmsis/LPC1768/cmsis_nvic.o:/home/canut/mbed-dev/adamgreen-gcc4mbed-8234d7c/samples/FileTest/mbed-NXP/cmsis/LPC1768/cmsis_nvic.c:27: first defined here ../../external/mbed/LPC1768/GCC_ARM/system_LPC17xx.o: In function `SystemCoreClockUpdate': system_LPC17xx.c:(.text.SystemCoreClockUpdate+0x0): multiple definition of `SystemCoreClockUpdate' LPC176x/./mbed-NXP/cmsis/LPC1768/system_LPC17xx.o:/home/canut/mbed-dev/adamgreen-gcc4mbed-8234d7c/samples/FileTest/mbed-NXP/cmsis/LPC1768/system_LPC17xx.c:467: first defined here ../../external/mbed/LPC1768/GCC_ARM/system_LPC17xx.o: In function `SystemInit': system_LPC17xx.c:(.text.SystemInit+0x0): multiple definition of `SystemInit' LPC176x/./mbed-NXP/cmsis/LPC1768/system_LPC17xx.o:/home/canut/mbed-dev/adamgreen-gcc4mbed-8234d7c/samples/FileTest/mbed-NXP/cmsis/LPC1768/system_LPC17xx.c:523: first defined here ../../external/mbed/LPC1768/GCC_ARM/system_LPC17xx.o:(.data.SystemCoreClock+0x0): multiple definition of `SystemCoreClock' LPC176x/./mbed-NXP/cmsis/LPC1768/system_LPC17xx.o:(.data.SystemCoreClock+0x0): first defined here /home/canut/mbed-dev/adamgreen-gcc4mbed-8234d7c/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: region RAM overflowed with stack collect2: error: ld returned 1 exit status make: *** [FileTest.elf] Error 1
I don't know if I am taking the right approach I'll be very grateful if you could give me some pointers to solve this.
10 years, 5 months ago.
I have made some changes to the standard library
I take it that the standard library you have modified is the mbed library? If not, you could just delete the mbed-NXP subdirectory from your FileTest subdirectory. The error that you are getting occurs because gcc4mbed has its own copy of the mbed libraries (an older version) that it uses and they are conflicting with the sources in your FileTest/mbed-NXP directory. There is currently no convenient way to use custom mbed library code with gcc4mbed. I think you should just export your code and follow the steps in the handbook to build it without using the gcc4mbed project.