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 :
as you can see when no source file was opened the build is done and i got no error
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
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 ?