Eclipse Neon and Intel Port

jordiblasi wrote on Tuesday, June 28, 2016:

Hi,

I am trying to install the Eclipse platform to compile freertos for an Intel Galileo 2Gen. I just downloaded the port and the Eclipse Neon for C. I have imported the project and added the include folders from the compiler as no libraries where being loaded:

C:\MinGW\lib\gcc\mingw32\4.6.1\include\c++
C:\MinGW\lib\gcc\mingw32\4.6.1\include\c++\mingw32
C:\MinGW\lib\gcc\mingw32\4.6.1\include\c++\backward
C:\MinGW\lib\gcc\mingw32\4.6.1\include
C:\MinGW\include
C:\MinGW\lib\gcc\mingw32\4.6.1\include-fixed

I also included the include folders of the port.

xxx\FreeRTOS\Source\include
xxx\FreeRTOS\Demo\Common\include

I have no include errors but I still find that code is reporting this error on the main_blinky.c file:

Symbol ‘portMAX_DELAY’ could not be resolved main_blinky.c /RTOSDemo/Blinky_Demo line 229 Semantic Error

What I am missing?

Thanks

rtel wrote on Tuesday, June 28, 2016:

You need to have the chosen port layer in the include path too. In this
case:

FreeRTOS/Source/portable/GCC/IA32_flat

[you are better off using an elf compiler rather than the coff MingW]

jordiblasi wrote on Tuesday, June 28, 2016:

I am not sure how to check which compiler I am using. I have installed elf and it is in the path, as described in the Build instructions.

I have added:

C:\jordi\IDI\2016_Odsi\01_development\FreeRTOS\Source\portable\GCC\IA32_flat

And the error disapeared but now I am seeing this one:

.space specifies non-absolute value startup.S /RTOSDemo/Support_Files line 126 C/C++ Problem

I also tried adding this folders:

C:\jordi\soft\ghost-i686-elf-tools\lib\gcc\i686-elf\4.8.2\include
C:\jordi\soft\ghost-i686-elf-tools\lib\gcc\i686-elf\4.8.2\include-fixed

And I got these errors on building the project:

no such instruction: 'portfreertos_interrupt_entry'	RegTest.S	/RTOSDemo/Full_Demo	line 319	C/C++ Problem
no such instruction: 'portfreertos_interrupt_exit'	RegTest.S	/RTOSDemo/Full_Demo	line 321	C/C++ Problem

Which should I have included?

Thanks

rtel wrote on Tuesday, June 28, 2016:

You should not need to add the compiler’s include paths manually.

What happens if you try building the project exactly as it is in the
download, without any edits?

jordiblasi wrote on Tuesday, June 28, 2016:

Just with the FreeRtos includes i get this:

.space specifies non-absolute value startup.S /RTOSDemo/Support_Files line 126 C/C++ Problem

rtel wrote on Tuesday, June 28, 2016:

Well the line in question is:

gdt:	.space	GDT_BYTES

where GDT_BYTES is:

#define	GDT_ENTRIES	8
#define	GDT_ENTRY_SIZE	8
#define	GDT_BYTES	(GDT_ENTRIES * GDT_ENTRY_SIZE)

so at a guess you could try modifying the line to hard code the
GDT_BYTES value as such:

gdt: .space 64

jordiblasi wrote on Tuesday, June 28, 2016:

That worked. Now the error is gone, but I see new ones:

Description	Resource	Path	Location	Type
no such instruction: `portfreertos_interrupt_entry'	RegTest.S	/RTOSDemo/Full_Demo	line 319	C/C++ Problem
no such instruction: `portfreertos_interrupt_exit'	RegTest.S	/RTOSDemo/Full_Demo	line 321	C/C++ Problem

rtel wrote on Tuesday, June 28, 2016:

It would seem that your compiler is not pre-processing the source files
properly - that would explain the previous error too. As the file has
an upper case .S extension then, as long as you assembly the assembly
file with GCC rather than GAS, the pre-processor should replace the
macro it is complaining about with inline asm code.

jordiblasi wrote on Tuesday, June 28, 2016:

How can I check which compiler I am using? May this mean that I have MinGW running?

rtel wrote on Tuesday, June 28, 2016:

The first thing to do is look at the output generated by the compiler as
the project builds - you should be able to see the command line. If it
is just “gcc” then you are most likely using MingW. You can of course
rename the MingW installation directory to see if you then get an error
that the project cannot find the compiler.

jordiblasi wrote on Tuesday, June 28, 2016:

I was calling the wrong compiler. I just corrected it but I am still getting the same error. This is the console output:

12:13:06 **** Incremental Build 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 "Support_Files\\HPET.o" "..\\Support_Files\\HPET.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 "Full_Demo\\main_full.o" "..\\Full_Demo\\main_full.c" 
i686-elf-as "-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" 
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\\printf-stdarg.o" "..\\Support_Files\\printf-stdarg.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\\galileo-support.o" "..\\Support_Files\\galileo-support.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 "Full_Demo\\IntQueueTimer.o" "..\\Full_Demo\\IntQueueTimer.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-as "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -o "Full_Demo\\RegTest.o" "..\\Full_Demo\\RegTest.S" 
..\Full_Demo\RegTest.S: Assembler messages:
..\Full_Demo\RegTest.S:319: Error: no such instruction: `portfreertos_interrupt_entry'
..\Full_Demo\RegTest.S:321: Error: no such instruction: `portfreertos_interrupt_exit'

rtel wrote on Tuesday, June 28, 2016:

I can see from your output that you are assembling using i686-elf-as,
you need to use i686-elf-gcc as per the .c files.

jordiblasi wrote on Tuesday, June 28, 2016:

When changing from as to gcc I get this:

12:34:13 **** Incremental Build of configuration Debug for project RTOSDemo ****
Info: Internal Builder is used for build
i686-elf-gcc "-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/ghost-i686-elf-tools/bin/../lib/gcc/i686-elf/4.8.2/../../../../i686-elf/bin/ld.exe: cannot find crt0.o: No such file or directory
path/ghost-i686-elf-tools/bin/../lib/gcc/i686-elf/4.8.2/../../../../i686-elf/bin/ld.exe: cannot find -lc
collect2.exe: error: ld returned 1 exit status

rtel wrote on Tuesday, June 28, 2016:

So now it looks like it has compiled and assembled the .c and .S files,
but is failing to link.

Again I would ask, what output do you get if you build the project
without any modifications - as it looks like you may have command line
problems.

jordiblasi wrote on Tuesday, June 28, 2016:

The only modifications to the project is adding the following folders to Preferences-C/C++ General/Paths and Symbols/Includes/GNU

C:\jordi\IDI\2016_Odsi\01_development\intel\FreeRTOS_Labs_160112\FreeRTOS\Source\include
C:\jordi\IDI\2016_Odsi\01_development\intel\FreeRTOSv9.0.0\FreeRTOS\Demo\Common\include
C:\jordi\IDI\2016_Odsi\01_development\FreeRTOS\Source\portable\GCC\IA32_flat

And to Assembly:
C:\jordi\IDI\2016_Odsi\01_development\FreeRTOS\Source\portable\GCC\IA32_flat

This is what I see in the console:

13:04:39 **** Incremental Build 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 "Support_Files\\galileo-support.o" "..\\Support_Files\\galileo-support.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\\HPET.o" "..\\Support_Files\\HPET.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" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -o "Full_Demo\\RegTest.o" "..\\Full_Demo\\RegTest.S" 
PATH/ghost-i686-elf-tools/bin/../lib/gcc/i686-elf/4.8.2/../../../../i686-elf/bin/ld.exe: cannot find crt0.o: No such file or directory
PATH/ghost-i686-elf-tools/bin/../lib/gcc/i686-elf/4.8.2/../../../../i686-elf/bin/ld.exe: cannot find -lc
collect2.exe: error: ld returned 1 exit status

rtel wrote on Tuesday, June 28, 2016:

I think the linker should have a ‘no start files’ option and/or ‘no
standard library’ option on the command line, but from the output - the
fact its trying to find crt0.o and the c library - it would appear that
is not the case.

jordiblasi wrote on Tuesday, June 28, 2016:

Do not use standard start files 
No startup or defaul libs

Where not marked. Now they are but I get the same result


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 "Support_Files\\GPIO_I2C.o" "..\\Support_Files\\GPIO_I2C.c" 
i686-elf-gcc "-IC:\\PATH\\eclispe_neon_c\\RTOSDemo" "-IC:\\PATH\\2016_Odsi\\01_development\\FreeRTOS\\Source\\portable\\GCC\\IA32_flat" -o "Full_Demo\\RegTest.o" "..\\Full_Demo\\RegTest.S" 
c:/PATH/ghost-i686-elf-tools/bin/../lib/gcc/i686-elf/4.8.2/../../../../i686-elf/bin/ld.exe: cannot find crt0.o: No such file or directory
c:/PATH/ghost-i686-elf-tools/bin/../lib/gcc/i686-elf/4.8.2/../../../../i686-elf/bin/ld.exe: cannot find -lc
collect2.exe: error: ld returned 1 exit status

jordiblasi wrote on Tuesday, June 28, 2016:

Done it.

Looks like I needed to add the “-nostartfiles -nostdlib” not only to the compile configuration but to the assembler. No It builds without errors.

Thanks

jordiblasi wrote on Tuesday, June 28, 2016:

Done it.

Looks like I needed to add the “-nostartfiles -nostdlib” not only to the compile configuration but to the assembler. No It builds without errors.

Thanks