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

Segger Embedded Studio not linking nRF51 SDK examples

Hello, 

I tried to build the SDK ble_app_beacon example for nRF51 using SES. SES version I used is V4.12 (for Windows 64 bit) and SDK version is 12.3.0.

I closely followed the instructions reported in this tutorial. Since SES and SDK versions are different than reported in the tutorial and since I'm targeting nRF51-DK board (as opposed to the nRF52 board used in the tutorial), I applied the following minor (?) changes:

  • I imported the file C:\Nordic\nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_beacon\pca10028\s130\arm5_no_packs\ble_app_beacon_pca10028_s130.uvprojx
  • I included the files system_nfr51.c and 3324.ses_nrf51_startup.s into the "Internal Files" folder of Project Explorer. Initially I replaced the existing file SEGGER_THUMB_Startup.s  with the file thumb_crt0.s (modified as described in the tutorial). Since however I was getting many linking errors (indicating that most of the symbols used in thumb_crt0.s were undefined), I ended up removing  thumb_crt0.s and keeping SEGGER_THUMB_Startup.s (as indicated in the below screenshot).
  • In order to get rid of a compile error "cannot open source input file core_cm0.h", I also included the following directory within the Preprocessor user's includes: ../../../../../../components/toolchain/cmsis/include.
  • I managed to load the flash_placement.xml file, corrected also to include the following additional line: <ProgramSection alignment="4" load="Yes" name=".fs_data" />

My Project Explorer looks like this:

After building, I obtain the following errors: undefined symbols __SRAM_segment_end__ and __data_start__

Can you please help me to figure out how to solve the problem?

Thank you very much!

Parents
  • I made some progress: now it builds and loads into the board. As the program executes, however, it gets stuck as the SoftDevice is called. The error message is: "Stopped by vector catch".

    In addition/differently than explained in my first post, the settings with which I obtained this result are the following:

    - Project-->Options-->LInker -->Linker set to GNU.

    - In the project folder "Internal files" I deleted the file SEGGER_THUMB_Startup.s and replaced it with thumb_crt0.s (available in the "source" folder of the Segger installation directory and modified as indicated in the Nordic tutorial).

    - Project-->Options-->Build-->Memory Map Macros set to: FLASH_START=0x1B000;SRAM_START=0x20002000   (NOTE: Pay attention to the S of SRAM)

    - Project-->Options-->Build-->Memory Segments set to: FLASH RX 0x0001B000 0x00040000; SRAM RWX 0x20002000 0x00004000  (NOTE: Pay attention to the S of SRAM)

    NOTE: 0x1B000 is the APP_CODE_BASE address for the soft device S130 2.0.1 used by the SDK 12.3.0.

    With the above settings, the ble_app_beacon example compiles and loads but, as indicated above, the program execution gets stuck as soon as the SoftDevice is called. No clue why.

    ---------

    Since Nordic obviously does not support nRF51 with SES, Nordic should clearly indicate it and avoid that their customers waste hours of works figuring out obscure configuration issues.

  • Hi: I faced exactly the same issues with SES and nRF51 DK. The question is, what is the best tool to develop with nRF51? I must develop a product using nRF51822 and I am unable to start the project because I can't find any suitable tool. Any help?

  • You could use Keil, IAR or gcc. Keil has a code size limit, but if you are able to stay underneath that code size limit, it can be used for free.

    You could use eclipse with gcc, but I've heard of some customers that have had quite a few issues with Eclipse too (just look at the comments section under the blog post).

    Another solution (although maybe not doable for you) would be to use a 52810 or 52832 device. That way, SES support is included out of the box when you use a newer SDK version >= v14.1.

    Also, I believe the solution could be wrong section placement macros in SES. The settings for ROM & RAM in Keil for the ble_app_beacon ble_peripheral example in sdk 12.3 are the following:

    Could you try setting the section placement macros in SES to the following values (Right click on Project -> Edit Options -> change to Common Configuration -> Linker tab -> double click on Section Placement macros):

    FLASH_START=0x1B000

    FLASH_SIZE=0x25000

    RAM_START=0x20001870

    RAM_SIZE=0x6790

Reply
  • You could use Keil, IAR or gcc. Keil has a code size limit, but if you are able to stay underneath that code size limit, it can be used for free.

    You could use eclipse with gcc, but I've heard of some customers that have had quite a few issues with Eclipse too (just look at the comments section under the blog post).

    Another solution (although maybe not doable for you) would be to use a 52810 or 52832 device. That way, SES support is included out of the box when you use a newer SDK version >= v14.1.

    Also, I believe the solution could be wrong section placement macros in SES. The settings for ROM & RAM in Keil for the ble_app_beacon ble_peripheral example in sdk 12.3 are the following:

    Could you try setting the section placement macros in SES to the following values (Right click on Project -> Edit Options -> change to Common Configuration -> Linker tab -> double click on Section Placement macros):

    FLASH_START=0x1B000

    FLASH_SIZE=0x25000

    RAM_START=0x20001870

    RAM_SIZE=0x6790

Children
No Data
Related