This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Eclipse neon : weird error appearing !!

hi, so i was coding my program with keil and it reach the 32kb so i had to move to the free IDE Eclipse. for that i followed this tutorial devzone.nordicsemi.com/.../

i used the 4.9.3 release of GNU toolchain and the latest version of Eclipse Neon.

1-a/ i modified my makefile by adding all the source file and the location of header file. here you can find my Makefile and the xx.ld file.

first when i execute the make command via command prompt (windows 10) it work perfectly and it generate my .hex file. so it mean normally my make file and the code are corrects.

and when i try to build the project for the first time inside the Eclipse after adding the source file to my project explorer the build work without error and my .hex file was generated.

but once i open any of the source file the errors comes and the redmarks invaded the source file that i open, the more i open source file the more i got error.

even with these errors eclipse still generating the .hex file. i feel like the eclipse is not in coordination of what my makefile have.

here's for example a screen shot of what the problem is :

image description

as you can see when no source file was opened the build is done and i got no error

image description

as you can see once i open the main.c file a 111 error pop-up and got error everywhere. and the more i open source file the more i got error. but the build still generate an .hex file which is working 100% after flashing it to my board.

by the way i made the Enable auto discovery of symbols, include paths and compiler settings step in the tutorial.

CDT GCC Build Output Parser :

(.gcc)|(.[gc]++)

CDT Built-in Compiler Settings Cross ARM :

arm-none-eabi-gcc ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD "${INPUTS}"

1-b/ the other big problem that i encountered is when i have a variable that i declare without using it like this :

int a;

the compiler give me an error like this

image description

and now the building of the project won't generate the .hex file.

i want to know how to skip this error. normally in other compiler this error would be a warning and the build project still executed. in keil i had the same variable without using them and the build still work.

2- flashing the program issue : so according to the updated version of the tutorial (21.04.15), in the flash download section there is a little paragraph where he says we need to add new target to the project without any further explanation of how to do this. So i didn't know how to do it. So i went back to the older tutorial (29.07.14) to see what is there about flashing the devices and the last and 10th paraph he talk about how to flash using External Tools configuration. So my questions are

2-a/ how to flash using targets ?

2-b/ what are the differences and benefits between flashing with making targets and using the External tools configuration ?

2-c/ using the External Tools configuration i had some problem for configuration the field of working directory: ${workspace_loc}//_build dosen't work so i had to browse it my self and it give me this : ${workspace_loc:/GG_LED_Eclipse/_build} and the arguement too didn't work as describ it in the tutorial, and even this one didn't work --program ${workspace_loc:/GG_LED_Eclipse/_build/.hex} so i had to add the complete name of the hex file like this --program ${workspace_loc:/GG_LED_Eclipse/_build/nrf51422_xxac_s130.hex} then i run it and i got this error // ERROR: The area to write is not erased. Despite that i put the exact memory setting/address in the ***.ld file as i put in the keil IDE. (by the way the soft devices is installed in my flash)

MEMORY { FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000 RAM (rwx) : ORIGIN = 0x20002080, LENGTH = 0x5F80 }

i tired to download the .hex file with nRFGO and i succed without any problem and the led started blinking as i expected meaning my memory setting was OK.

5-e/ the nrfjprog doesn't accept two arguments at the same time. I want to add the --reset and i got this problem ERROR: Two arguments were provided that cannot be combined. Use --help to read ERROR: about the valid argument combinations.

Is there any way to flash direclty my nrf device inside the IDE wihtout using external software like nRFgo ?

Parents
  • I give a try to Eclipse Mars and it give me the same weird error inside the source file. the Eclipse behave too weird. even when i'm pointing to a function and right click and select open declaration didn't work. normally it lead me to the source of the function. it was a total mess.

    but whatever i discovered how to fix it thanks to bluevanilla user who mention the solution in the comment section of the tutorial.

    1-a/ so all i have to do is to right click to the project and select index->Rebuild and all the weird errors gone. and now when i right click on function and select open declaration il lead me to where the function is declared in the other source files.

    image description

    so admin please add this note to the tutorial so it will avoid people struggling. you can add it at the end of the Enable auto discovery of symbols, include paths and compiler settings section.

    1-b/ and concerning the weird error that appear when unused variable was declared but was not used i succeed to remove it by going to the make file and remove the -Werror from the CFLAGS

    before :

    CFLAGS += -Wall -Werror -O0 -g3
    

    after :

    CFLAGS += -Wall -O0 -g3
    

    apparently the -Werror mean that all warning discovered will be treated as an error and the build will be blocked. so normally the unused variable is seing as warning but when this flag is set it will be transformed in an error.

    can you confirm me that admin ?

    now after removing it, the unused variable is appearing as warning during the building and not as an error.

    2/ and what about flashing the devices. it didn't succed to flash the device inside ECLIPSE. any clue ??

Reply
  • I give a try to Eclipse Mars and it give me the same weird error inside the source file. the Eclipse behave too weird. even when i'm pointing to a function and right click and select open declaration didn't work. normally it lead me to the source of the function. it was a total mess.

    but whatever i discovered how to fix it thanks to bluevanilla user who mention the solution in the comment section of the tutorial.

    1-a/ so all i have to do is to right click to the project and select index->Rebuild and all the weird errors gone. and now when i right click on function and select open declaration il lead me to where the function is declared in the other source files.

    image description

    so admin please add this note to the tutorial so it will avoid people struggling. you can add it at the end of the Enable auto discovery of symbols, include paths and compiler settings section.

    1-b/ and concerning the weird error that appear when unused variable was declared but was not used i succeed to remove it by going to the make file and remove the -Werror from the CFLAGS

    before :

    CFLAGS += -Wall -Werror -O0 -g3
    

    after :

    CFLAGS += -Wall -O0 -g3
    

    apparently the -Werror mean that all warning discovered will be treated as an error and the build will be blocked. so normally the unused variable is seing as warning but when this flag is set it will be transformed in an error.

    can you confirm me that admin ?

    now after removing it, the unused variable is appearing as warning during the building and not as an error.

    2/ and what about flashing the devices. it didn't succed to flash the device inside ECLIPSE. any clue ??

Children
No Data
Related