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

nRF5 SDK Crypto Size Optimization for nRF52811

Hi all,

I’m planning to add crypto support to my nRF52811 application. My main requirement is encrypting and decrypting a string, but I’m hitting flash size constraints. My app currently works, but flash usage is borderline full:

  • FDS stores two numbers (serial number + flag), consuming ~3 KB

  • BLE DFU requires:

    • SoftDevice: ~100 KB

    • Bootloader: 23–24 KB

    • Bootloader settings page + backup: 804 bytes → effectively 2 KB due to page alignment

This leaves very little space for my app.

My current crypto setup:

  • Backend: mbedtls

  • Frontend: AES

  • RNG: HW peripheral

I have a few questions:

  1. Could switching to a different frontend/backend save flash space?

  2. Is there anything in the SoftDevice I can use directly for encryption/decryption?

  3. I noticed nRF52811 has these peripherals:

    • ECB (/modules/nrfx/hal/nrf_ecb.c)

    • CCM

    Can I use these directly without the crypto backends? For ECB, there’s nrf_ecb.c, but I hit the same problem as described here: DevZone postno decrypt function. I could not find a CCM example.

  4. Any suggestions for storing my two numbers directly in flash without FDS to save space?

Thanks in advance for any guidance or best practices for flash optimization on nRF52811.

ps:- using nrf52840 evk for development. 

Parents
  • Hi

    The OOB pairing sample we have in the nRF5 SDK uses NFC, which the nRF52811 doesn't have, and for most phones NFC is the only allowed OOB method to do bonding on. So you're stuck with LESC in which you need either a display or button capabilites to confirm the pairing procedure.

    The other method would be to only whitelist the UUID of the devices you have so that the phone application only will connect and pair to these specific devices.

    Best regards,

    Simon

Reply
  • Hi

    The OOB pairing sample we have in the nRF5 SDK uses NFC, which the nRF52811 doesn't have, and for most phones NFC is the only allowed OOB method to do bonding on. So you're stuck with LESC in which you need either a display or button capabilites to confirm the pairing procedure.

    The other method would be to only whitelist the UUID of the devices you have so that the phone application only will connect and pair to these specific devices.

    Best regards,

    Simon

Children
No Data
Related