This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Eclipse GCC pure project for DFU Bootloader nRF51

Hi,

I have created Eclipse project to compile nRF51 DFU loader. This is a pure Eclipse project, no makfile. It has compile configurations for combination of Single/Dual bank and BLE/Serial. This project require installed nRF51 SDK 5.2 in the same work space under with sdk directory name nrf51_sdk. The project has file links to the source in the sdk hence the sdk directory need to be that name. This will allow you to update to new sdk easier.

Here are the prerequisite.

Eclipse Keplar CDT Eclipse ARM plus ins: Follow this blog gnuarmeclipse.livius.net/.../. this contains support for jlink as well GCC compiler : launchpad.net/gcc-arm-embedded

Here are the attached files common.zip contains common folder to be place in same workspace. dfu_nrf51.zip is the project folder. It contains precompiled & tested hex release version of 4 binations if you don't want to recompile.

Workspace directory should have

Workspace | Common | dfu_nrf51 | nrf51_sdk

I hope this helps anyone who wants to work with Eclipse & GCC.

Good luck

Update sep. 18, 2014

Updated projects with sdk 6.1 on blog site here embeddedsoftdev.blogspot.ca/.../ehal-nrf51.html

  • Hi,

    I followed your steps above and installed eclipse, arm cross compiler, etc. I also added the directories to my workplace. However, I'm getting the following when I try to build any of the targets:

    
    Invoking: Cross ARM C Compiler
    arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -DPSTORAGE_RAW_ACCESS -DNRF51 -DDEBUG_NRF_USER -DNRF51822_QFAA_GC -DBLE_STACK_SUPPORT_REQD -DBOARD_PCA10001 -I"/Volumes/UsersX9/rasit/Documents/workspace/dfu_nrf51/src/include" -I"/Volumes/UsersX9/rasit/Documents/workspace/dfu_nrf51/src/include/ble_transport" -std=c99 -MMD -MP -MF"src/nrf51_sdk/app_gpiote.d" -MT"src/nrf51_sdk/app_gpiote.o" -c -o "src/nrf51_sdk/app_gpiote.o" "/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Source/app_common/app_gpiote.c"
    /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Source/app_common/app_gpiote.c:13:24: fatal error: app_gpiote.h: No such file or directory
    compilation terminated.
    make: *** [src/nrf51_sdk/app_gpiote.o] Error 1
    

    Sorry for the repeat. I could not delete my comment above;-(

  • you need to change the include path for the SDK to the location where you put it. I put the Nordic SDK nrf51822 in nrf51_sdk. When compiler complains about a .h file, check for the include path of the C & C++ settings.

  • Thanks for the prompt reply. I did exactly what you recommended. Here is the directory structure:

    
    raspberry:workspace rasit$ ls -la
    total 16
    drwxr-xr-x   8 rasit  staff   272 12 May 21:25 .
    drwx------+ 12 rasit  staff   408 12 May 21:25 ..
    -rw-r--r--@  1 rasit  staff  6148 12 May 21:49 .DS_Store
    drwxr-xr-x   7 rasit  staff   238 12 May 20:42 .metadata
    drwxr-xr-x@ 13 rasit  staff   442 12 May 21:08 Common
    drwxr-xr-x   3 rasit  staff   102 12 May 20:42 RemoteSystemsTempFiles
    drwxr-xr-x@ 13 rasit  staff   442 12 May 21:54 dfu_nrf51
    drwx------@  6 rasit  staff   204 12 May 21:12 nrf51_sdk
    raspberry:workspace rasit$ 
    raspberry:workspace rasit$ ls -ls nrf51_sdk/
    total 0
    0 drwxr-xr-x@ 9 rasit  staff  306 12 May 21:11 Documentation
    0 drwxr-xr-x@ 6 rasit  staff  204 12 May 21:11 nrf51422
    0 drwxr-xr-x@ 8 rasit  staff  272 12 May 21:49 nrf51822
    
    

    and the missing header files is in app_common directory, under .nrf51822/Include.

    The properties->c/C++ General->Paths and Symbols--Languages->GNU C

    has the following Include directories:

    
    /${ProjName}/src/include
    /${ProjName}/src/include/ble_transport
    /nrf51sdk_/nrf51822/Include/app_common
    ...
    
    

    I'm not sure what am I missing?

  • you should have these include path set like this for the SDK

    "${workspace_loc:/nrf51_sdk/nrf51822/Include/ble/ble_services}" "${workspace_loc:/nrf51_sdk/nrf51822/Include/sd_common}" "${workspace_loc:/nrf51_sdk/nrf51822/Include/ble}" "${workspace_loc:/nrf51_sdk/nrf51822/Include/s110}" "${workspace_loc:/nrf51_sdk/nrf51822/Include/app_common}" "${workspace_loc:/nrf51_sdk/nrf51822/Include/gcc}" "${workspace_loc:/nrf51_sdk/nrf51822/Include}"

  • Thanks, the problem is solved... However, I now get:

    
    Building file: /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Source/app_common/app_gpiote.c
    Invoking: Cross ARM C Compiler
    arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g3 -DPSTORAGE_RAW_ACCESS -DNRF51 -DDEBUG_NRF_USER -DNRF51822_QFAA_GC -DBLE_STACK_SUPPORT_REQD -DBOARD_PCA10001 -I"/Volumes/UsersX9/rasit/Documents/workspace/dfu_nrf51/src/include" -I"/Volumes/UsersX9/rasit/Documents/workspace/dfu_nrf51/src/include/ble_transport" -I/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/sd_common -I/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/ble -I/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include -I/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/s110 -I/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/ble/ble_services -I/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/app_common -I/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/gcc -std=c99 -MMD -MP -MF"src/nrf51_sdk/app_gpiote.d" -MT"src/nrf51_sdk/app_gpiote.o" -c -o "src/nrf51_sdk/app_gpiote.o" "/Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Source/app_common/app_gpiote.c"
    In file included from /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/nrf.h:44:0,
                     from /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/app_common/app_gpiote.h:43,
                     from /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Source/app_common/app_gpiote.c:13:
    /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/compiler_abstraction.h: In function 'gcc_current_sp':
    /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/compiler_abstraction.h:73:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'
    /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/compiler_abstraction.h:73:30: warning: implicit declaration of function 'asm' [-Wimplicit-function-declaration]
    /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/compiler_abstraction.h:74:16: error: 'sp' undeclared (first use in this function)
    /Volumes/UsersX9/rasit/Documents/workspace/nrf51_sdk/nrf51822/Include/compiler_abstraction.h:74:16: note: each undeclared identifier is reported only once for each function it appears in
    make: *** [src/nrf51_sdk/app_gpiote.o] Error 1
    
    

    what am I missing this time?

Related