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

Cannot add custom Service to nRF52820 using softdevice s140

Dear All,

I am trying to add a custom service on the ble_template_app that I have managed to run successfully on the nRF52820.

I have successfully created the custom service I need and I have been able to compile and run my code on an nRF52840.

Unfortunately, I have been unable to do the same for the nRF52820. The code will not even compile, geiving me this error:



I am assuming that there is an issue with the FLASH memory size, but I am not sure how to fix it.

In my project I have this line:



I took this line from the example for the UART application that can be found here.

I am also curious to understand how exactly I need to modify the flash and ram size in case I want to add more services, like the

Parents
  • but I am not sure how to fix it.

    The only real "fix" is to use bigger µC like the NRF52840.

    You can also try setting NRF_LOG_ENABLED to 0 - since those log messages can use quite some flash space.

    Note that your flash configuration won't work with FDS / Peer manager: These need at least 3 free flash pages, and your config has none.

  • This suggestion actually did the trick.

    But now I am quite worried about this. I didn't realise how small the flash memory of this module is and I need to keep track of bonded devices, be able to update the firmware over the air and store some data in the flash. I begins to seem to much for this module

  • Alternatively, you can use a SoftDevice version with a smaller memory footprint, like the S112.

Reply Children

  • Thank you for the suggestion, as this idea also worked, but then I wanted to enable the buttonless DFu and I realised that there some defines missing for the bootloader. Does the device support this functionality or not?

    And another question regarding the nrf52820, does it support ADC? Is it possible to measure an analogue voltage with this device?

  • Giannis Anastasopoulos said:
    Thank you for the suggestion, as this idea also worked, but then I wanted to enable the buttonless DFu and I realised that there some defines missing for the bootloader.

     I'm not that familiar with DFU, I suggest you open a separate Question for that issue.
     

    Giannis Anastasopoulos said:
    And another question regarding the nrf52820, does it support ADC? Is it possible to measure an analogue voltage with this device?

     It does not have and ADC, but it does have a configurable COMP — Comparator, maybe that covers your use-case.