nRF52811 w/ soft device s140

Hi there. In order to up to 20 concurrent onnections to the device, it was necessary for us to switch from the s112 to the s140. 

I believe I am messing up the flash placement of this and am not understanding the guides so well.

I was able to discern correctly;

FLASH_PH_START=0x0

FLASH_PH_SIZE=0x30000

RAM_PH_START=0x20000000

RAM_PH_SIZE=0x6000

FLASH_START=0x27000

but the last three I didn't understand how to sort those out.

Not sure if this is related but when I tried to build the project the following error was displayed;

#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"

Using sdk 17.0.0.2 with SES.

Thanks in advance for any assistance.

  • Hi 

    There is some information here regarding setting the right memory settings when using a SoftDevice. Essentially you have to run the code with your desired configuration, and logging enabled, and you will get a message to the log with instructions what the RAM configuration should be. 

    Unfortunately I don't think you will be able to support 20 concurrent connections in the nRF52811. When running multiple connections the RAM usage of the SoftDevice will increase considerably, and the nRF52811 has quite limited RAM available compared to the larger devices in the nRF52 family. Typically you would need something like the nRF52832 or the nRF52833 in order to run applications where you need a large number of links. 

    Not sure if this is related but when I tried to build the project the following error was displayed;

    #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"

    It is odd that changing the SoftDevice alone would introduce this error. Are you sure that there aren't some other configuration changes in the project that could have caused this? 

    Best regards
    Torbjørn

  • Okay good to know about the 20 connections. Would it at least expand it from 4 (s112) to a few more? 6-8 connections? Your best guess?

    As for the FPU, the project was using dependencies for the nrf52810 and I was attempting to switch over those at the same time.
    I likely missed a few spots where this needed to be updated, here's a list of locations I did update it;

    Project Options (Common)->Debugger->Target Device = nRF52811_xxAA

    Project Options (Common)->Debugger->Register Definition File = modules/nrfx/mdk/nrf52811.svd

    these .s/.c files were changes in the project files;

    Project Options (Common)->Preprocessor->Preprocessor Definitions =

    APP_TIMER_V2
    APP_TIMER_V2_RTC1_ENABLED
    BOARD_PCA10056
    CONFIG_GPIO_AS_PINRESET
    FLOAT_ABI_HARD
    INITIALIZE_USER_SECTIONS
    NO_VTOR_CONFIG
    NRF52811_XXAA
    NRF_SD_BLE_API_VERSION=7
    S140
    SOFTDEVICE_PRESENT
    CUSTOM_BOARD

    Thanks Torbjørn!

  • Hi Kevin

    Okay good to know about the 20 connections. Would it at least expand it from 4 (s112) to a few more? 6-8 connections? Your best guess?

    It's impossible to give an accurate answer to that without knowing how much memory you need for your application, but I expect anything above 4 is going to be a challenge. 

    To test this you can try to build one of the standard Bluetooth samples, and experiment with the SoftDevice configuration in sdk_config.h. 

    I tested this myself based on the ble_app_uart sample, building the one targeting the pca10056 and the S140 SoftDevice. 

    When increasing the number of peripheral and total links to 8 I can see in the debugger that the new RAM start location should be 0x20004990, which means the SoftDevice RAM consumption alone is 18.8kB (0x4990 converted to decimal):

    I set the data length and max MTU to minimum values to reduce RAM consumption somewhat. You could also try to use smaller values for the GAP_EVENT_LENGTH parameter, such as 2 or 3. 

    For clarity, do you want 20 links in peripheral or central role? 

    The S112 to my knowledge only support 4 peripheral connections, but when you need multiple links it is typically central links that are required. 

    Best regards
    Torbjørn

  • Tried the settings your terminal suggested;

    And got this;

    Hmm I take it's too big then?

    by the way, I am not sure how to get that terminal logging. Is it because I have NRF_SDH_BLE_LOG_ENABLED 0

    Correct we want more peripheral links. This device will be connected to (and "controlled") by several phones/tablets. It has low data throughput (no audio, no video). Mainly just notify's the client (central) that it is on/off and some other simple stuff.

    As far as project complexity, I believe the MCU use is fairly basic; Just twi, ble, gpio and interrupts, timers.


    Still also having it throw an error for FPU;
    Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT) 

    what file was this supposed to be defined in?

    Thanks,

    Kevin

  • Hi Kevin

    The RAM_SIZE parameter is surely not correct. The available RAM size equals the total ram size (RAM_PH_SIZE = 0x6000) - 0x4990, which only leaves 0x1670 for the application (or 5.7kB). 

    I went through the exercise of updating the ble_app_uart example with project files for the pca10056e board running on the S140 SoftDevice, and I have attached it below:

    317960_ble_app_uart.zip

    Could you take a look at the project in the \317960_ble_app_uart\pca10056e\s140\ses folder and see if you can use it for reference? 

    I tried with both 8 and 6 peripherals, but in either case I was not left with enough RAM for the ble_app_uart application libraries. I left it at 4 which seemed to work fine, and I was able to run the application. 

    I guess you need to enable more than 4 links in order to justify the move to the S140, but I am not sure how much more is practically achievable.

    Best regards
    Torbjørn

Related