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

Eclipse neon managed make, fails to generate the right code

Hey Guys,

I am trying to create a workflow for creating new project from scratch in eclipse, traditional way with nRF5 sdk provided make file is not scalable and it really painful.

I go the inspiration from this page here

I am to a point where I get the code compile and it generates the hex file, however the hex file generated when flashed does not blink the LED, I think the code is not generated or is not at the right place for it work. I think its the later as GCC warns that reset is set to 00000000 in the build output.

I will really appreciate if any one of you can give it a try and tell what is going on.

I have posted the project on github here

I am using eclipse neon on MAC OS X, GCC ARM 4.9.

If you try to download it and make it work, you might just have change few build variable that points to SDK and GCC location. Everything else should work fine.

If you have PCA100040 please flash the project and see if it works for you, I latest commit should have the code and hex file and other required stuff.

I think, I am almost there. just need a small push.

Just for the reference this the build output from eclipse

make all 

Building file: ../src/main.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -O2  -g -DBOARD_PCA10040 -DBSP_DEFINES_ONLY -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52_PAN_31 -DNRF52_PAN_30 -DNRF52_PAN_51 -DNRF52_PAN_36 -DNRF52_PAN_53 -DNRF52_PAN_64 -DNRF52_PAN_55 -DNRF52_PAN_62 -DNRF52_PAN_63 -DNRF52 -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/examples/bsp" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/drivers_nrf/hal" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/toolchain/cmsis/include" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/toolchain/gcc" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/toolchain" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/device" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/drivers_nrf/delay" -std=gnu99 -MMD -MP -MF"src/main.d" -MT"src/main.o" -c -o "src/main.o" "../src/main.c"
Finished building: ../src/main.c
 
Building file: ../src/system_nrf52.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -O2  -g -DBOARD_PCA10040 -DBSP_DEFINES_ONLY -DCONFIG_GPIO_AS_PINRESET -DNRF52_PAN_12 -DNRF52_PAN_15 -DNRF52_PAN_58 -DNRF52_PAN_20 -DNRF52_PAN_54 -DNRF52_PAN_31 -DNRF52_PAN_30 -DNRF52_PAN_51 -DNRF52_PAN_36 -DNRF52_PAN_53 -DNRF52_PAN_64 -DNRF52_PAN_55 -DNRF52_PAN_62 -DNRF52_PAN_63 -DNRF52 -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/examples/bsp" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/drivers_nrf/hal" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/toolchain/cmsis/include" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/toolchain/gcc" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/toolchain" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/device" -I"/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/drivers_nrf/delay" -std=gnu99 -MMD -MP -MF"src/system_nrf52.d" -MT"src/system_nrf52.o" -c -o "src/system_nrf52.o" "../src/system_nrf52.c"
Finished building: ../src/system_nrf52.c
 
Building target: Eclipse_template.elf
Invoking: Cross ARM C Linker
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -O2  -g -T "/Users/bhaumik/Documents/workspace/Eclipse_template/blinky_gcc_nrf52.ld" -L/Users/bhaumik/Downloads/nRF5_SDK_12-2/components/toolchain/gcc -Wl,-Map,"/Users/bhaumik/Documents/workspace/Eclipse_template/debug/Eclipse_template.map" -o "Eclipse_template.elf"  ./src/main.o ./src/system_nrf52.o   
/Users/bhaumik/mac-build/gcc-arm-none-eabi-4_9-2015q3/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 0000000000000000
Finished building target: Eclipse_template.elf
 
Invoking: Cross ARM GNU Create Flash Image
arm-none-eabi-objcopy -O ihex "Eclipse_template.elf"  "Eclipse_template.hex"
Finished building: Eclipse_template.hex
 
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "Eclipse_template.elf"
   text	   data	    bss	    dec	    hex	filename
   1900	   1092	     28	   3020	    bcc	Eclipse_template.elf
Finished building: Eclipse_template.siz

Thanks,

Bhaumik

Related