This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrfutil zip package generation with hex containing address 0x2000XXXX

Hi,
We are testing the dfu ota example for the PCA10040. In our application we have some default values and settings are stored in the RAM. nrfutil is unable to generate the zip package for our hex file. It produces a "Memory Error". 

Parents
  • A DFU procedure will reset the chip after it's completed (unless you are using a very custom DFU bootloader). RAM might survive a short reset in this architecture, but you should consider all RAM as dirty after a DFU.

    Furthermore, you cannot be sure that the RAM addresses used on your .hex files will not be used by the DFU code when it's performing a DFU procedure. Messing up with the RAM during a DFU is a Bad Idea™.

    If you need to keep user settings, use the fstorage module. Those settings will not be overwritten when DFU'ing. Keep the defaults in your code, , and write them to flash the first time your application runs, read from flash and conflate the settings with your defaults.

    It produces a "Memory Error". 

    .hex represent sparse data (the same small file can have some data e.g. at 0x00001000 and some data at 0x20000800). The DFU procedure needs a contiguous file (see https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk52.v0.9.0%2Fbledfu_memory_banks.html ). nrfutil uses a naïve algorithm to convert the sparse .hex file into a contiguous file by adding 0xFF bytes as padding anywhere in the middle. Unfortunately nrfutil does not perform any constraint check on this, because it doesn't assume any memory address layout.

  • Thanks Ivan and Vidar,
    I moved the retained ram data to the flash and was able to generate the zip file from the hex. The firmware was then successfully loaded o the dev board. The application works fine but I am having an error "FDS_ERR_NO_SPACE_IN_QUEUES" .  I am sure this would be an easier fix. If I run into issues I will create a new question.
    Really appreciate the quick response here.

Reply
  • Thanks Ivan and Vidar,
    I moved the retained ram data to the flash and was able to generate the zip file from the hex. The firmware was then successfully loaded o the dev board. The application works fine but I am having an error "FDS_ERR_NO_SPACE_IN_QUEUES" .  I am sure this would be an easier fix. If I run into issues I will create a new question.
    Really appreciate the quick response here.

Children
No Data
Related