Reduce nRF7002dk image size

Hello, I'm in the development stage of a product and currently evaluating the nRF5340 as our main processor and nRF7002 as a companion IC for WiFi. Our application can be used in a wide variety of connectivity environments, so we require a WiFi interface, Ethernet interface, a cellular/GPS modem, and BLE. Also, we want to make MQTTS/HTTPS connections to our cloud provider. I've gotten a lot of these individual components to work individually by building our app to run on a nRF7002dk; however, I'm running into issues with the size of the image being too big when I try to include all of the necessary config variables in my build. Is what I'm attempting to do infeasible? My current build is overflowing RAM by 71,272 bytes and Flash is overflowed by 10,160 bytes. I can share my board overlays and configuration files. To be clear, I'm using NCS version 2.8.0, and building an application with nrf/7002dk/nrf5340/cpuapp/ns board as the target.

4336.prj.conf sysbuild.conf 3731.nrf7002dk_nrf5340_cpuapp_ns.conf nrf7002dk_nrf5340_cpuapp_ns.overlay

Parents
  • From my current experience, this is a hard thing to get to work. As you say, all the individual samples will work, but trying to combine the functionalities into a real application is another kettle of fish... My device has networking (wifi/wpa/IPv4/httpS/mqtt to the cloud with JSON parsing), BLE GATT server, BLE ibeacon scanning and emission, serial comm, NFC emulation, audio (I2S and PDM), USB (VCOM and FAT file system), GPIO & I2C for sensors and battery management, ePaper display with touch....  The benefit of the Nordic/zephyr environment is that a lot of useful library/subsystem/driver code is provided, the disadvantage is the complexity to get everything to co-exist (Zephyr is particularly hard I find...)

    An external flash chip to allow DTU (OTA or via USB) is a must (for the secondary image slot), also to store the 128kb required for the wifi nrf70 patches (in theory, haven't got this to work yet). Then, your bootloader (mcuboot) takes up 64kb in real life (because you need the serial DTU/USB option just in case an OTA error bricks it....), leaving you with around 970kB for the app... this seems large, but the whole wifi+WPA supp+TCP+TLS crypto block will use an large percentage of that! 

    For the RAM, I have managed to get an operational config, but only by time consuming tuning of the heap sizes, prj.conf parameters etc... and the interdependancies between these are very much NOT clearly documented in either Zephyr or the Nordic docs.  I don't think its possible to add RAM to the nrf5340 as far as I know, which makes the 440kB you actually have to play with be a major difficulty.

    I can't tell you that definitively it is possible, as right now I cannot get the mbedtls part to actually fit in the space and also work for https connections!

Reply
  • From my current experience, this is a hard thing to get to work. As you say, all the individual samples will work, but trying to combine the functionalities into a real application is another kettle of fish... My device has networking (wifi/wpa/IPv4/httpS/mqtt to the cloud with JSON parsing), BLE GATT server, BLE ibeacon scanning and emission, serial comm, NFC emulation, audio (I2S and PDM), USB (VCOM and FAT file system), GPIO & I2C for sensors and battery management, ePaper display with touch....  The benefit of the Nordic/zephyr environment is that a lot of useful library/subsystem/driver code is provided, the disadvantage is the complexity to get everything to co-exist (Zephyr is particularly hard I find...)

    An external flash chip to allow DTU (OTA or via USB) is a must (for the secondary image slot), also to store the 128kb required for the wifi nrf70 patches (in theory, haven't got this to work yet). Then, your bootloader (mcuboot) takes up 64kb in real life (because you need the serial DTU/USB option just in case an OTA error bricks it....), leaving you with around 970kB for the app... this seems large, but the whole wifi+WPA supp+TCP+TLS crypto block will use an large percentage of that! 

    For the RAM, I have managed to get an operational config, but only by time consuming tuning of the heap sizes, prj.conf parameters etc... and the interdependancies between these are very much NOT clearly documented in either Zephyr or the Nordic docs.  I don't think its possible to add RAM to the nrf5340 as far as I know, which makes the 440kB you actually have to play with be a major difficulty.

    I can't tell you that definitively it is possible, as right now I cannot get the mbedtls part to actually fit in the space and also work for https connections!

Children
No Data
Related