Bluetooth long range (coded PHY) on nrf52811 using nRF connect SDK - Provided examples use too much SRAM

Hi,

I have my programming environment set up to use the nRF Connect SDK through VS Code, as the most recent documentation suggests. I can successfully build and flash code onto my nRF52840-DK (PCA10056). My goal at the moment is to do a simple proof-of-concept of the coded PHY feature on the nRF52811 SoC to test the practical range. I wanted to use the "central_hr_coded" example and the "peripheral_hr_coded" example to do this. The problem is that when I set the build configuration to nrf52840dk_nrf52811 to simulate the 811, I get the following error:

c:/nordicsemi/v1.9.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: zephyr\zephyr_pre0.elf section `noinit' will not fit in region `SRAM'
c:/nordicsemi/v1.9.0/toolchain/opt/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: region `SRAM' overflowed by 909 bytes

This is for the peripheral example. For the central example, the SRAM overflows by 6107 bytes. As far as I can tell, these examples contain almost nothing, they just simulate a simple heart-rate monitor and battery monitoring. 

So my question is this: Is there a quick and dirty way to test the coded phy on the nRF52811 through VS Code with the nRF Connect SDK that will actually fit in the nRF52811 SRAM constraints? Since I'm just testing the range, I was hoping to avoid writing complicated/custom code at this stage.

You help is much appreciated, cheers!

Parents
  • Hi Felix, 

    You can squeeze the RAM usage to fit inside the nRF52811 by removing log, debug information and reduce the size of the stacks. Please have a look at the prj_minimal.conf we have inside peripheral_lbs example. 

    Make sure you don't set CONFIG_BT_PHY_UPDATE=n .

    I attached the file that worked for me. After compilation it's showed 16308 Bytes needed for RAM. 

    0513.prj.conf

    The most important config that reduce most of the RAM are: 

    CONFIG_BT_DEBUG_NONE=y

    # Example output of thread analyzer
    # SDC RX : unused 816 usage 208 / 1024 (20 %)
    # BT RX : unused 1784 usage 416 / 2200 (18 %)
    # BT TX : unused 992 usage 544 / 1536 (35 %)
    # thread_analyzer : unused 136 usage 376 / 512 (73 %)
    # sysworkq : unused 1824 usage 224 / 2048 (10 %)
    # MPSL signal : unused 520 usage 504 / 1024 (49 %)
    # idle 00 : unused 192 usage 64 / 256 (25 %)
    # main : unused 136 usage 888 / 1024 (86 %)
    # Configurations set based on thread analyzer output.
    CONFIG_BT_CTLR_SDC_RX_STACK_SIZE=324
    CONFIG_BT_RX_STACK_SIZE=1024
    CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
    CONFIG_BT_HCI_TX_STACK_SIZE=640
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=256
    CONFIG_MPSL_SIGNAL_STACK_SIZE=640
    CONFIG_MAIN_STACK_SIZE=1024
    CONFIG_IDLE_STACK_SIZE=128
    CONFIG_ISR_STACK_SIZE=1024

    Note that you may need to run thread analyze for your own application. The number here are from the periphreal_lbs it may not the same for your application. 

     

Reply
  • Hi Felix, 

    You can squeeze the RAM usage to fit inside the nRF52811 by removing log, debug information and reduce the size of the stacks. Please have a look at the prj_minimal.conf we have inside peripheral_lbs example. 

    Make sure you don't set CONFIG_BT_PHY_UPDATE=n .

    I attached the file that worked for me. After compilation it's showed 16308 Bytes needed for RAM. 

    0513.prj.conf

    The most important config that reduce most of the RAM are: 

    CONFIG_BT_DEBUG_NONE=y

    # Example output of thread analyzer
    # SDC RX : unused 816 usage 208 / 1024 (20 %)
    # BT RX : unused 1784 usage 416 / 2200 (18 %)
    # BT TX : unused 992 usage 544 / 1536 (35 %)
    # thread_analyzer : unused 136 usage 376 / 512 (73 %)
    # sysworkq : unused 1824 usage 224 / 2048 (10 %)
    # MPSL signal : unused 520 usage 504 / 1024 (49 %)
    # idle 00 : unused 192 usage 64 / 256 (25 %)
    # main : unused 136 usage 888 / 1024 (86 %)
    # Configurations set based on thread analyzer output.
    CONFIG_BT_CTLR_SDC_RX_STACK_SIZE=324
    CONFIG_BT_RX_STACK_SIZE=1024
    CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y
    CONFIG_BT_HCI_TX_STACK_SIZE=640
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=256
    CONFIG_MPSL_SIGNAL_STACK_SIZE=640
    CONFIG_MAIN_STACK_SIZE=1024
    CONFIG_IDLE_STACK_SIZE=128
    CONFIG_ISR_STACK_SIZE=1024

    Note that you may need to run thread analyze for your own application. The number here are from the periphreal_lbs it may not the same for your application. 

     

Children
No Data
Related