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

SEGGER + nRF51 = no SDK?

Hi,

New to Nordic, new to SEGGER, and new to ARM, so forgive me if I'm just missing something...

I've been asked to write new code for some boards that have the nRF51822 chip on them. The board needs to act like a BLE peripheral.

Since Nordic seems to work closely with SEGGER, I figured SEGGER Embedded Studio (SES) would be the best tool to use.  I've downloaded and installed it, and my J-LINK programmer should be here tomorrow. I'm trying to get the correct SDK to use with it.  I figured the latest nRF5 SDK (16.0.0) would be the right thing to use.  But...

It appears to me that I need to use Softdevice S110 or S130, but it looks like Nordic dropped support for S130 after SDK 12.3.0, after dropping the S110 sometime earlier.  So I downloaded 12.3.0 and tried to open an example.  But there are no SES examples in 12.3.0 like there are in 16.0.0.  The SES examples in later SDKs don't support S130.

Can someone suggest the right combination of Softdevice, SDK, and (hopefully free) IDE to use for nFR51 BLE peripheral development?

Thanks.

Parents
  • Hi Don, 

    You can have a look here: https://devzone.nordicsemi.com/f/nordic-q-a/30945/is-there-a-tutorial-about-using-segger-embedded-studio-with-sdk-12-3-0-and-nrf51822

    Another customer reported that he followed the tutorial and it worked for him. 

    Note that for new design, we suggest to use nRF52 series. 

  • Hi Hung Bui,

    Thanks for the information.  I got through the process today, and it compiles, but I get two errors in the linker.  There are two undefined symbols, __SRAM_segment_end__ and __data_start__.

    I can't figure out where these are supposed to be defined, and I can only guess at how they should be defined.

    The first symbol is used in 3324.ses_nrf51_startup.s, and the second is used near the end of softdevice_handler.c.  They don't seem to be defined within the SDK.

    Any idea what I should do with these?

    Is it possible that it would be easier to start from a nRF52 example in SDK 16.0.0 and work backward to nRF51?

    I can't really change chips because the boards are sitting on my desk waiting to be programmed.

    Thanks for your help.

  • Hi Don, 

    For the __SRAM_segment_end__ you can have a look here: 

    https://devzone.nordicsemi.com/f/nordic-q-a/22640/ses-sdk12-2-0-undefined-reference-to-__sram_segment_end__

    For the __data_start__ have you made sure you included thumb_crt0.s located C:\Program Files\SEGGER\SEGGER Embedded Studio for ARM 4.18\source ? into the project ? 

    I saw here a similar case, not sure you will have to implement all what the customer had to do though. 

  • Hi Hung Bui,

    The link suggests changing the memory map file or the memory section definitions to change RAM to SRAM.  Since the project does not have a memory map file, I went to the memory sections definition and changed 

    FLASH1 RX 0x00000000 0x00040000;RAM1 RWX 0x20000000 0x00008000

    to

    FLASH1 RX 0x00000000 0x00040000;SRAM RWX 0x20000000 0x00008000

    This caused an undefined symbol error for RAM1.  So instead I edited file 3324.ses_nrf51_startup.s and changed 

    ldr r0, =__SRAM_segment_end__

    to

    ldr r0, =__RAM1_segment_end__

    This resolved the __SRAM_segment_end__ issue.

    For __data_start__, adding thumb_crt0.s to the project does not resolve the issue because this file tries to use that symbol, but does not define it.  It also causes a multiple definition of _start.

    I found the definition of __data_start__ in the [sdk]/components/toolchain/gcc/nrf5x_common.ld file, and it's the beginning of RAM used by the linker.  Below is a snippet of that file:

    __etext = .;

    .data : AT (__etext)
    {
    __data_start__ = .;
    *(vtable)
    *(.data*)

    . = ALIGN(4);
    /* preinit data */
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP(*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);

    . = ALIGN(4);
    /* init data */
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP(*(SORT(.init_array.*)))
    KEEP(*(.init_array))
    PROVIDE_HIDDEN (__init_array_end = .);


    . = ALIGN(4);
    /* finit data */
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP(*(SORT(.fini_array.*)))
    KEEP(*(.fini_array))
    PROVIDE_HIDDEN (__fini_array_end = .);

    KEEP(*(.jcr*))
    . = ALIGN(4);
    /* All data end */
    __data_end__ = .;

    } > RAM

      Is there an equivalent way to do this in SES?  I would guess it goes in the SEGGER_Flash.icf file.

Reply
  • Hi Hung Bui,

    The link suggests changing the memory map file or the memory section definitions to change RAM to SRAM.  Since the project does not have a memory map file, I went to the memory sections definition and changed 

    FLASH1 RX 0x00000000 0x00040000;RAM1 RWX 0x20000000 0x00008000

    to

    FLASH1 RX 0x00000000 0x00040000;SRAM RWX 0x20000000 0x00008000

    This caused an undefined symbol error for RAM1.  So instead I edited file 3324.ses_nrf51_startup.s and changed 

    ldr r0, =__SRAM_segment_end__

    to

    ldr r0, =__RAM1_segment_end__

    This resolved the __SRAM_segment_end__ issue.

    For __data_start__, adding thumb_crt0.s to the project does not resolve the issue because this file tries to use that symbol, but does not define it.  It also causes a multiple definition of _start.

    I found the definition of __data_start__ in the [sdk]/components/toolchain/gcc/nrf5x_common.ld file, and it's the beginning of RAM used by the linker.  Below is a snippet of that file:

    __etext = .;

    .data : AT (__etext)
    {
    __data_start__ = .;
    *(vtable)
    *(.data*)

    . = ALIGN(4);
    /* preinit data */
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP(*(.preinit_array))
    PROVIDE_HIDDEN (__preinit_array_end = .);

    . = ALIGN(4);
    /* init data */
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP(*(SORT(.init_array.*)))
    KEEP(*(.init_array))
    PROVIDE_HIDDEN (__init_array_end = .);


    . = ALIGN(4);
    /* finit data */
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP(*(SORT(.fini_array.*)))
    KEEP(*(.fini_array))
    PROVIDE_HIDDEN (__fini_array_end = .);

    KEEP(*(.jcr*))
    . = ALIGN(4);
    /* All data end */
    __data_end__ = .;

    } > RAM

      Is there an equivalent way to do this in SES?  I would guess it goes in the SEGGER_Flash.icf file.

Children
Related