This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MCUBoot Compressed update on nrf52833 - Ram utilization

When I try to add OTA image compression for MCUboot, the RAM utilization skyrocks and is not compatible with the nrf52833.  Is there any way to cut out any and all excessive functionality to get it to work?  I don't need encryption.  No logging.  No USB, no BLE, no side-channel loading.  I just want MCUboot to unzip, flash write and boot.   

No, we're not going to upgrade to the nrf52840 - I'd sooner roll my own RAM-friendly compression routines (128kB should be more than enough).

I'm testing with SDK2.8 - will later releases potentially be less ram hungry (wishful thinking, I know)?

Parents
  • Holy heck, this is never going to work:



    Fixed dictionary size of 128kB?!?  You guys know we're trying to program embedded devices here right?  Sigh.

  • I probably shouldn't be commenting in real-time, but please tell me it's as easy as patching nrf\subsys\nrf_compress\src\lzma.c (yes, I'm aware I'll need to compress the updates with the equivalent dict size):

    /* Assume the maximum LZMA dictionary size to limit the RAM buffer size for the decompressed
    * stream.
    */
    #define MAX_LZMA_DICT_SIZE (128 * 1024)
    


  • Ok, it is literally that easy.  Why, oh why, nordic, didn't you just make this a config option?  As a follow-up, to sign/compress your image with the updated dictionary size, all you have to do is change bootloader\mcuboot\scripts\imgtool\main.py:

    comp_default_dictsize=131072


    I have compressed updates working with the nrf52833 and 64kB dictionaries. I'm sure it'll work with all other low RAM devices too.

  • Thanks a lot for sharing!
    For the same reason, I switched to differential upgrade.

  • Delta/differential upgrades are a fantastic solution if your customers don't mind the linear upgrade path requirement.  Unfortunately, wouldn't work for us.

Reply Children
No Data
Related