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:
-
Could switching to a different frontend/backend save flash space?
-
Is there anything in the SoftDevice I can use directly for encryption/decryption?
-
I noticed nRF52811 has these peripherals:
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 post — no decrypt function. I could not find a CCM example. -
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.