high RAM consumption for a BLE app

Hi all!

I have created a simple application that only turns on a led and power it off using BLE in NRF52810. The thing is that simple app uses a huge RAM (~85%) and flash. There is a way to reduce the consumption of RAM? I have seen a post were configuring some parameters to reduce the consumption, I have tried it, but it led to some errors when using BLE.

Best regards

Parents
  • Hi

    For our SoCs that are on the lower end in terms of RAM and Flash memory, it's strongly recommended to build them with the minimal build variant overlay config. You can see how to do so in the "Activating sample extensions" or make your own "minimal" config file based on the prj_minimal.conf file. The projects in NCS should build for the nRF52810 as well with the minimal configs set.

    As CheMax says, the nRF52810 only has 24kB RAM, so there won't be too much left with the Zephyr or SoftDevice controller as well as a BLE application on top, but you can use the Memory Report in our VS Code nRF Connect extension to see what files, etc. is taking up most of your RAM and/or ROM.

    Best regards,

    Simon

  • Hi Sominr,

    I'll have a look at it. So the best way can be use the nrf SDK instead of using zephyr?

    Also for CheMax, I use the project peripheral_lbs and compile for the nrf52dk_nrf52810 without problems but this is the RAM/FLASH consumption of that project:

    [225/225] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:      173960 B       192 KB     88.48%
                SRAM:       24073 B        24 KB     97.95%
            IDT_LIST:          0 GB         2 KB      0.00%

    Best regards

  • You're free to use what controller you'd like or prefer, but the configuration sample extensions are made for the nRF Connect SDK. It should be very similar for a pure Zephyr based project though. 

    Best regards,

    Simon

  • Thanks for the answer Simon.

    I have tried the prj_minimal.conf but I need to use the PWM for my project. I had enabled it adding CONFIG_NRFX_PWM0=y in the prj_minimal.conf but when I want to build, it give me an error:

    error: 'NRFX_PWM0_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_PWM_INSTANCE'?
       62 |     .drv_inst_idx = NRFX_CONCAT_3(NRFX_PWM, id, _INST_IDX), \

    So, How can I solve it? or I need to use the prj.config without minimal?

    Best regards

Reply
  • Thanks for the answer Simon.

    I have tried the prj_minimal.conf but I need to use the PWM for my project. I had enabled it adding CONFIG_NRFX_PWM0=y in the prj_minimal.conf but when I want to build, it give me an error:

    error: 'NRFX_PWM0_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_PWM_INSTANCE'?
       62 |     .drv_inst_idx = NRFX_CONCAT_3(NRFX_PWM, id, _INST_IDX), \

    So, How can I solve it? or I need to use the prj.config without minimal?

    Best regards

Children
No Data
Related