FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [May 2008 Threads] C++ and FreeRTOSPosted by Thomas on May 13, 2008 I have been trying to get FreeRTOS 5.0 running on a dvk90can1 evaluation board using WinAVR's c++ compiler.
I'm using the port from Dr. Klaus Schaefer and trying out the his Can Driver and the following example. http://kschaefer.eit.h-da.de/ATMEL/CAN/index.html
I have changed a few type casts in order to compile using avr-g++. But as you can see out of the below listing. The linking fails in the end. Some references to Queue.c break.
If I compile the same code using avr-gcc the linking is okay and the example runs fine on the board.
If I loose the dependences to queue.c in the example (only use the task system of FreeRTOS) the g++ compiled code runs fine.
I'm new to FreeRTOS and WinAVR. I have been looking into the FreeRTOS code and I can't figure out why these references to queue.c break when compiling with g++. The compiler don't report any errors before the linking is done.
Can someone please help me?
Build started 13.5.2008 at 07:44:11 avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT main.o -MF dep/main.o.d -c ../main.c
avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT can.o -MF dep/can.o.d -c ../can.c
avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT frtos_can.o -MF dep/frtos_can.o.d -c ../frtos_can.c
avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT tasks.o -MF dep/tasks.o.d -c ../../../Source/tasks.c
avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT queue.o -MF dep/queue.o.d -c ../../../Source/queue.c
avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT list.o -MF dep/list.o.d -c ../../../Source/list.c
avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT heap_1.o -MF dep/heap_1.o.d -c ../../../Source/portable/MemMang/heap_1.c
avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT port.o -MF dep/port.o.d -c ../../../Source/portable/GCC/AT90CAN128/port.c
avr-g++.exe -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\..\..\Source\include" -I"C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\." -mmcu=at90can128 -Wall -gdwarf-2 -O0 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -DGCC _at90can128 -MD -MP -MT croutine.o -MF dep/croutine.o.d -c ../../../Source/croutine.c
avr-g++.exe -mmcu=at90can128 -Wl,-Map=CanDriver.map main.o can.o frtos_can.o tasks.o queue.o list.o heap_1.o port.o croutine.o -o CanDriver.elf main.o: In function `receive_function': C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\default/../main.c:113: undefined reference to `xQueueGenericReceive' frtos_can.o: In function `xCANQueueCreate': C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\default/../frtos_can.c:35: undefined reference to `xQueueCreate' frtos_can.o: In function `CAN_callback(CAN_packet*, unsigned char)': C:\Files\Data\AvrStudio\FreeRTOS\Projects\CanDriver\default/../frtos_can.c:27: undefined reference to `xQueueGenericSendFromISR' make: *** [CanDriver.elf] Error 1 Build failed with 3 errors and 0 warnings...
RE: C++ and FreeRTOSPosted by Dave on May 13, 2008 This could be to do with the data hiding. Queue.c defines xQueueHandle as a pointer to a struct. Queue.h defines xQueueHandle as a pointer to void. If you make them both the same thing it will probably link. To do this you could move the queue data structure definition from queue.c to queue.h.
RE: C++ and FreeRTOSPosted by Thomas on May 13, 2008 Thanks a lot. That solved it.
I have spent hours trying to figure this out.
/Thomas
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|