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

Working Workspace for nAN-29 v1.1

I am trying to use Eclipse+GCC for my projects. I found a similar issue as stated in the following post:

devzone.nordicsemi.com/.../nan-29-nrf51-sdk-no-project-files

I have downloaded the blinky_example, but my workspace did not have the common makefiles included in the last line of the blinky_example makefiles in the folder:

include $(SDK_PATH)Source/templates/gcc/Makefile.common

Then I found this files in an old release backup and copied them but at the time of building I found the following error


17:18:23 **** Incremental Build of configuration Default for project blinkyEclipse ****
make all 
"C:/Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q3/bin/arm-none-eabi-gcc" -L"C:/Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q3/arm-none-eabi/lib/armv6-m" -L"C:/Program Files (x86)\GNU Tools ARM Embedded\4.7 2013q3/lib/gcc/arm-none-eabi/4.7.4/armv6-m" -Xlinker -Map=_build/blinky_gcc.map -mcpu=cortex-m0 -mthumb -mabi=aapcs -L ../../../../Source//templates/gcc/ -Tgcc_nrf51_blank.ld _build/main.o _build/nrf_delay.o _build/system_nrf51.o _build/gcc_startup_nrf51.o -o _build/blinky_gcc.out
c:/program files (x86)/gnu tools arm embedded/4.7 2013q3/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld.exe: cannot find -lcs3
c:/program files (x86)/gnu tools arm embedded/4.7 2013q3/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld.exe: cannot find -lcs3unhosted
collect2.exe: error: ld returned 1 exit status
make: *** [_build/blinky_gcc.out] Error 1

17:18:24 Build Finished (took 947ms)

lcs3unhosted and lcs3 libraries are missing. I suppose this is because these common makfiles are using Sourcery CodeBench package(nAN-29 v1.0) and not GNU Tools for ARM Embedded Processors package(nAN-29 v1.1). I have not found in the last SDKs or in the Nordic website a workspace to work with the nAN-29 v1.1 or at least the common makefiles. It would be great if someone from Nordic can shed some light into this issue and upload the right workspace/files.

Thanks.

  • If you use the SDK installer you must choose "Custom installation location" to get the GCC files. You can also take a look at the separate zip of the SDK, which includes those files.

    You're quite right that the cs3-errors come from mixing old and new makefiles and linker scripts, so if you get the latest ones, you should be good to go! :-)

  • By the way, you may also want to have a look at this question, and the alternative set of Makefiles suggested there: https://devzone.nordicsemi.com/index.php/is-it-possible-to-flash-s110-from-linux-or-os-x https://github.com/hlnd/nrf51-pure-gcc-setup These are the Makefiles and linker scripts I use for my personal pet projects.

  • Thanks Ole for your reply!. Very useful. It was the first step of the first section :o . Well, I manage to compile your example project blinky_example. But I have found a problem while setting up the debugging tool. From the nAN-29 v1.1, in the section 2 step 7 it says: 'Set the Build configuration to Debug.' But I cannot see the this option in the drop down menu. I have attached an image of the issue.

    GCC_Debugging.jpg

  • This Debug configuration is project specific, so you'll only see that if you import the ble_app_hrs project, as given in the nAN-29. We don't provide a ready-made project for blinky, so if you want to have a Debug build configuration, you must create this yourself. This can be done from Project -> Build configuration -> Manage menu.

    However, you can also choose to just use the Default one. The functionality of this is that you can for example make sure that things are compiled with debug symbols when debugging, but without when just pressing the build button or similar.

  • Great Ole. Thanks again. Almost there. I've got everything (compiling, debugging, flashing, embSys,...) working fine with your project. Now I am trying to port my own project and I found the following error:

    17:42:09 **** Build of configuration Default for project ble_app_hids_mouse ****
    make all 
    rm -rf _build
    mkdir _build
    "C:/Program Files (x86)/GNU Tools ARM Embedded/4.7 2013q3//bin/arm-none-eabi-gcc" -mcpu=cortex-m0 -mthumb -mabi=aapcs -DNRF51 -DBOARD_NRF6310 -DNRF51822_QFAA_CA --std=gnu99 -Wall -Werror -mfloat-abi=soft -DDEBUG -g3 -O0 -I"../" -I"../../../../../Include" -I"../../../../../Include/gcc" -I"../../../../../Include/ext_sensors" -M ../main.c -MF "_build/main.d" -MT _build/main.o
    ../main.c:37:26: fatal error: app_captouch.h: No such file or directory
    compilation terminated.
    make: *** [_build/main.o] Error 1
    
    17:42:09 Build Finished (took 407ms)
    
    
    

    I have followed your advice from a previous post:

    • In tab C/C++ Build the build directory should point to gcc folder, if the project name is blinkyEclipse the build directory should be: ${workspace_loc:/blinkyEclipse}/gcc
    • in tab C/C++ General -> Path and Symbols -> GNU C : include directories should be added.

    My headers seems to be in the includes menu of the project. You can see it in the attached image. What do you think it may be going on?

    GCC_Includes.jpg

Related