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

changes in Bootloader- saving image in external flash and transferring in internal via Bootloader

Hi , I am using ZEPHYR rtos , and using the internal bootloader and its working fine and there are two images but now my code size has increased and i can not store 2 images in internal flash  so have to do implementation of saving the image to external flash and after validation move to internal flash ,what changes i require to make in zephyr bootloader to add external flash code(SPI) and  using only 1 image in bootloader 

  • yeah i have flashed the mcuboot, image first is my application previously my code has 2 images in internal flash and it was working fine ,the as my code size  increased mode the i used external flash for image -1 and internal flash for image -0 and this error start showing can you guiide what more changes are required to made in bootloader code for it

  • Hi Anil, 
    Have you tried the example provided by Håkon in one of the case I pointed you to ? It was made for nRF5340 but I believe it shouldn't be too hard to configure to work with nRF52833. 
    I don't see CONFIG_PM_EXTERNAL_FLASH=y in your configuration. 

    In addition there is a case here that has the exact same error as you described. Could you have a look ? 

  • Hi again Anil, 
    It seems that code for using external flash is changed a bit, you can find the documentation here: 
    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.8.0/nrf/ug_bootloader_external_flash.html

    The code from Håkon may not run out of the box. You will need to look at the test code as mentioned in the page. 
    I will check and let you know if it works for me. 

  • Hi, 
    Please find my example of using external flash with MCUBoot and smpsvr. 
    I have tested here and it worked for both nRF5340DK and nRF52840DK , it should be the same for the nRF52833 DK. 
    Please test them on the DK first and then try to port it to your board with SPI instead of QSPI. Note that your flash driver should support: 

    • Single-byte read and write.

    • Writing data from the internal flash memory to the external flash memory.

    The example only support DFU via UART (using mcumgr)

    0726.smp_svr_external.zip

  • Hi Hung , I have tried the example code you mentioned but still do not work as i am using external flash as secondary image area it is fetting failed in reading the sectors or secondary image 

     rc = boot_read_sectors(state);
        if (rc != 0) {
            BOOT_LOG_WRN("Failed reading sectors; BOOT_MAX_IMG_SECTORS=%d"
                         " - too small?", BOOT_MAX_IMG_SECTORS);
            /* Unable to determine sector layout, continue with next image
             * if there is one.
             */
            BOOT_SWAP_TYPE(state) = BOOT_SWAP_TYPE_NONE;
            return;
        }
    Do i need to make any change in NCS code for bootloader i have done all required change on conf file but some linking is missing as it not able to read sectors for secondary  can you pls guide for further changes 
Related