Hello,
I'm trying write Wrapper Class for FreeRTOS with ARM GCC on eclipse platform.
I had worked same Wrapper Class on Keil MDK-ARM v5.14.
I'm using stm32f303vc which is cortex-m4 and it has got Hardware FPU.
So I have included SourceportableGCCARM_CM4F port files to my project.
I dont invoke any freertos functions in my main.cpp just compiled empty project.
Here is my compilier output:
~~~~~~
18:05:27 **** Incremental Build of configuration Release for project RtosWrapper ****
make all
Building file: ../system/src/stm32f3-stdperiph/stm32f30xgpio.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/stm32f3-stdperiph/stm32f30xgpio.d" -MT"system/src/stm32f3-stdperiph/stm32f30xgpio.o" -c -o "system/src/stm32f3-stdperiph/stm32f30xgpio.o" "../system/src/stm32f3-stdperiph/stm32f30xgpio.c"
Finished building: ../system/src/stm32f3-stdperiph/stm32f30x_gpio.c
Building file: ../system/src/stm32f3-stdperiph/stm32f30xrcc.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/stm32f3-stdperiph/stm32f30xrcc.d" -MT"system/src/stm32f3-stdperiph/stm32f30xrcc.o" -c -o "system/src/stm32f3-stdperiph/stm32f30xrcc.o" "../system/src/stm32f3-stdperiph/stm32f30xrcc.c"
Finished building: ../system/src/stm32f3-stdperiph/stm32f30x_rcc.c
Building file: ../system/src/newlib/cxx.cpp
Invoking: Cross ARM C++ Compiler
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu++11 -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -MMD -MP -MF"system/src/newlib/cxx.d" -MT"system/src/newlib/cxx.o" -c -o "system/src/newlib/cxx.o" "../system/src/newlib/cxx.cpp"
Finished building: ../system/src/newlib/_cxx.cpp
Building file: ../system/src/newlib/exit.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/newlib/exit.d" -MT"system/src/newlib/exit.o" -c -o "system/src/newlib/exit.o" "../system/src/newlib/exit.c"
Finished building: ../system/src/newlib/_exit.c
Building file: ../system/src/newlib/sbrk.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/newlib/sbrk.d" -MT"system/src/newlib/sbrk.o" -c -o "system/src/newlib/sbrk.o" "../system/src/newlib/sbrk.c"
Finished building: ../system/src/newlib/_sbrk.c
Building file: ../system/src/newlib/startup.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -DOSINCLUDESTARTUPINITMULTIPLERAMSECTIONS -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/newlib/startup.d" -MT"system/src/newlib/startup.d" -c -o "system/src/newlib/startup.o" "../system/src/newlib/startup.c"
Finished building: ../system/src/newlib/_startup.c
Building file: ../system/src/newlib/syscalls.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/newlib/syscalls.d" -MT"system/src/newlib/syscalls.o" -c -o "system/src/newlib/syscalls.o" "../system/src/newlib/syscalls.c"
Finished building: ../system/src/newlib/_syscalls.c
Building file: ../system/src/newlib/assert.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/newlib/assert.d" -MT"system/src/newlib/assert.o" -c -o "system/src/newlib/assert.o" "../system/src/newlib/assert.c"
Finished building: ../system/src/newlib/assert.c
Building file: ../system/src/diag/Trace.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/diag/Trace.d" -MT"system/src/diag/Trace.o" -c -o "system/src/diag/Trace.o" "../system/src/diag/Trace.c"
Finished building: ../system/src/diag/Trace.c
Building file: ../system/src/diag/traceimpl.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/diag/traceimpl.d" -MT"system/src/diag/traceimpl.o" -c -o "system/src/diag/traceimpl.o" "../system/src/diag/traceimpl.c"
Finished building: ../system/src/diag/trace_impl.c
Building file: ../system/src/cortexm/initializehardware.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/cortexm/initializehardware.d" -MT"system/src/cortexm/initializehardware.o" -c -o "system/src/cortexm/initializehardware.o" "../system/src/cortexm/initializehardware.c"
Finished building: ../system/src/cortexm/initialize_hardware.c
Building file: ../system/src/cortexm/resethardware.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/cortexm/resethardware.d" -MT"system/src/cortexm/resethardware.o" -c -o "system/src/cortexm/resethardware.o" "../system/src/cortexm/resethardware.c"
Finished building: ../system/src/cortexm/reset_hardware.c
Building file: ../system/src/cortexm/exceptionhandlers.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/cortexm/exceptionhandlers.d" -MT"system/src/cortexm/exceptionhandlers.o" -c -o "system/src/cortexm/exceptionhandlers.o" "../system/src/cortexm/exceptionhandlers.c"
Finished building: ../system/src/cortexm/exception_handlers.c
Building file: ../system/src/cmsis/systemstm32f30x.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/cmsis/systemstm32f30x.d" -MT"system/src/cmsis/systemstm32f30x.o" -c -o "system/src/cmsis/systemstm32f30x.o" "../system/src/cmsis/systemstm32f30x.c"
Finished building: ../system/src/cmsis/system_stm32f30x.c
Building file: ../system/src/cmsis/vectorsstm32f30x.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/cmsis/vectorsstm32f30x.d" -MT"system/src/cmsis/vectorsstm32f30x.o" -c -o "system/src/cmsis/vectorsstm32f30x.o" "../system/src/cmsis/vectorsstm32f30x.c"
Finished building: ../system/src/cmsis/vectors_stm32f30x.c
Building file: ../system/src/FreeRTOSc/croutine.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/FreeRTOSc/croutine.d" -MT"system/src/FreeRTOSc/croutine.o" -c -o "system/src/FreeRTOSc/croutine.o" "../system/src/FreeRTOSc/croutine.c"
Finished building: ../system/src/FreeRTOSc/croutine.c
Building file: ../system/src/FreeRTOSc/eventgroups.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/FreeRTOSc/eventgroups.d" -MT"system/src/FreeRTOSc/eventgroups.o" -c -o "system/src/FreeRTOSc/eventgroups.o" "../system/src/FreeRTOSc/eventgroups.c"
Finished building: ../system/src/FreeRTOSc/event_groups.c
Building file: ../system/src/FreeRTOSc/heap1.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/FreeRTOSc/heap1.d" -MT"system/src/FreeRTOSc/heap1.o" -c -o "system/src/FreeRTOSc/heap1.o" "../system/src/FreeRTOSc/heap1.c"
Finished building: ../system/src/FreeRTOSc/heap_1.c
Building file: ../system/src/FreeRTOSc/list.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/FreeRTOSc/list.d" -MT"system/src/FreeRTOSc/list.o" -c -o "system/src/FreeRTOSc/list.o" "../system/src/FreeRTOSc/list.c"
Finished building: ../system/src/FreeRTOSc/list.c
Building file: ../system/src/FreeRTOSc/port.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I"D:Elektronik ve MeslekleProjelerim2015RtosWrappersystemincludeFreeRTOSh" -std=gnu11 -MMD -MP -MF"system/src/FreeRTOSc/port.d" -MT"system/src/FreeRTOSc/port.o" -c -o "system/src/FreeRTOSc/port.o" "../system/src/FreeRTOSc/port.c"
C:UsersNamchoAppDataLocalTempcc5F19lf.s: Assembler messages:
C:UsersNamchoAppDataLocalTempcc5F19lf.s:372: Error: selected processor does not support Thumb mode vstmdbeq r0!,{s16-s31}'
C:\Users\Namcho\AppData\Local\Temp\cc5F19lf.s:374: Error: instruction not allowed in IT block --
stmdb r0!,{r4-r11,r14}'
C:UsersNamchoAppDataLocalTempcc5F19lf.s:395: Error: selected processor does not support Thumb mode vldmiaeq r0!,{s16-s31}'
C:\Users\Namcho\AppData\Local\Temp\cc5F19lf.s:397: Error: instruction not allowed in IT block --
msr psp,r0'
make: *** [system/src/FreeRTOSc/port.o] Error 1
system/src/FreeRTOSc/subdir.mk:39: recipe for target 'system/src/FreeRTOSc/port.o' failed
18:05:31 Build Finished (took 3s.613ms)
~~~~~~
This is a compiler command line problem. The compiler is complaining about floating point instructions because you have not told it that the processor has a floating point unit.
I'm not sure if the flags in this post are correct for you, but you get the idea:
http://www.freertos.org/FreeRTOSSupportForumArchive/December2012/freertosSTM32F4GCCcompilationproblems_6404907.html
Regards.
Thanks for your help It worked.
Here is my Processor settings:
-Float ABI = softfp(I was trying with hard option because stm32f303 has got hard-FPU unit. I dont figure out yet why this option isn't working.)
-FPU Type = fpv4-sp-d16
-Instruction set = thumb
So after that correction I have worked simple led blink example with using C++.
Anyone can take a look my source code from bitbucket(https://bitbucket.org/Namcho/freertosgccstm32f3/src). The led blink example written in Demo.cpp class file.
Then I have tryed to do same think for FreeRTOS but I failed.
Source code: https://bitbucket.org/Namcho/freertosgccstm32f3/src/404ab212c4acb806a6b18037739adf0f7668cdb9/src/main.cpp?at=develop
Here is compiler output:
~~~~~~
10:42:55 **** Incremental Build of configuration Release for project freeRtosgccstm32f3 ****
make all
Building target: freeRtosgccstm32f3.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts" -Wl,-Map,"freeRtosgccstm32f3.map" --specs=nano.specs -o "freeRtosgccstm32f3.elf" ./system/src/stm32f3-stdperiph/stm32f30xgpio.o ./system/src/stm32f3-stdperiph/stm32f30xrcc.o ./system/src/newlib/cxx.o ./system/src/newlib/exit.o ./system/src/newlib/sbrk.o ./system/src/newlib/startup.o ./system/src/newlib/syscalls.o ./system/src/newlib/assert.o ./system/src/freeRTOS/croutine.o ./system/src/freeRTOS/eventgroups.o ./system/src/freeRTOS/heap4.o ./system/src/freeRTOS/list.o ./system/src/freeRTOS/port.o ./system/src/freeRTOS/queue.o ./system/src/freeRTOS/tasks.o ./system/src/freeRTOS/timers.o ./system/src/diag/Trace.o ./system/src/diag/traceimpl.o ./system/src/cortexm/initializehardware.o ./system/src/cortexm/resethardware.o ./system/src/cortexm/exceptionhandlers.o ./system/src/cmsis/systemstm32f30x.o ./system/src/cmsis/vectorsstm32f30x.o ./src/Demo.o ./src/TaskOOP.o ./src/write.o ./src/main.o
c:/program files (x86)/gnu tools arm embedded/4.9 2015q1/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: freeRtosgccstm32f3.elf section .bss' will not fit in region
RAM'
c:/program files (x86)/gnu tools arm embedded/4.9 2015q1/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: region `RAM' overflowed by 36520 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [freeRtosgccstm32f3.elf] Error 1
makefile:63: recipe for target 'freeRtosgccstm32f3.elf' failed
10:42:58 Build Finished (took 2s.403ms)
~~~~~~
When I make comment ledObj.create("LED1",configMINIMALSTACKSIZE,1); that line, the code is compiled without any errors.
That is a linker error not a compiler error. Somehow including that line has increased the RAM footprint by more thank 30K.
Yes, I examine mem.ld and sections.ld linker file but I cant figure out anything yet.
Could you give me some hint to solve that issue.
First see if it is the C++ that is causing the linker error or just that you are creating a task which then brings in the heap array. Try replacing the call to ledObj.create with a direct xTaskCreate() call. Do you still get the linker error?
Yes I'm still getting the linker error(36520 bytes overflow). I've tryed this in main.cpp file.
In addition I've created C project then compiled just xTaskCreate(vTask1,"LED1",configMINIMALSTACKSIZE,NULL,1,NULL); function
Here is the output:
~~~~~~
13:29:06 **** Incremental Build of configuration Release for project freeRTOSgccstm32f3c ****
make all
Building file: ../src/main.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -DOSUSETRACESEMIHOSTINGDEBUG -DSTM32F30X -DUSESTDPERIPHDRIVER -DHSEVALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f3-stdperiph" -I../system/include/freeRTOS -std=gnu11 -MMD -MP -MF"src/main.d" -MT"src/main.o" -c -o "src/main.o" "../src/main.c"
Finished building: ../src/main.c
Building target: freeRTOS_gcc_stm32f3_c.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -Wall -Wextra -g -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts" -Wl,-Map,"freeRTOS_gcc_stm32f3_c.map" --specs=nano.specs -o "freeRTOS_gcc_stm32f3_c.elf" ./system/src/stm32f3-stdperiph/stm32f30x_gpio.o ./system/src/stm32f3-stdperiph/stm32f30x_rcc.o ./system/src/newlib/_cxx.o ./system/src/newlib/_exit.o ./system/src/newlib/_sbrk.o ./system/src/newlib/_startup.o ./system/src/newlib/_syscalls.o ./system/src/newlib/assert.o ./system/src/freeRTOS/croutine.o ./system/src/freeRTOS/event_groups.o ./system/src/freeRTOS/heap_4.o ./system/src/freeRTOS/list.o ./system/src/freeRTOS/port.o ./system/src/freeRTOS/queue.o ./system/src/freeRTOS/tasks.o ./system/src/freeRTOS/timers.o ./system/src/diag/Trace.o ./system/src/diag/trace_impl.o ./system/src/cortexm/_initialize_hardware.o ./system/src/cortexm/_reset_hardware.o ./system/src/cortexm/exception_handlers.o ./system/src/cmsis/system_stm32f30x.o ./system/src/cmsis/vectors_stm32f30x.o ./src/_write.o ./src/main.o
c:/program files (x86)/gnu tools arm embedded/4.9 2015q1/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: freeRTOS_gcc_stm32f3_c.elf section `.bss' will not fit in region `RAM'
c:/program files (x86)/gnu tools arm embedded/4.9 2015q1/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: region `RAM' overflowed by 36408 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [freeRTOS_gcc_stm32f3_c.elf] Error 1
makefile:63: recipe for target 'freeRTOS_gcc_stm32f3_c.elf' failed
13:29:07 Build Finished (took 1s.188ms)
~~~~~~
As you see just overflowed byte quantity is incresed to 36408 bytes in C.
Which heapn.c file are you using (http://www.freertos.org/a00111.html)?
What is configTOTALHEAP_SIZE set to?
Regards.
I wasn't looked TOTALHEAPSIZE.
Here is the default defination:
#define configTOTALHEAPSIZE ( ( size_t ) ( 75 * 1024 ) )
So it was 75k bytes :)
I've reduced heap to 1k now everything is alright.
Thanks for your helps.
As configTOTALHEAPSIZE is making a difference I guess you are not
using heap3 - in which case you will need more than 1K. Increase the
size gradually until you get linker errors again, then reduce it a bit
so it links. After that you can use xPortGetFreeHeapSize() and
potentially xPortGetMinimumEverFreeHeapSize() to determine how much heap
space you are actually using, and adjust configTOTALHEAP_SIZE accordingly.
Regards.
Yes I'm using heap_4.
Thank you for this important information.
Regards.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.