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

Creating a new project under Eclipse from scratch

I'm new to Nordic devices and tools. I have experience with Eclipse but I was wondering if there is a guide to help with the creation of a brand new project under Eclipse. I installed CDT and GDB for Eclipse but I don't see how eclipse is pointing to ARM tool set when I click New, Looks like I have to manually edit Cross GCC Compiler settings to point to ARM stuff. I'm sure this is correct but I'm afraid this will take a long time and I may find out this is the wrong way. A guide would save me some precious time.

Please let me know.

Thanks, GIL

Parents
  • Check this: nAN-29 It shows example makefile-project. If you want to create a project from scratch, you will need to do this:

    1. Install Eclipse Kepler with GNU ARM Eclipse Plug-in.

    2. Do what was written in nAN-29 in 1 Required tools and 1.1 Setting up Eclipse.

    3. Create new empty C project -> Executable -> Cross ARM GCC press next -> next -> select toolchain name "GNU Tools for ARM Embedded Processors (arm-none-eabi-gcc)" and path to toolchain for example "C:\Program Files\GNU Tools ARM Embedded\4.8 2013q4\bin"

    4. Add all files from the example project folder to your eclipse project folder i.e. for ble_app_proximity copy files : nRF51 SDK_v5.1.0.36092\Nordic\nrf51822\Board\pca10001\s110\ble_app_proximity\ble_bondmngr_cfg.h nRF51 SDK_v5.1.0.36092\Nordic\nrf51822\Board\pca10001\s110\ble_app_proximity\main.c nRF51 SDK_v5.1.0.36092\Nordic\nrf51822\Board\pca10001\s110\ble_app_proximity\pstorage_platform.h

    5. Create new folder in the eclipse project folder with "startup" name and put in there files: nRF51 SDK_v5.1.0.36092\Nordic\nrf51822\Source\templates\system_nrf51.c nRF51 SDK_v5.1.0.36092\Nordic\nrf51822\Source\templates\gcc\gcc_startup_nrf51.S change file extension from small .s to big .S

    6. Create new folder in the eclipse project folder with "linker" name and put in there files: nRF51 SDK_v5.1.0.36092\Nordic\nrf51822\Source\templates\gcc\gcc_nrf51_common.ld and one more linker file with the name according to your needs gcc_nrf51_{1}_{2}.ld: where {1}: blank

    • for projects without softdevice s110 - for projects with s110 softdevice s120 - for projects with s210 softdevice and {2}: xxaa - for chips with xxAA at the end (i.e. NRF51822-QFAA-GC) xxab - for chips with xxAB at the end
    1. Add new linked folder to project with Source and Include folders from SDK. 7.1. Go to the linked Include folder and do Resource Configurations -> Exclude from build for either s110 or s120 folder depending on what softdevice you are planning to use. For ble_app_proximity exclude s120 folder. 7.2. Go to the Source folder and do Resource Configurations -> Exclude from build for all the files in there that are not needed for the project. For ble_app_proximity check out what files are needed from existing keil example project: nRF51 SDK_v5.1.0.36092\Nordic\nrf51822\Board\pca10001\s110\ble_app_proximity\arm\ble_app_proximity.uvproj

    2. Go to the project properties -> C/C++ Builder -> Settings: 8.1. In target processor select ARM family: cortex-m0 8.2. In Optimization uncheck all flags and set optimization level to none (-O0). Later you can change this settings. 8.3. In Cross ARM C Compiller -> Preprocessor add defined symbols: NRF51 DEBUG NRF51822_QFAA_GC DEBUG_NRF_USER BLE_STACK_SUPPORT_REQD BOARD_PCA10001 Change them according to your board. 8.4. In Cross ARM C Compiller -> Includes add all required include paths. For ble_app_proximity it will be: "${workspace_loc:/${ProjName}}" "${workspace_loc:/${ProjName}/Nordic/Include}" "${workspace_loc:/${ProjName}/Nordic/Include/app_common}" "${workspace_loc:/${ProjName}/Nordic/Include/ble}" "${workspace_loc:/${ProjName}/Nordic/Include/ble/ble_services}" "${workspace_loc:/${ProjName}/Nordic/Include/boards}" "${workspace_loc:/${ProjName}/Nordic/Include/ext_sensors}" "${workspace_loc:/${ProjName}/Nordic/Include/gcc}" "${workspace_loc:/${ProjName}/Nordic/Include/s110}" "${workspace_loc:/${ProjName}/Nordic/Include/sd_common}" 8.5. In Cross ARM C Compiller -> Optimization select Language standard to GNU ISO C99 (-std=gnu99). 8.6. In Cross ARM C Compiller -> Miscellaneous add to the Other compiler flags -Wno-unused-local-typedefs -mabi=aapcs -mfloat-abi=soft. 8.7. In Cross ARM C Linker -> General add main linker file. For ble_app_proximity it will be: "${workspace_loc:/${ProjName}/linker/gcc_nrf51_s110_xxaa.ld}" And uncheck all flags. 8.8. In Cross ARM C Linker -> Libraries add Library search path to the gcc_nrf51_common.ld file. "${workspace_loc:/${ProjName}/linker}" Uncheck all flags and add to the Other linker flags -mabi=aapcs.

    UPD: I fogot a few things in 8.7 and 8.8 and added them now.

    UPD2:I added sample eclipse project: Eclipse_workspace.rar

  • What is 7 ? can anyone understand this language ? its not even a sentence. Why is it so hard for people to create guide for other people and not other machines ? these steps where useless for me. Too many assumptions, not clear.

Reply Children
No Data
Related