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

  • An other thing I forgot. StartupnRF51.c works with C++. gcc_startup_nrf51.S does not.

  • You did an amazing job removing asm code, really nice. -c

  • C99 __asm vs gnu99 asm.

    I've made a test and is possible to use both (C99 and gnu99) setting :

    Set with gnu99 --> asm with C99 --> __asm

    the compiled file are the same in text, data, bss, dec and hex sizes.

    C99 Invoking: Cross ARM GNU Print Size arm-none-eabi-size --format=berkeley "dfu_nrf51.elf" text data bss dec hex filename 13219 1036 2004 16259 3f83 dfu_nrf51.elf

    gnu99 arm-none-eabi-size --format=berkeley "dfu_nrf51.elf" text data bss dec hex filename 13219 1036 2004 16259 3f83 dfu_nrf51.elf

    -c

  • Thanks, it is good to know. There is however one little problem I haven't figured it out. Don't know if you can find out. When generating a .bin file, the size is over 2MB due to the relocation. How can it be strip down to normal size. The .bin conversion is done by adding this line

    arm-none-eabi-objcopy -O binary ${BuildArtifactFileName} ${BuildArtifactFileBaseName}.bin;

    To the post-build in settings/build steps

  • Only an idea : try to extract only sections from hex.

    objcopy -Iihex -Obinary --only-section .sec1 $Build.hex $Build.bin

    if section is not right try with .sec2 or .sec3.

    -c

Related