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