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.

  • Remember that with Eclipse/GCC and the nRF51 SDK, there is no direct connection between the IDE and the build system. To add new header files or paths, you therefore should add them both Eclipse (so that code completion and jumping to definitions and similar work) and to the Makefile itself (so that building works).

    Based on your description, you seem to have done the first, but not the latter. You should therefore add the necessary paths also to your Makefile. It seems that you should be able to set them in C_SOURCE_PATHS and INCLUDEPATHS to make things work.

    Personally, I always tend to check that builds are working from the command line before integrating anything into Eclipse.

  • Thanks Ole. I have included the paths the makefile based on your sample project as follows:

    
    INCLUDEPATHS += -I"../"
    INCLUDEPATHS += -I"$(SDK_PATH)Include"
    INCLUDEPATHS += -I"$(SDK_PATH)Include/app_common"
    INCLUDEPATHS += -I"$(SDK_PATH)Include/ble"
    INCLUDEPATHS += -I"$(SDK_PATH)Include/ble/ble_services"
    INCLUDEPATHS += -I"$(SDK_PATH)Include/ble/softdevice"
    INCLUDEPATHS += -I"$(SDK_PATH)Include/gcc"
    INCLUDEPATHS += -I"$(SDK_PATH)Include/hal"
    INCLUDEPATHS += -I"$(SDK_PATH)Include/modules"
    
    
    
    C_SOURCE_PATHS += ../ $(SDK_SOURCE_PATH) $(TEMPLATE_PATH) $(wildcard $(SDK_SOURCE_PATH)*/)  $(wildcard $(SDK_SOURCE_PATH)app_common/*/) $(wildcard $(SDK_SOURCE_PATH)ble/*/) $(wildcard $(SDK_SOURCE_PATH)ble/ble_services/*/) $(wildcard $(SDK_SOURCE_PATH)ble/softdevice/*/) $(wildcard $(SDK_SOURCE_PATH)gcc/*/) $(wildcard $(SDK_SOURCE_PATH)hal/*/) $(wildcard $(SDK_SOURCE_PATH)modules/*/)
    
    

    But I still have an issue with linking at the moment of compliling:

    
    13:16:11 **** Incremental 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 -mfloat-abi=soft -DDEBUG -g3 -O0 -I"../" -I"../../../../../Include" -I"../../../../../Include/app_common" -I"../../../../../Include/ble" -I"../../../../../Include/ble/ble_services" -I"../../../../../Include/ble/softdevice" -I"../../../../../Include/gcc" -I"../../../../../Include/hal" -I"../../../../../Include/modules" -M ../main.c -MF "_build/main.d" -MT _build/main.o
    "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 -mfloat-abi=soft -DDEBUG -g3 -O0 -I"../" -I"../../../../../Include" -I"../../../../../Include/app_common" -I"../../../../../Include/ble" -I"../../../../../Include/ble/ble_services" -I"../../../../../Include/ble/softdevice" -I"../../../../../Include/gcc" -I"../../../../../Include/hal" -I"../../../../../Include/modules" -c -o _build/main.o ../main.c
    ../main.c: In function 'buffer_init':
    ../main.c:356:14: warning: variable 'err_code' set but not used [-Wunused-but-set-variable]
    ../main.c: In function 'buffer_events':
    ../main.c:446:11: warning: variable 'err_code' set but not used [-Wunused-but-set-variable]
    ../main.c: In function 'modules_init':
    ../main.c:487:26: warning: variable 'err_code' set but not used [-Wunused-but-set-variable]
    "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 -mfloat-abi=soft -DDEBUG -g3 -O0 -I"../" -I"../../../../../Include" -I"../../../../../Include/app_common" -I"../../../../../Include/ble" -I"../../../../../Include/ble/ble_services" -I"../../../../../Include/ble/softdevice" -I"../../../../../Include/gcc" -I"../../../../../Include/hal" -I"../../../../../Include/modules" -M ../../../../..//Source/nrf_delay/nrf_delay.c -MF "_build/nrf_delay.d" -MT _build/nrf_delay.o
    "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 -mfloat-abi=soft -DDEBUG -g3 -O0 -I"../" -I"../../../../../Include" -I"../../../../../Include/app_common" -I"../../../../../Include/ble" -I"../../../../../Include/ble/ble_services" -I"../../../../../Include/ble/softdevice" -I"../../../../../Include/gcc" -I"../../../../../Include/hal" -I"../../../../../Include/modules" -c -o _build/nrf_delay.o ../../../../..//Source/nrf_delay/nrf_delay.c
    "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 -mfloat-abi=soft -DDEBUG -g3 -O0 -I"../" -I"../../../../../Include" -I"../../../../../Include/app_common" -I"../../../../../Include/ble" -I"../../../../../Include/ble/ble_services" -I"../../../../../Include/ble/softdevice" -I"../../../../../Include/gcc" -I"../../../../../Include/hal" -I"../../../../../Include/modules" -M ../../../../..//Source/templates/system_nrf51.c -MF "_build/system_nrf51.d" -MT _build/system_nrf51.o
    "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 -mfloat-abi=soft -DDEBUG -g3 -O0 -I"../" -I"../../../../../Include" -I"../../../../../Include/app_common" -I"../../../../../Include/ble" -I"../../../../../Include/ble/ble_services" -I"../../../../../Include/ble/softdevice" -I"../../../../../Include/gcc" -I"../../../../../Include/hal" -I"../../../../../Include/modules" -c -o _build/system_nrf51.o ../../../../..//Source/templates/system_nrf51.c
    "C:/Program Files (x86)/GNU Tools ARM Embedded/4.7 2013q3/bin/arm-none-eabi-gcc" -x assembler-with-cpp -DDEBUG -g3 -O0 -I"../" -I"../../../../../Include" -I"../../../../../Include/app_common" -I"../../../../../Include/ble" -I"../../../../../Include/ble/ble_services" -I"../../../../../Include/ble/softdevice" -I"../../../../../Include/gcc" -I"../../../../../Include/hal" -I"../../../../../Include/modules" -c -o _build/gcc_startup_nrf51.o ../../../../..//Source//templates/gcc/gcc_startup_nrf51.s
    "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/ble_app_hids_mouse_xxaa.map -mcpu=cortex-m0 -mthumb -mabi=aapcs -L ../../../../..//Source//templates/gcc/ -Tgcc_nrf51_blank_xxaa.ld  _build/main.o _build/nrf_delay.o _build/system_nrf51.o _build/gcc_startup_nrf51.o  -o _build/ble_app_hids_mouse_xxaa.out
    _build/main.o: In function `reset':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:213: undefined reference to `ble_bondmngr_bonded_masters_delete'
    _build/main.o: In function `app_captouch_handler':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:232: undefined reference to `app_captouch_sheduler_callback'
    _build/main.o: In function `app_captouch_event_handler':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:246: undefined reference to `m_keyboard_new_packet'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:255: undefined reference to `m_mouse_new_packet'
    _build/main.o: In function `ble_radio_notification_evt':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:333: undefined reference to `ble_flash_on_radio_active_evt'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:334: undefined reference to `app_captouch_on_radio_active_evt'
    _build/main.o: In function `radio_notification_init':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:346: undefined reference to `ble_radio_notification_init'
    _build/main.o: In function `buffer_init':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:364: undefined reference to `app_timer_create'
    _build/main.o: In function `buffer_send_handler':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:386: undefined reference to `app_timer_stop'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:393: undefined reference to `app_timer_stop'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:403: undefined reference to `m_coms_btle_send'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:423: undefined reference to `m_coms_btle_send'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:436: undefined reference to `app_timer_stop'
    _build/main.o: In function `buffer_events':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:453: undefined reference to `m_coms_btle_advertising_start'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:479: undefined reference to `app_timer_start'
    _build/main.o: In function `modules_init':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:498: undefined reference to `m_coms_btle_init'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:504: undefined reference to `app_captouch_init'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:507: undefined reference to `m_keyboard_init'
    _build/main.o: In function `main':
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:522: undefined reference to `app_sched_init'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:525: undefined reference to `app_timer_init'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:531: undefined reference to `app_captouch_enable'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:533: undefined reference to `app_captouch_start_calibration'
    C:\Keil\ARM\Device\Nordic\captouch-ble\Board\nrf6310\ble\ble_app_hids_mouse\gcc/../main.c:538: undefined reference to `app_sched_execute'
    collect2.exe: error: ld returned 1 exit status
    make: *** [_build/ble_app_hids_mouse_xxaa.out] Error 1
    
    13:16:13 Build Finished (took 2s.708ms)
    
    
    

    Shall I included the sources files for the linker somewhere in the IDE or makefile?

    Thanks

  • Yes, you need to include all the source files that should be part of the build in the project Makefile. Based on the output above, it seems like you have at least forgotten app_timer.c and app_sched.c. Please note that it isn't actually necessary to supply the path for them, just the file name is sufficient, if the source code paths have been set correctly.

Related