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

Migration nRF51822 -> nRF52832

Hi,

I have an old project running on nRF51822, with SoftDevice SDK v8 - S110 mode. I'm trying to migrate the project to a nRF52832 with SoftDevice SDV v12 - S132 v3 mode.

I'm working with Segger Embedded Studio v3.10e

The device is a peripheral who runs some custom BLE services to transfer data.

I'm trying to code once again all my services using the ble_app_template included in the SDK.

I imported my former services, all is fine.

I swapped device_manager for peer_manager. Unfortunately, during pm_init(), I got an error. More precisely, it happens in pds_init() in peer_data_storage.c, when calling fds_init() I got a NRF_ERROR_NO_MEM error.

I commented the block with pm_init(). Now, my project is running, and the device is advertising.

Here is the corresponding screenshot from LightBlue.

image description

So... I can connect to my device and services appeared in the advertised data ; but I can not see them in details (see the characteristics, read/write them). Of course, with the nRF51822 version, everything works.

Do you know how to solve this? Does the problem come from the fact I can not initialize peer manager? Or is it something with the custom services (something to migrate?)? Maybe something else?

Parents
  • As stated, here is how the aforementioned issues were solved.

    Configuration : Hardware : PCA10040 Software : Segger Embedded Studio IDE using SoftDevice S132 v3 (Nordic’s SDK v12)

    Migration from a PCA10001 to a 10040 (hardware), from SoftDevice S110 (Nordic’s SDK v7) to SoftDevice S132 v3 (Nordic’s SDK v12)

    1/ Peer Manager

    The main issue were about the migration from device manger to the new peer manager. Following Segger Embedded Studio tutorial in Nordic’s blog almost worked for me (devzone.nordicsemi.com/.../).

    Tutorial is made for ble_app_beacon example. This example does not require peer manager. So everything works fine.

    When adding peer manager some adjustments have to be made so the project can compile and run without any problem.

    First adjustement: Memory settings. With SDK v12, the accurate configuration is the following:

    FLASH_START=0x1F000
    FLASH_SIZE=0x61000
    SRAM_START=0x20002128
    SRAM_SIZE=0xDED8
    

    Second adjustment: Section To make project compile and run without memory problem, just follow RK’s advice (devzone.nordicsemi.com/.../)

    flash_placement.xml has to be changed:

    <MemorySegment name="$(FLASH_NAME:FLASH)">
    ....
        <ProgramSection alignment="4" load="Yes" runin=".fs_data_run" name=".fs_data" />
    </MemorySegment>
    
    <MemorySegment name="$(RAM_NAME:RAM);SRAM">
    ....
        <ProgramSection alignment="4" load="No" name=".fs_data_run" address_symbol="__start_fs_data"  end_symbol="__stop_fs_data" />
    </MemorySegment>
    

    Same for thumb_crt0.s

    ldr r2, =__tdata_end__
    bl memory_copy
    # ADD HERE ... 
    ldr r0, =__fs_data_load_start__
    ldr r1, =__fs_data_start__
    ldr r2, =__fs_data_end__
    bl memory_copy
    # TO HERE ...
    

    At this point, the projet compiles and runs through Segger Embedded Studio!

    2/ BLE Services

    Some minor changes from SDK v7 to SDK v12 were made, inspired by Glucose-meter example (ble_app_gls). I recommend to have a deep look inside this example to write new services. No big changes, everything is pretty clear.

Reply
  • As stated, here is how the aforementioned issues were solved.

    Configuration : Hardware : PCA10040 Software : Segger Embedded Studio IDE using SoftDevice S132 v3 (Nordic’s SDK v12)

    Migration from a PCA10001 to a 10040 (hardware), from SoftDevice S110 (Nordic’s SDK v7) to SoftDevice S132 v3 (Nordic’s SDK v12)

    1/ Peer Manager

    The main issue were about the migration from device manger to the new peer manager. Following Segger Embedded Studio tutorial in Nordic’s blog almost worked for me (devzone.nordicsemi.com/.../).

    Tutorial is made for ble_app_beacon example. This example does not require peer manager. So everything works fine.

    When adding peer manager some adjustments have to be made so the project can compile and run without any problem.

    First adjustement: Memory settings. With SDK v12, the accurate configuration is the following:

    FLASH_START=0x1F000
    FLASH_SIZE=0x61000
    SRAM_START=0x20002128
    SRAM_SIZE=0xDED8
    

    Second adjustment: Section To make project compile and run without memory problem, just follow RK’s advice (devzone.nordicsemi.com/.../)

    flash_placement.xml has to be changed:

    <MemorySegment name="$(FLASH_NAME:FLASH)">
    ....
        <ProgramSection alignment="4" load="Yes" runin=".fs_data_run" name=".fs_data" />
    </MemorySegment>
    
    <MemorySegment name="$(RAM_NAME:RAM);SRAM">
    ....
        <ProgramSection alignment="4" load="No" name=".fs_data_run" address_symbol="__start_fs_data"  end_symbol="__stop_fs_data" />
    </MemorySegment>
    

    Same for thumb_crt0.s

    ldr r2, =__tdata_end__
    bl memory_copy
    # ADD HERE ... 
    ldr r0, =__fs_data_load_start__
    ldr r1, =__fs_data_start__
    ldr r2, =__fs_data_end__
    bl memory_copy
    # TO HERE ...
    

    At this point, the projet compiles and runs through Segger Embedded Studio!

    2/ BLE Services

    Some minor changes from SDK v7 to SDK v12 were made, inspired by Glucose-meter example (ble_app_gls). I recommend to have a deep look inside this example to write new services. No big changes, everything is pretty clear.

Children
No Data
Related