FreeRTOS undefined reference error on ATmega328p port

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

I was trying to adapt the example of the ATmega323 of FreeRTOS to the ATmega328p. I knew the only difference were the timer registers and the interrupt vector names.

Therefore I created a project called hello_world_328p in AS7 and copied all the sources from the example.

 

 

Then I modified (I know is the wrong approach) the 323 to fit the 328 and put all in the search path, like this:

 

 

(second view of the includes)

 

 

But compiling is still giving the followin log:

 

------ Build started: Project: hello_world_328p, Configuration: Debug AVR ------
Build started.
Project "hello_world_328p.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\hello_world_328p.cproj" (target "Build" depends on it):
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync
        Building file: .././main.c
        Invoking: AVR/GNU C Compiler : 4.9.2
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\include" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\include" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\portable\GCC\ATMega323" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Demo\Common" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Demo\Common\include" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Demo\Common\Full" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Demo\Common\Minimal" -I"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\portable\Common" -I"C:\Users\thexeno\Dropbox\FIRMWA~1\FREERT~2.1\Projects\HELLO_~1\HELLO_~1\ParTest" -I"C:\Users\thexeno\Dropbox\FIRMWA~1\FREERT~2.1\Projects\HELLO_~1\HELLO_~1\serial"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c"
        Finished building: .././main.c
        Building target: hello_world_328p.elf
        Invoking: AVR/GNU Linker : 4.9.2
        main.o: In function `vErrorChecks':
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(189,1): error: undefined reference to `vTaskDelay'
        main.o: In function `prvCheckOtherTasksAreStillRunning':
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(205,1): error: undefined reference to `xAreIntegerMathsTaskStillRunning'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(210,1): error: undefined reference to `xAreComTestTasksStillRunning'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(215,1): error: undefined reference to `xArePollingQueuesStillRunning'
        main.o: In function `main':
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(158,1): error: undefined reference to `vStartIntegerMathTasks'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(159,1): error: undefined reference to `vAltStartComTestTasks'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(160,1): error: undefined reference to `vStartPolledQueueTasks'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(164,1): error: undefined reference to `xTaskCreate'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(167,1): error: undefined reference to `vStartFlashCoRoutines'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(172,1): error: undefined reference to `vTaskStartScheduler'
        ParTest/ParTest.o: In function `vParTestToggleLED':
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\ParTest\ParTest.c(102,1): error: undefined reference to `vTaskSuspendAll'
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -o hello_world_328p.elf  main.o ParTest/ParTest.o regtest.o serial/serial.o   -Wl,-Map="hello_world_328p.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source" -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\include" -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\portable\GCC\ATMega323"  -Wl,--gc-sections -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p"  
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\Debug\Makefile(145,1): error: recipe for target 'hello_world_328p.elf' failed
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\ParTest\ParTest.c(115,1): error: undefined reference to `xTaskResumeAll'
        regtest.o: In function `vStartRegTestTasks':
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\regtest.c(49,1): error: undefined reference to `xTaskCreate'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\regtest.c(50,1): error: undefined reference to `xTaskCreate'
        serial/serial.o: In function `__vector_18':
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\serial\serial.c(198,1): error: undefined reference to `xQueueGenericSendFromISR'
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\serial\serial.c(202,1): error: undefined reference to `vPortYield'
        serial/serial.o: In function `__vector_19':
C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\serial\serial.c(211,1): error: undefined reference to `xQueueReceiveFromISR'
collect2.exe(0,0): error: ld returned 1 exit status
        make: *** [hello_world_328p.elf] Error 1
        The command exited with code 2.
    Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "hello_world_328p.cproj" -- FAILED.
Done building project "hello_world_328p.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

 

Attached also the project, in case you spot some change or something needed. I don't think you will be able to compile natively, as all is related in an absolute link to the folders, but still...

Also attached the port version of the 328p, in "C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\portable\GCC\ATMega323" (I know, 323 is not 328... but was just to try).

 

Let me know if you need something else, I think I am just missing something very stupid.

 

Cheers

 

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\Projects\hello_world_328p\hello_world_328p\main.c(189,1): error: undefined reference to `vTaskDelay'

 

Then your project has not listed all the .c files from FreeRTOS that you need.

 

What you are really trying to recreate in AS7 are the contents (for 323 anyway) of 

D:\FreeRTOSv10.2.1\FreeRTOS\Demo\AVR_ATMega323_WinAVR>type makefile
# WinAVR Sample makefile written by Eric B. Weddington, J÷rg Wunsch, et al.
#
# !SNIP!
#

# MCU name
MCU = atmega323

# Output format. (can be srec, ihex, binary)
FORMAT = ihex

# Target file name (without extension).
TARGET = rtosdemo

# Optimization level, can be [0, 1, 2, 3, s]. 0 turns off optimization.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s

# List C source files here. (C dependencies are automatically generated.)
DEMO_DIR = ../Common/Minimal
SOURCE_DIR = ../../Source
PORT_DIR = ../../Source/portable/GCC/ATMega323

SRC     = \
main.c \
ParTest/ParTest.c \
serial/serial.c \
regtest.c \
$(SOURCE_DIR)/tasks.c \
$(SOURCE_DIR)/queue.c \
$(SOURCE_DIR)/list.c \
$(SOURCE_DIR)/croutine.c \
$(SOURCE_DIR)/portable/MemMang/heap_1.c \
$(PORT_DIR)/port.c \
$(DEMO_DIR)/crflash.c \
$(DEMO_DIR)/integer.c \
$(DEMO_DIR)/PollQ.c \
$(DEMO_DIR)/comtest.c

You need ALL of the files listed there in your project.

 

For example VTaskDelay (the first error I happened to pick) is in ..\..\Source\tasks.c

 

I recently pulled a copy of FreeRTOS so I'll see if I can create a project to build the 323 demo "as is".

Last Edited: Tue. Jul 2, 2019 - 08:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

 

OK so try this - it should be positioned here:

 

 

There are build errors but they are all because of the switch between 323 and 328P. I'll leave you to fix those. Thinks like...

 

 

BTW I didn't really intend this to happen but to organize the files I created "folders" for "DEMO_DIR", "SOURCE_DIR", "PORT_DIR", to match the original names in the Makefile, then dragged the FreeRTOS files into each. In VS2010/VS2015/2017 doing so does not copy files but simply organizes them to display in the given structure but it seems that in AS7 it actually creates folders on disk and copies files (?!?!) so the layout looks like this:

 

 

The upside of this (I suppose) is that the attached .zip file should be completely self supporting - you wouldn't even need a downloaded copy of FreeRTOS!

 

(except that I did not drag/copy the main.c, regtest.c etc so those are probably still in their original location in the tree).

 

BTW these project settings are quite important:

 

 

 

 

Attachment(s): 

Last Edited: Tue. Jul 2, 2019 - 09:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Trying with you project I cannot make it compile. All the headers, after adding all the directories with absolute locations (actually, in the end does not matter, the error is the same), are not found.

For example, is does not find FreeRTOSConfig.h, but when going to the files presenting the error and clicking on the missing header include, in the navigation bar the directory does not appears so the IDE really does not find it. I thinks it has to do with the fact that the files are put in the folders. So before going down, I thought there is something wrong with my settings.

 

In fact, in my project instead, all the files and the missing complaints are somehow all found in the IDE. And I also add all the directories search with the reference in the FreeRTOS folder, as per manual. And the IDE see the things correctly, despite the errors, hence I don't understand...

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


When I grep:

D:\FreeRTOSv10.2.1\FreeRTOS>grep vStartIntegerMathTasks * -r --include "*.c"
Demo/ARM7_AT91FR40008_GCC/main.c:       vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM7_AT91SAM7S64_IAR/main.c:       vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM7_LPC2106_GCC/main.c:   vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM7_LPC2129_IAR/main.c:   vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM7_LPC2138_Rowley/main.c:        vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM7_LPC2368_Rowley/main.c:    vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
Demo/ARM7_STR71x_IAR/main.c:    vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM7_STR75x_GCC/main.c:    vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM7_STR75x_IAR/main.c:    vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM9_AT91SAM9XE_IAR/main.c:        vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/ARM9_STR91X_IAR/main.c:    vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/AVR32_UC3/main.c:  vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/AVR_ATMega323_IAR/main.c:  vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/AVR_ATMega323_WinAVR/main.c:       vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/Common/Full/integer.c:void vStartIntegerMathTasks( unsigned portBASE_TYPE uxPriority )
Demo/Common/Minimal/integer.c:void vStartIntegerMathTasks( UBaseType_t uxPriority )
Demo/CORTEX_AT91SAM3U256_IAR/main.c:    vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );
Demo/CORTEX_ATSAM3S-EK2_Atmel_Studio/src/main_full.c:   vStartIntegerMathTasks( tskIDLE_PRIORITY );
Demo/CORTEX_ATSAM3X_Atmel_Studio/src/main_full.c:       vStartIntegerMathTasks( tskIDLE_PRIORITY );
etc
etc

So the point of implementation is integer.c

 

It *should* be built as part of the project...

 

 

In the build log I see:

		Building file: ../DEMO_DIR/integer.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/integer.d" -MT"DEMO_DIR/integer.d" -MT"DEMO_DIR/integer.o"   -o "DEMO_DIR/integer.o" "../DEMO_DIR/integer.c" 
		Finished building: ../DEMO_DIR/integer.c

so it should be built??

 

BTW rather than looking at "Error List" (which I find almost entirely pointless in all versions of Visual Studio) I would take a look at the "Output" tab and see what actually happened during the build. Was integer.c part of it and at the final link stage was integer.o one of the link inputs ?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, the picture was from my project. Because it really makes no sense. By following your suggestion, here the output (it actually starts from the task delay function):

 

----- Build started: Project: hello_world_328p, Configuration: Debug AVR ------
Build started.
Project "hello_world_328p.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\hello_world_328p.cproj" (target "Build" depends on it):
    Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 8 --output-sync
        main.o: In function `vErrorChecks':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(189,1): error: undefined reference to `vTaskDelay'
        main.o: In function `prvCheckOtherTasksAreStillRunning':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(205,1): error: undefined reference to `xAreIntegerMathsTaskStillRunning'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(210,1): error: undefined reference to `xAreComTestTasksStillRunning'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(215,1): error: undefined reference to `xArePollingQueuesStillRunning'
        main.o: In function `main':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(158,1): error: undefined reference to `vStartIntegerMathTasks'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(159,1): error: undefined reference to `vAltStartComTestTasks'
        Building target: hello_world_328p.elf
        Invoking: AVR/GNU Linker : 5.4.0
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -o hello_world_328p.elf  main.o ParTest/ParTest.o regtest.o serial/serial.o   -Wl,-Map="hello_world_328p.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source" -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\include" -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\portable\GCC\ATMega323"  -Wl,--gc-sections -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p"
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\Debug\Makefile(144,1): error: recipe for target 'hello_world_328p.elf' failed
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(160,1): error: undefined reference to `vStartPolledQueueTasks'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(164,1): error: undefined reference to `xTaskCreate'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(167,1): error: undefined reference to `vStartFlashCoRoutines'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(172,1): error: undefined reference to `vTaskStartScheduler'
        ParTest/ParTest.o: In function `vParTestToggleLED':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\ParTest\ParTest.c(101,1): error: undefined reference to `vTaskSuspendAll'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\ParTest\ParTest.c(114,1): error: undefined reference to `xTaskResumeAll'
        regtest.o: In function `vStartRegTestTasks':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\regtest.c(49,1): error: undefined reference to `xTaskCreate'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\regtest.c(50,1): error: undefined reference to `xTaskCreate'
collect2.exe(0,0): error: ld returned 1 exit status
        make: *** [hello_world_328p.elf] Error 1
        The command exited with code 2.
    Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "hello_world_328p.cproj" -- FAILED.
Done building project "hello_world_328p.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

Thanks to your reply I realized I was missing some includes:

 

 

and this is also what the IDE see:

 

In this case it does not even see the task.c, which should be present in the Include dir setting. I would like to fix those things, to get how the IDE really include stuff. In the end, I would like to have all FreeRTOS stuff in one folder which I can update separately and use for other projects, so I need to make the IDE see all the files (and I think this is also the official way to use FreeRTOS... make your project link to their files).

 

Later I will try again with your example too.

Last Edited: Wed. Jul 3, 2019 - 03:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do a "Rebuild All" and post the Output. The above is assuming everything has already been compiled so we cannot see what was compiled.

 

PS I'll start - this is what I see when I rebuild. As I said previously there ARE errors but these are just porting errors between the mega323 the code was written for and the mega328P it's now set to build for:

------ Rebuild All started: Project: FreeRTOS_AS7, Configuration: Debug AVR ------
Build started.
Project "FreeRTOS_AS7.cproj" (Clean target(s)):
Target "Clean" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_AS7\FreeRTOS_AS7.cproj" (entry point):
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe clean 
		rm -rf  DEMO_DIR/comtest.o DEMO_DIR/crflash.o DEMO_DIR/integer.o DEMO_DIR/PollQ.o main.o ParTest.o PORT_DIR/port.o regtest.o serial.o SOURCE_DIR/croutine.o SOURCE_DIR/heap_1.o SOURCE_DIR/list.o SOURCE_DIR/queue.o SOURCE_DIR/tasks.o   
		rm -rf  DEMO_DIR/comtest.d DEMO_DIR/crflash.d DEMO_DIR/integer.d DEMO_DIR/PollQ.d main.d ParTest.d PORT_DIR/port.d regtest.d serial.d SOURCE_DIR/croutine.d SOURCE_DIR/heap_1.d SOURCE_DIR/list.d SOURCE_DIR/queue.d SOURCE_DIR/tasks.d   
		rm -rf "FreeRTOS_AS7.elf" "FreeRTOS_AS7.a" "FreeRTOS_AS7.hex" "FreeRTOS_AS7.lss" "FreeRTOS_AS7.eep" "FreeRTOS_AS7.map" "FreeRTOS_AS7.srec" "FreeRTOS_AS7.usersignatures"
	Done executing task "RunCompilerTask".
Done building target "Clean" in project "FreeRTOS_AS7.cproj".
Done building project "FreeRTOS_AS7.cproj".

Build succeeded.
------ Rebuild All started: Project: FreeRTOS_AS7, Configuration: Debug AVR ------
Build started.
Project "FreeRTOS_AS7.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_AS7\FreeRTOS_AS7.cproj" (target "Build" depends on it):
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 8 --output-sync 
		Building file: ../PORT_DIR/port.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		../PORT_DIR/port.c: In function 'prvSetupTimerInterrupt':
D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_AS7\PORT_DIR\port.c(392,14): error: 'TIMSK' undeclared (first use in this function)
		  ucLowByte = TIMSK;
		              ^
D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_AS7\PORT_DIR\port.c(392,14): info: each undeclared identifier is reported only once for each function it appears in
		../PORT_DIR/port.c: In function 'SIG_OUTPUT_COMPARE1A':
D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_AS7\PORT_DIR\port.c(406,7): warning: 'SIG_OUTPUT_COMPARE1A' appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
		  void SIG_OUTPUT_COMPARE1A( void )
		       ^
		make: *** [PORT_DIR/port.o] Error 1
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "PORT_DIR/port.d" -MT"PORT_DIR/port.d" -MT"PORT_DIR/port.o"   -o "PORT_DIR/port.o" "../PORT_DIR/port.c" 
D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_AS7\Debug\Makefile(186,1): error: recipe for target 'PORT_DIR/port.o' failed
		make: *** Waiting for unfinished jobs....
		Building file: .././ParTest.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "ParTest.d" -MT"ParTest.d" -MT"ParTest.o"   -o "ParTest.o" ".././ParTest.c" 
		Finished building: .././ParTest.c
		Building file: ../DEMO_DIR/comtest.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/comtest.d" -MT"DEMO_DIR/comtest.d" -MT"DEMO_DIR/comtest.o"   -o "DEMO_DIR/comtest.o" "../DEMO_DIR/comtest.c" 
		Finished building: ../DEMO_DIR/comtest.c
		Building file: ../DEMO_DIR/crflash.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/crflash.d" -MT"DEMO_DIR/crflash.d" -MT"DEMO_DIR/crflash.o"   -o "DEMO_DIR/crflash.o" "../DEMO_DIR/crflash.c" 
		Finished building: ../DEMO_DIR/crflash.c
		Building file: ../DEMO_DIR/integer.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/integer.d" -MT"DEMO_DIR/integer.d" -MT"DEMO_DIR/integer.o"   -o "DEMO_DIR/integer.o" "../DEMO_DIR/integer.c" 
		Finished building: ../DEMO_DIR/integer.c
		Building file: ../DEMO_DIR/PollQ.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/PollQ.d" -MT"DEMO_DIR/PollQ.d" -MT"DEMO_DIR/PollQ.o"   -o "DEMO_DIR/PollQ.o" "../DEMO_DIR/PollQ.c" 
		Finished building: ../DEMO_DIR/PollQ.c
		Building file: .././main.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c" 
		Finished building: .././main.c
		Building file: .././regtest.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DGCC_MEGA_AVR -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "regtest.d" -MT"regtest.d" -MT"regtest.o"   -o "regtest.o" ".././regtest.c" 
		Finished building: .././regtest.c
	Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "FreeRTOS_AS7.cproj" -- FAILED.
Done building project "FreeRTOS_AS7.cproj" -- FAILED.

Build FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I supposed I should fix the port errors so it then goes on to the link.

Last Edited: Wed. Jul 3, 2019 - 03:40 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK so it looks like the only two files that need 323->328P changes are port.c and serial.c. I changed those and the whole thing now builds without error for me.

Done building target "Build" in project "FreeRTOS_AS7.cproj".
Done building project "FreeRTOS_AS7.cproj".

Build succeeded.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

Modified files attached.

 

But I realise now the mistake I made when I created this project. Instead of it making reference to files within the existing source tree by using Add Existing then taking the "Add as Link" option I just used "Add" which copies the source files into the project directory. So I may have another go at recreating it so it just lives alongside the FreeRtos distribution.

 

PS by the way:

	Task "RunOutputFileVerifyTask"
				Program Memory Usage 	:	9580 bytes   29.2 % Full
				Data Memory Usage 		:	1750 bytes   85.4 % Full

That seems like a LOT of RAM usage for something that barely does anything !!

 

EDIT: Oh I see, main user of RAM is:

.bss.ucHeap    0x0080019d      0x5dc SOURCE_DIR/heap_1.o

That is 1,500 bytes set aside for the heap. That results from:

#define configTOTAL_HEAP_SIZE		( (size_t ) ( 1500 ) )

 

 

Attachment(s): 

Last Edited: Wed. Jul 3, 2019 - 04:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

OK so here's a second try at it (on my machine this builds clean). It should be positioned in the FreeRTOS structure here:

 

 

The very fact that the .zip file is now only 13K hopefully shows that it does not contain any of the sources but only makes relative references to them in the FreeRTOS tree structure alongside.

 

To build clean this still needs the port.c and serial.c in the main tree to be replaced with my 328P versions above. That is:

 

D:\FreeRTOSv10.2.1\FreeRTOS\Source\portable\GCC\ATMega323\port.c

D:\FreeRTOSv10.2.1\FreeRTOS\Demo\AVR_ATMega323_WinAVR\serial\serial.c

 

Of course, at this stage, I am bound to say my usual "an RTOS on a micro that only has 32K flash, really??" or perhaps even more correctly "an RTOS on a micro that only has 2K of RAM, really??"

 

PS oh and this is the complete build...

------ Rebuild All started: Project: FreeRTOS_take2, Configuration: Debug AVR ------
Build started.
Project "FreeRTOS_take2.cproj" (Clean target(s)):
Target "Clean" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_take2\FreeRTOS_take2.cproj" (entry point):
	Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe clean 
		rm -rf  main.o ParTest.o regtest.o serial.o DEMO_DIR/comtest.o DEMO_DIR/crflash.o DEMO_DIR/integer.o DEMO_DIR/PollQ.o SOURCE_DIR/croutine.o SOURCE_DIR/list.o PORT_DIR/port.o SOURCE_DIR/heap_1.o SOURCE_DIR/queue.o SOURCE_DIR/tasks.o   
		rm -rf  main.d ParTest.d regtest.d serial.d DEMO_DIR/comtest.d DEMO_DIR/crflash.d DEMO_DIR/integer.d DEMO_DIR/PollQ.d SOURCE_DIR/croutine.d SOURCE_DIR/list.d PORT_DIR/port.d SOURCE_DIR/heap_1.d SOURCE_DIR/queue.d SOURCE_DIR/tasks.d   
		rm -rf "FreeRTOS_take2.elf" "FreeRTOS_take2.a" "FreeRTOS_take2.hex" "FreeRTOS_take2.lss" "FreeRTOS_take2.eep" "FreeRTOS_take2.map" "FreeRTOS_take2.srec" "FreeRTOS_take2.usersignatures"
	Done executing task "RunCompilerTask".
Done building target "Clean" in project "FreeRTOS_take2.cproj".
Done building project "FreeRTOS_take2.cproj".

Build succeeded.
------ Rebuild All started: Project: FreeRTOS_take2, Configuration: Debug AVR ------
Build started.
Project "FreeRTOS_take2.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_take2\FreeRTOS_take2.cproj" (target "Build" depends on it):
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 8 --output-sync 
		Building file: ../../Demo/AVR_ATMega323_WinAVR/main.c
		Invoking: AVR/GNU C Compiler : 5.4.0
D:\FreeRTOSv10.2.1\FreeRTOS\Demo\AVR_ATMega323_WinAVR\main.c(155,7): warning: return type of 'main' is not 'int' [-Wmain]
		 short main( void )
		       ^
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" "../../Demo/AVR_ATMega323_WinAVR/main.c" 
		Finished building: ../../Demo/AVR_ATMega323_WinAVR/main.c
		Building file: ../../Demo/AVR_ATMega323_WinAVR/ParTest/ParTest.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "ParTest.d" -MT"ParTest.d" -MT"ParTest.o"   -o "ParTest.o" "../../Demo/AVR_ATMega323_WinAVR/ParTest/ParTest.c" 
		Finished building: ../../Demo/AVR_ATMega323_WinAVR/ParTest/ParTest.c
		Building file: ../../Demo/AVR_ATMega323_WinAVR/regtest.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "regtest.d" -MT"regtest.d" -MT"regtest.o"   -o "regtest.o" "../../Demo/AVR_ATMega323_WinAVR/regtest.c" 
		Finished building: ../../Demo/AVR_ATMega323_WinAVR/regtest.c
		Building file: ../../Demo/Common/Minimal/comtest.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/comtest.d" -MT"DEMO_DIR/comtest.d" -MT"DEMO_DIR/comtest.o"   -o "DEMO_DIR/comtest.o" "../../Demo/Common/Minimal/comtest.c" 
		Finished building: ../../Demo/Common/Minimal/comtest.c
		Building file: ../../Demo/Common/Minimal/crflash.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/crflash.d" -MT"DEMO_DIR/crflash.d" -MT"DEMO_DIR/crflash.o"   -o "DEMO_DIR/crflash.o" "../../Demo/Common/Minimal/crflash.c" 
		Finished building: ../../Demo/Common/Minimal/crflash.c
		Building file: ../../Demo/AVR_ATMega323_WinAVR/serial/serial.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "serial.d" -MT"serial.d" -MT"serial.o"   -o "serial.o" "../../Demo/AVR_ATMega323_WinAVR/serial/serial.c" 
		Finished building: ../../Demo/AVR_ATMega323_WinAVR/serial/serial.c
		Building file: ../../Demo/Common/Minimal/integer.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/integer.d" -MT"DEMO_DIR/integer.d" -MT"DEMO_DIR/integer.o"   -o "DEMO_DIR/integer.o" "../../Demo/Common/Minimal/integer.c" 
		Finished building: ../../Demo/Common/Minimal/integer.c
		Building file: ../../Demo/Common/Minimal/PollQ.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "DEMO_DIR/PollQ.d" -MT"DEMO_DIR/PollQ.d" -MT"DEMO_DIR/PollQ.o"   -o "DEMO_DIR/PollQ.o" "../../Demo/Common/Minimal/PollQ.c" 
		Finished building: ../../Demo/Common/Minimal/PollQ.c
		Building file: ../../Source/list.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "SOURCE_DIR/list.d" -MT"SOURCE_DIR/list.d" -MT"SOURCE_DIR/list.o"   -o "SOURCE_DIR/list.o" "../../Source/list.c" 
		Finished building: ../../Source/list.c
		Building file: ../../Source/croutine.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "SOURCE_DIR/croutine.d" -MT"SOURCE_DIR/croutine.d" -MT"SOURCE_DIR/croutine.o"   -o "SOURCE_DIR/croutine.o" "../../Source/croutine.c" 
		Finished building: ../../Source/croutine.c
		Building file: ../../Source/portable/GCC/ATMega323/port.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "PORT_DIR/port.d" -MT"PORT_DIR/port.d" -MT"PORT_DIR/port.o"   -o "PORT_DIR/port.o" "../../Source/portable/GCC/ATMega323/port.c" 
		Finished building: ../../Source/portable/GCC/ATMega323/port.c
		Building file: ../../Source/portable/MemMang/heap_1.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		../../Source/portable/MemMang/heap_1.c: In function 'pvPortMalloc':
D:\FreeRTOSv10.2.1\FreeRTOS\Source\portable\MemMang\heap_1.c(90,39): warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
		    pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) &ucHeap[ portBYTE_ALIGNMENT ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) );
		                                       ^
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "SOURCE_DIR/heap_1.d" -MT"SOURCE_DIR/heap_1.d" -MT"SOURCE_DIR/heap_1.o"   -o "SOURCE_DIR/heap_1.o" "../../Source/portable/MemMang/heap_1.c" 
		Finished building: ../../Source/portable/MemMang/heap_1.c
		Building file: ../../Source/queue.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "SOURCE_DIR/queue.d" -MT"SOURCE_DIR/queue.d" -MT"SOURCE_DIR/queue.o"   -o "SOURCE_DIR/queue.o" "../../Source/queue.c" 
		Finished building: ../../Source/queue.c
		Building file: ../../Source/tasks.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		../../Source/tasks.c: In function 'prvInitialiseNewTask':
D:\FreeRTOSv10.2.1\FreeRTOS\Source\tasks.c(862,40): warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
		   pxTopOfStack = ( StackType_t * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); /*lint !e923 !e9033 !e9078 MISRA exception.  Avoiding casts between pointers and integers is not practical.  Size differences accounted for using portPOINTER_SIZE_TYPE type.  Checked by assert(). */
		                                        ^
D:\FreeRTOSv10.2.1\FreeRTOS\Source\tasks.c(862,18): warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
		   pxTopOfStack = ( StackType_t * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); /*lint !e923 !e9033 !e9078 MISRA exception.  Avoiding casts between pointers and integers is not practical.  Size differences accounted for using portPOINTER_SIZE_TYPE type.  Checked by assert(). */
		                  ^
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\include" -I"../../Source/include" -I"../../Demo/Common/include" -I"../../Demo/AVR_ATMega323_WinAVR"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "SOURCE_DIR/tasks.d" -MT"SOURCE_DIR/tasks.d" -MT"SOURCE_DIR/tasks.o"   -o "SOURCE_DIR/tasks.o" "../../Source/tasks.c" 
		Finished building: ../../Source/tasks.c
		Building target: FreeRTOS_take2.elf
		Invoking: AVR/GNU Linker : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -o FreeRTOS_take2.elf  main.o ParTest.o regtest.o serial.o DEMO_DIR/comtest.o DEMO_DIR/crflash.o DEMO_DIR/integer.o DEMO_DIR/PollQ.o SOURCE_DIR/croutine.o SOURCE_DIR/list.o PORT_DIR/port.o SOURCE_DIR/heap_1.o SOURCE_DIR/queue.o SOURCE_DIR/tasks.o   -Wl,-Map="FreeRTOS_take2.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\Atmel\ATmega_DFP\1.3.300\gcc\dev\atmega328p"  
		Finished building target: FreeRTOS_take2.elf
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures  "FreeRTOS_take2.elf" "FreeRTOS_take2.hex"
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom  --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0  --no-change-warnings -O ihex "FreeRTOS_take2.elf" "FreeRTOS_take2.eep" || exit 0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "FreeRTOS_take2.elf" > "FreeRTOS_take2.lss"
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "FreeRTOS_take2.elf" "FreeRTOS_take2.srec"
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "FreeRTOS_take2.elf"
		   text	   data	    bss	    dec	    hex	filename
		   9500	     80	   1670	  11250	   2bf2	FreeRTOS_take2.elf
	Done executing task "RunCompilerTask".
	Using "RunOutputFileVerifyTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
	Task "RunOutputFileVerifyTask"
				Program Memory Usage 	:	9580 bytes   29.2 % Full
				Data Memory Usage 		:	1750 bytes   85.4 % Full
	Done executing task "RunOutputFileVerifyTask".
Done building target "CoreBuild" in project "FreeRTOS_take2.cproj".
Target "PostBuildEvent" skipped, due to false condition; ('$(PostBuildEvent)' != '') was evaluated as ('' != '').
Target "Build" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Avr.common.targets" from project "D:\FreeRTOSv10.2.1\FreeRTOS\FreeRTOS_take2\FreeRTOS_take2.cproj" (entry point):
Done building target "Build" in project "FreeRTOS_take2.cproj".
Done building project "FreeRTOS_take2.cproj".

Build succeeded.
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

 

 

Attachment(s): 

Last Edited: Wed. Jul 3, 2019 - 04:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wonderful. Your solution now compile in a clean way. Is a good starting point, I also see you add 3 includes directories in the project property, so I tried to do the same, and actually the output is the same (meaning all the additional includes were superfluous).

The difference, and because is the my main goal, here is that I am using the source files of the example IN the working project, but with all the links put properly, it should work in theory. But we are in a practical world, so... it does not.

 

The same means, I get the same undefined reference errors. I am trying it on another machine, but I setup in the same way everything like before. Your project works too in this other machine. Here the output:

 

------ Rebuild All started: Project: hello_world_328p, Configuration: Debug AVR ------
Build started.
Project "hello_world_328p.cproj" (Clean target(s)):
Target "Clean" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\hello_world_328p.cproj" (entry point):
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe clean
		rm -rf  main.o ParTest/ParTest.o regtest.o serial/serial.o
		rm -rf  main.d ParTest/ParTest.d regtest.d serial/serial.d
		rm -rf "hello_world_328p.elf" "hello_world_328p.a" "hello_world_328p.hex" "hello_world_328p.lss" "hello_world_328p.eep" "hello_world_328p.map" "hello_world_328p.srec" "hello_world_328p.usersignatures"
	Done executing task "RunCompilerTask".
Done building target "Clean" in project "hello_world_328p.cproj".
Done building project "hello_world_328p.cproj".

Build succeeded.
------ Rebuild All started: Project: hello_world_328p, Configuration: Debug AVR ------
Build started.
Project "hello_world_328p.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\hello_world_328p.cproj" (target "Build" depends on it):
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 8 --output-sync
		Building file: .././main.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\include" -I"C:\FreeRTOSv10.2.1\FreeRTOS\Source\include" -I"C:\FreeRTOSv10.2.1\FreeRTOS\Demo\Common\include" -I"C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c"
		Finished building: .././main.c
		Building file: ../ParTest/ParTest.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\include" -I"C:\FreeRTOSv10.2.1\FreeRTOS\Source\include" -I"C:\FreeRTOSv10.2.1\FreeRTOS\Demo\Common\include" -I"C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "ParTest/ParTest.d" -MT"ParTest/ParTest.d" -MT"ParTest/ParTest.o"   -o "ParTest/ParTest.o" "../ParTest/ParTest.c"
		Finished building: ../ParTest/ParTest.c
		Building file: .././regtest.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\include" -I"C:\FreeRTOSv10.2.1\FreeRTOS\Source\include" -I"C:\FreeRTOSv10.2.1\FreeRTOS\Demo\Common\include" -I"C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "regtest.d" -MT"regtest.d" -MT"regtest.o"   -o "regtest.o" ".././regtest.c"
		Finished building: .././regtest.c
		Building file: ../serial/serial.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG -DGCC_MEGA_AVR  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\include" -I"C:\FreeRTOSv10.2.1\FreeRTOS\Source\include" -I"C:\FreeRTOSv10.2.1\FreeRTOS\Demo\Common\include" -I"C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p" -c -std=gnu99 -MD -MP -MF "serial/serial.d" -MT"serial/serial.d" -MT"serial/serial.o"   -o "serial/serial.o" "../serial/serial.c"
		Finished building: ../serial/serial.c
		Building target: hello_world_328p.elf
		Invoking: AVR/GNU Linker : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -o hello_world_328p.elf  main.o ParTest/ParTest.o regtest.o serial/serial.o   -Wl,-Map="hello_world_328p.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source" -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\include" -Wl,-L"C:\Users\thexeno\Dropbox\Firmwares\FreeRTOSv10.2.1\FreeRTOS\Source\portable\GCC\ATMega323"  -Wl,--gc-sections -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.1.130\gcc\dev\atmega328p"
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\Debug\Makefile(144,1): error: recipe for target 'hello_world_328p.elf' failed
		main.o: In function `vErrorChecks':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(189,1): error: undefined reference to `vTaskDelay'
		main.o: In function `prvCheckOtherTasksAreStillRunning':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(205,1): error: undefined reference to `xAreIntegerMathsTaskStillRunning'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(210,1): error: undefined reference to `xAreComTestTasksStillRunning'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(215,1): error: undefined reference to `xArePollingQueuesStillRunning'
		main.o: In function `main':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(158,1): error: undefined reference to `vStartIntegerMathTasks'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(159,1): error: undefined reference to `vAltStartComTestTasks'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(160,1): error: undefined reference to `vStartPolledQueueTasks'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(164,1): error: undefined reference to `xTaskCreate'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(167,1): error: undefined reference to `vStartFlashCoRoutines'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\main.c(172,1): error: undefined reference to `vTaskStartScheduler'
		ParTest/ParTest.o: In function `vParTestToggleLED':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\ParTest\ParTest.c(101,1): error: undefined reference to `vTaskSuspendAll'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\ParTest\ParTest.c(114,1): error: undefined reference to `xTaskResumeAll'
		regtest.o: In function `vStartRegTestTasks':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\regtest.c(49,1): error: undefined reference to `xTaskCreate'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\regtest.c(50,1): error: undefined reference to `xTaskCreate'
		serial/serial.o: In function `__vector_18':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\serial\serial.c(198,1): error: undefined reference to `xQueueGenericSendFromISR'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\serial\serial.c(202,1): error: undefined reference to `vPortYield'
		serial/serial.o: In function `__vector_19':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\serial\serial.c(211,1): error: undefined reference to `xQueueReceiveFromISR'
collect2.exe(0,0): error: ld returned 1 exit status
		make: *** [hello_world_328p.elf] Error 1
		The command exited with code 2.
	Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "hello_world_328p.cproj" -- FAILED.
Done building project "hello_world_328p.cproj" -- FAILED.

Build FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Here the project tree:

 

 

Here the includes:

 

 

 

PS: Regarding why an RTOS, I am doing it just to learn. And I think the more constraint the device is, the better to appreciate the all ecosystem (and is a micro I have around here...).

PPS: if I have 1750B used, the remaining 250B will never be used, right? If yes, then why would be a warning? Because of the stack? But isn't it already allocated in those 1750B along with the heap?

Last Edited: Fri. Jul 5, 2019 - 08:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Once again your project does not have sufficient files in it. The "core" files of FreeRTOS (the ones in "SOURCE_DIR" above) are:

SOURCE_DIR/croutine.o 
SOURCE_DIR/heap_1.o 
SOURCE_DIR/list.o 
SOURCE_DIR/queue.o 
SOURCE_DIR/tasks.o 

So every FreeRTOS program you build must have the .c files for those added into the project. For example all the 

C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\ParTest\ParTest.c(101,1): error: undefined reference to `vTaskSuspendAll'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\ParTest\ParTest.c(114,1): error: undefined reference to `xTaskResumeAll'
		regtest.o: In function `vStartRegTestTasks':
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\regtest.c(49,1): error: undefined reference to `xTaskCreate'
C:\Users\u22w42\Downloads\hello_world_328p\hello_world_328p\regtest.c(50,1): error: undefined reference to `xTaskCreate'
etc. etc.

Are referring to functions in tasks.c so if you don't build tasks.c as part of your project then the linker will not have implementations of those functions available to it and it will simply report "undefined reference".

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, that definitely solved the issue.

 

But I am getting frustrated on why on my project the solution explorer is doing weird tricks with visualized folders. In other words, when I add the files as a link under, let's say SOURCE_DIR, when I restart, this folder appears empty, and another copy appear full in another subdirectory with the name of the project, like in the picture:

 

 

any clue why your project is not doing it? The difference is that the files of the demo are copied internally, which is my intention. If you try to do the same (it does not have to compile), do you get the same "error"?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It does seem very unfortunate that Atmel chose to provide "new folder" when VS2015 provides "new filter" which is a FAR better way to organize files in a project. One of AS7's key things though is "add as link" rather than just the default "add' (which really means copy then add)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks you, so is an "issue" of Visual Studio/Atmel Studio integration, not a wrong usage I was doing.

For the memory usage and the worries about "being too much", I would try in another thread if it does not get clear on my own why, with an RTOS, such usage of RAM is too much.

 

Thank you!