Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Regarding memory footprint of nRF52805 microcontroller.

Hi All,

We are in the almost finishing phase of our application development, and running out of flash memory space, all details are listed below.

MCU  : nRF52805 (192 +24 Kb)
SDK   : nRF5 SDK 17.1.0
SoftDevice :S112 v7.2.0 (Occupies 100 Kb)
IDE    : Segger Embedded Studio.

Features need to implement:
     1. BLE 5.0 Compatibility with PHY Speed At least 1Mbps.
     2. GPIO(BSP),Advertising Modules, Timers, Queue Modules, Random number Generator, UART, Power Management and some common Library e.g. string manipulation etc.
     3. Pairing and bonding using LESC using OOB(AES 128 bit encryption), We don't have any I/O Capabilities.
     4. Serial UART Bootloader not DFU (Another Host Microcontroller will responsible for firmware update with single Firmware bank consideration).
     5. Three custom services having 18 custom characteristics implementation(as of my knowledge it takes extra memory).All services will be encrypted by AES 128 bit.
     6. Required around 25- 30 Kb memory space for application code.

Queries :
     1. What will be the expected memory footprint to implement above features.
     2. Can We fit above features in nRF52805 as it has lower memory footprint.
     3. Suggest some optimized AES 128 bit library that will be best suited for us.
     4. Currently, we are using nRF5 SDK, which will be best suited for my application nRF Connect SDK or nRF5 SDK. (Memory Point of View)

As, We Implemented almost every features except Crypto encryption & some application code remaining for implementation.
Now, we are running short of memory space. We want to know the actual scenario of memory foot print needed for
above required application features. Please Suggest us, how to fit application within nRF52805 flash memory area.

Parents
  • So you have 192kB flash. The softdevice takes ~100kB, the bootloader takes ~30kB.

    In general, the nRF52805 (and nRF52810 and nRF52811) are quite limited on flash. You just need to try to compile your application, and see if it fits inside the nRF. For crypto you should use the micro-ecc library. 

    Please note that you can't update the softdevice. 

    Comparing to the nRF52810 sample ble_app_hrs, it takes ~83kB, so if you add the softdevice, you will not have room for the bootloader. 

    I am afraid that you need to consider moving to a larger chip. 

    I guess, if you develop your application on a larger chip (nRF52833 DK or larger), you can see how much space you actually need when you are done with your appilcation.

    Best regards,

    Edvin

  • thanks for reply Edvin.

    Actually, we are in Pre-Production stage and hardware components and its design files are verified and tested for different environments, and changing hardware is not feasible for us. so, could you please suggest us, How much memory footprints will be added individually in addition of above mention module. so, that we can omit some of un-necessary  module to get our basic implementation done with in same memory footprint. 

  • I see. So using the serial bootloader from the nRF5 SDK, that takes the flash from 0x28000 and up. The softdevice (incl. MBR) takes from 0x00000000 -> 0x18FFF, this leaves 0x19000 -> 0x27FFF for your application (= 0xF000).

    It is difficult to say how much flash the crypto libraries will take, because they are not precompiled binaries, and hence not a fixed size for the flash requirement. It depends on what you use from the libraries. But the bootloader uses the micro-ecc cypto backend, and this is the smallest footprint that you can use on the nRF52805. At least without changing HW. 

    So basically, if you enable the micro-ecc backend in sdk_config.h (like it is done in the examples\dfu\secure_bootloader\pca10040e_uart, then you need to see how much flash your application requires. 

    If your application needs to use the peer manager, then it requires at least 2 (default is typically set to 3) FDS pages for flash storage. This means that the pages:

    0x27000 ->0x27FFF

    0x26000 ->0x26FFF

    will be used for FDS data (by the peer manager and your application). This leaves you 0x19000 -> 0x25FFF = 52kB for the pure application (without counting the FDS pages). 

    Best regards,

    Edvin

  • thanks for clarification Edvin.

    My application code is almost finished except LESC & serial custom bootloader(that can consume less memory footprint) implementation, it takes ~142 Kb flash and ~18 Kb.So, Is it possible to fit LESC and bootloader implementation in the remaining memory footprint.

    Also, Could you please suggest some bootloader code for reference, which takes less memory footprint and having capability of firmware updation using UART interface with some other Host MCU.

  • Is it possible to fit LESC and bootloader implementation in the remaining memory footprint.

    You need to add it and see what you end up with. I have no idea how much that takes.

    Could you please suggest some bootloader code for reference, which takes less memory footprint

    We only have the reference in the examples folder in the SDK.

    Best regards,

    Edvin

Reply Children
No Data
Related