I guess this is not an FreeRTOS specific question, but I am not finding any reference or help. I have the demo for Intel galileo imported to eclipse and builds without errors. The guide speaks about a Rtosdemo.elf file that is supposed to be created in the Debug folder of the project, but ther i find different .o files. What do I have left of obtain the final file?
Is the project configured to generate a file with a .elf extension
(which is the case if using the project from the FreeRTOS release and
have not modified it).
Are you sure the linking phase of the build was performed, and
completed? Perhaps the files only built and didn’t link?
I could not find where it is set. I imported the project directly to Eclipse Neon CDT and had to adapt
Not sure anymore. I have seen an error in the console.
collect2.exe: error: ld returned 1 exit status
This is the console output of a clean build
16:49:24 **** Rebuild of configuration Debug for project RTOSDemo ****
Info: Internal Builder is used for build
i686-elf-gcc "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o "Blinky_Demo\\main_blinky.o" "..\\Blinky_Demo\\main_blinky.c"
i686-elf-gcc "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o main.o "..\\main.c"
..\main.c: In function 'prvDisplayAssertion':
..\main.c:254:2: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=]
printf( "ASSERT: File = %s, Line = %u\n\r", pcFile, ulLine );
^
i686-elf-gcc "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o "Full_Demo\\main_full.o" "..\\Full_Demo\\main_full.c"
i686-elf-gcc "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o "Support_Files\\freestanding_functions.o" "..\\Support_Files\\freestanding_functions.c"
..\Support_Files\freestanding_functions.c:77:2: warning: #warning The functions in this file are very basic, and not optimised. [-Wcpp]
#warning The functions in this file are very basic, and not optimised.
^
i686-elf-gcc "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o "Support_Files\\GPIO_I2C.o" "..\\Support_Files\\GPIO_I2C.c"
i686-elf-gcc -nostartfiles -nostdlib "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -o "Support_Files\\startup.o" "..\\Support_Files\\startup.S"
PATH\AppData\Local\Temp\ccmIBpAJ.o: In function `_mboot_hdr':
(.text.entry+0x18): undefined reference to `__text_start'
PATH\AppData\Local\Temp\ccmIBpAJ.o: In function `_mboot_hdr':
(.text.entry+0x20): undefined reference to `__bss_end'
PATH\AppData\Local\Temp\ccmIBpAJ.o: In function `_start':
(.text.entry+0x29): undefined reference to `bootsign'
PATH\AppData\Local\Temp\ccmIBpAJ.o: In function `_start':
(.text.entry+0x2f): undefined reference to `bootinfo'
PATH\AppData\Local\Temp\ccmIBpAJ.o: In function `_restart':
(.text.entry+0x40): undefined reference to `__stack_for_main'
PATH\AppData\Local\Temp\ccmIBpAJ.o: In function `_restart':
(.text.entry+0x48): undefined reference to `setsegs'
PATH\AppData\Local\Temp\ccmIBpAJ.o: In function `gdt1':
(.text.entry+0x70): undefined reference to `CRT_Init'
PATH\AppData\Local\Temp\ccmIBpAJ.o: In function `gdt1':
(.text.entry+0x75): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
16:49:26 Build Finished (took 2s.820ms)
Indeed it looks like the code never linked - hence you don’t have the
final .elf output.
From your output it looks like a mismatch between the linker script and
the source files - probably startup.S is using linker symbols that are
not present in your linker script.
What is the linker script? Eclipse is a clean installation and the demo has been the only project created on it. I see that startup.s has the variables defined (for example .global _mboot_hdr).
Maybe I need to include more folders in the includes of the project?
May I be facing version problems? What version of Eclipse CDT have tested?
Not sure what I have changed (clean, rebuild, and check all configuration) but it looks like the script is correctly called. Now I am seeing this errros:
08:44:24 **** Rebuild of configuration Debug for project RTOSDemo ****
Info: Internal Builder is used for build
i686-elf-gcc "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o "Support_Files\\HPET.o" "..\\Support_Files\\HPET.c"
i686-elf-gcc "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o "Blinky_Demo\\main_blinky.o" "..\\Blinky_Demo\\main_blinky.c"
i686-elf-gcc "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o "Full_Demo\\main_full.o" "..\\Full_Demo\\main_full.c"
i686-elf-gcc "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo\\Full_Demo" "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo\\Support_Files" "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\intel\\FreeRTOS_Labs_160112\\FreeRTOS\\Source\\include" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\intel\\FreeRTOSv9.0.0\\FreeRTOS\\Demo\\Common\\include" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -O0 -g3 -Wall -c -fmessage-length=0 -o "Full_Demo\\IntQueueTimer.o" "..\\Full_Demo\\IntQueueTimer.c"
i686-elf-gcc -nostartfiles -nostdlib "-IC:\\jordi\\IDI\\eclispe_neon_c\\RTOSDemo" "-IC:\\jordi\\IDI\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -o "Full_Demo\\RegTest.o" "..\\Full_Demo\\RegTest.S"
c:/jordi/soft/ghost-i686-elf-tools/bin/../lib/gcc/i686-elf/4.8.2/../../../../i686-elf/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 08048054
C:\Users\jblasi\AppData\Local\Temp\ccg8zzhj.o: In function `vRegTest1':
RegTest.S:(.text.last+0x20): undefined reference to `dRegTest1_st7'
RegTest.S:(.text.last+0x26): undefined reference to `dRegTest1_st6'
RegTest.S:(.text.last+0x2c): undefined reference to `dRegTest1_st5'
RegTest.S:(.text.last+0x32): undefined reference to `dRegTest1_st4'
RegTest.S:(.text.last+0x38): undefined reference to `dRegTest1_st3'
RegTest.S:(.text.last+0x3e): undefined reference to `dRegTest1_st2'
RegTest.S:(.text.last+0x44): undefined reference to `dRegTest1_st1'
C:\Users\jblasi\AppData\Local\Temp\ccg8zzhj.o: In function `_RegTest1Loop':
RegTest.S:(.text.last+0x92): undefined reference to `dRegTest1_st7'
RegTest.S:(.text.last+0xa4): undefined reference to `dRegTest1_st6'
RegTest.S:(.text.last+0xb6): undefined reference to `dRegTest1_st5'
RegTest.S:(.text.last+0xc8): undefined reference to `dRegTest1_st4'
RegTest.S:(.text.last+0xda): undefined reference to `dRegTest1_st3'
RegTest.S:(.text.last+0xec): undefined reference to `dRegTest1_st2'
RegTest.S:(.text.last+0xfe): undefined reference to `dRegTest1_st1'
RegTest.S:(.text.last+0x111): undefined reference to `ulRegTest1Counter'
C:\Users\jblasi\AppData\Local\Temp\ccg8zzhj.o: In function `vRegTest2':
RegTest.S:(.text.last+0x13d): undefined reference to `dRegTest2_st7'
RegTest.S:(.text.last+0x143): undefined reference to `dRegTest2_st6'
RegTest.S:(.text.last+0x149): undefined reference to `dRegTest2_st5'
RegTest.S:(.text.last+0x14f): undefined reference to `dRegTest2_st4'
RegTest.S:(.text.last+0x155): undefined reference to `dRegTest2_st3'
RegTest.S:(.text.last+0x15b): undefined reference to `dRegTest2_st2'
RegTest.S:(.text.last+0x161): undefined reference to `dRegTest2_st1'
C:\Users\jblasi\AppData\Local\Temp\ccg8zzhj.o: In function `_RegTest2Loop':
RegTest.S:(.text.last+0x1af): undefined reference to `dRegTest2_st7'
RegTest.S:(.text.last+0x1c5): undefined reference to `dRegTest2_st6'
RegTest.S:(.text.last+0x1db): undefined reference to `dRegTest2_st5'
RegTest.S:(.text.last+0x1f1): undefined reference to `dRegTest2_st4'
RegTest.S:(.text.last+0x207): undefined reference to `dRegTest2_st3'
RegTest.S:(.text.last+0x21d): undefined reference to `dRegTest2_st2'
RegTest.S:(.text.last+0x233): undefined reference to `dRegTest2_st1'
RegTest.S:(.text.last+0x249): undefined reference to `vGenerateYieldInterrupt'
RegTest.S:(.text.last+0x24f): undefined reference to `ulRegTest2Counter'
C:\Users\jblasi\AppData\Local\Temp\ccg8zzhj.o: In function `vApplicationHPETTimer1Wrapper':
RegTest.S:(.text.last+0x25d): undefined reference to `ulInterruptNesting'
RegTest.S:(.text.last+0x266): undefined reference to `pucPortTaskFPUContextBuffer'
RegTest.S:(.text.last+0x273): undefined reference to `pucPortTaskFPUContextBuffer'
RegTest.S:(.text.last+0x278): undefined reference to `pxCurrentTCB'
RegTest.S:(.text.last+0x280): undefined reference to `ulTopOfSystemStack'
RegTest.S:(.text.last+0x288): undefined reference to `ulInterruptNesting'
RegTest.S:(.text.last+0x28e): undefined reference to `vHPETIRQHandler1'
RegTest.S:(.text.last+0x295): undefined reference to `ulInterruptNesting'
RegTest.S:(.text.last+0x29b): undefined reference to `ulInterruptNesting'
RegTest.S:(.text.last+0x2a4): undefined reference to `ulPortYieldPending'
RegTest.S:(.text.last+0x2ae): undefined reference to `ulPortYieldPending'
RegTest.S:(.text.last+0x2b7): undefined reference to `vTaskSwitchContext'
RegTest.S:(.text.last+0x2bc): undefined reference to `pxCurrentTCB'
RegTest.S:(.text.last+0x2c4): undefined reference to `pucPortTaskFPUContextBuffer'
RegTest.S:(.text.last+0x2c9): undefined reference to `pucPortTaskFPUContextBuffer'
collect2.exe: error: ld returned 1 exit status
08:44:25 Build Finished (took 1s.696ms)
I have seen that the variables referenced are defined in main_full.c. What am I missing?
warning: cannot find entry symbol _start; defaulting to 08048054
This error is linked with not finding a main method, that is actually located in the main.c file. I tried to launch the build process without the -nostartfiles signal and I get different erros, refering to variables I cannot find:
10:16:26 **** Incremental Build of configuration Debug for project RTOSDemo ****
Info: Internal Builder is used for build
i686-elf-gcc -nostdlib "-IC:\\PATH\\RTOSDemo" "-IC:\\PATH\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -o "Support_Files\\startup.o" "..\\Support_Files\\startup.S"
PATH\AppData\Local\Temp\cccB4TFS.o: In function `_mboot_hdr':
(.text.entry+0x18): undefined reference to `__text_start'
PATH\AppData\Local\Temp\cccB4TFS.o: In function `_mboot_hdr':
(.text.entry+0x20): undefined reference to `__bss_end'
PATH\AppData\Local\Temp\cccB4TFS.o: In function `_start':
(.text.entry+0x29): undefined reference to `bootsign'
PATH\AppData\Local\Temp\cccB4TFS.o: In function `_start':
(.text.entry+0x2f): undefined reference to `bootinfo'
PATH\AppData\Local\Temp\cccB4TFS.o: In function `_restart':
(.text.entry+0x40): undefined reference to `__stack_for_main'
PATH\AppData\Local\Temp\cccB4TFS.o: In function `_restart':
(.text.entry+0x48): undefined reference to `setsegs'
PATH\AppData\Local\Temp\cccB4TFS.o: In function `gdt1':
(.text.entry+0x70): undefined reference to `CRT_Init'
PATH\AppData\Local\Temp\cccB4TFS.o: In function `gdt1':
(.text.entry+0x75): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
I have just installed Eclipse Neon for the first time, taken a clean FreeRTOS V9 download, imported the IA32 project into a new Eclipse workspace, and built the project without making any changes (this assumes the compiler is installed and in the path correctly for your machine, which it was already for mine). This is the output I get:
Trying the fresh installation I have done a correct Build. I think I now the problem. If I import the project in its location it compiles without erros. If I ask it to be moved to the workspace It generates errors. Look like it looses certain references on the process.