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

softdevice hex overlap other sectors in RTOS

Hello.

I run a project on RTOS base on embOS of Segger. Now I want to add a BLE task base on Nordic BLE peripheral UART. As a standalone project not on RTOS it is run O.K. But when I add it to the RTOS I get a warning it is overlap on other sectors. When I check in the option menu of the SES I found there is a softdevice hex which load into the FLASH and it make the problem. I descase this issue with Segger support and they told me I can write this hex to a dedicate add in the FLASH. But I don't know when it best fit in my project and don't make sectors problem. I also don't know how can I set the BLE to read the hex file from the address I put it on.

If there someone use the BLE UART in RTOS project and face this overlap problem, can help we where address is safe to place it on and which define I need to use to inform the task to read the softdevice hex from that address?

Thanks/

Bar.

Parents
  • Hi,

    The embOS RTOS is provided by Segger, and not officially supported by Nordic, so we in Nordic have little experience with it. The nRF5 SDK officially support FreeRTOS, and you can find examples that uses FreeRTOS in the nRF5 SDK. You might also want to take a look at Zephyr RTOS.

    That said, it might be easier to start with a SES BLE project in the nRF5 SDK, and try to add embOS to that project. Documentation for the SoftDevice Memory resource map and usage can be found here.

  • I was copy the flash placement Macro as was show on the BLE project to my project and add the relevant define in the flash_placment.xml. I look on the MAP and I see that I get a reserve area on start of the FLASH size  0x26000 and start of the RAM size 0x2a98 as written in the Macros .But I don't understand how the SoftDevice know it reserve for him?

    More then that I can make the linking and get run but very quickly it go to no code because the FLASH has some corrupt. It is look the SoftDevice get out of its bondury, or not set on the right place.  

    So the question is the SoftDevice as in FLASH use and RAm know where to be place without any command from me?

  • In the S140 v6.1.1 release notes we have the following:

    Flash: 152 kB (0x26000 bytes).
    RAM: 5.54 kB (0x1628 bytes). This is the minimum required memory. The actual requirements depend on the configuration chosen at sd_ble_enable() time.

    And from the figure here, flash starts at 0x0000000, and RAM at 0x20000000

  • I follow the example use in the BLE UART and place the syntax on start of FLASH segment and RAM segment with the reserve define all in the flash_placment.xml.

    Also add the MACROS in the Linker option 

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x100000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x40000

    FLASH_START=0x26000

    FLASH_SIZE=0xda000

    RAM_START=0x20002a98

    RAM_SIZE=0x3d568

    I also check that the hex file place on start with Segger explanationץ

    But when I start running after some commands I get pull to unknown address and my program starck in a loop. I am thinking it it is because the RAM assignment.

    As I see in my BLE_task.c 

    I set this one

    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&ram_start);

    So I know it place on start of RAM.

    But what about it size.

    I set the RAM for the project start on 0x20002a98 which look enough for RAM.

    But is there any problem could be arize if I use aa RTOS system (specific the Segger embOS)?

    Maybe there modification need to be  done also in thumb_crt0.s also?

    Any clue?

    Bar.

Reply
  • I follow the example use in the BLE UART and place the syntax on start of FLASH segment and RAM segment with the reserve define all in the flash_placment.xml.

    Also add the MACROS in the Linker option 

    FLASH_PH_START=0x0

    FLASH_PH_SIZE=0x100000

    RAM_PH_START=0x20000000

    RAM_PH_SIZE=0x40000

    FLASH_START=0x26000

    FLASH_SIZE=0xda000

    RAM_START=0x20002a98

    RAM_SIZE=0x3d568

    I also check that the hex file place on start with Segger explanationץ

    But when I start running after some commands I get pull to unknown address and my program starck in a loop. I am thinking it it is because the RAM assignment.

    As I see in my BLE_task.c 

    I set this one

    // Fetch the start address of the application RAM.
    uint32_t ram_start = 0;
    err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
    APP_ERROR_CHECK(err_code);

    // Enable BLE stack.
    err_code = nrf_sdh_ble_enable(&ram_start);

    So I know it place on start of RAM.

    But what about it size.

    I set the RAM for the project start on 0x20002a98 which look enough for RAM.

    But is there any problem could be arize if I use aa RTOS system (specific the Segger embOS)?

    Maybe there modification need to be  done also in thumb_crt0.s also?

    Any clue?

    Bar.

Children
  • Bar said:
    I get pull to unknown address and my program starck in a loop.

     If you call e.g. sd_app_evt_wait() it will call __WFE() inside the SoftDevice.

    Bar said:
    But is there any problem could be arize if I use aa RTOS system (specific the Segger embOS)?

    The SoftDevice uses the peripherals listed hereMake sure that your application and/or embOS does not use them. 

    Also note that the systick is sourced by the same clock as the CPU, which is turned off when going to WFE/WFI (sd_app_evt_wait()). It is therefore not recommended to use systick, but RTC or TIMER instead. It could be that embOS uses systick.

Related