nrf5_SDK secure bootloader with external QSPI Flash Image

Hi

I am working with the SDK secure bootloader from the SDK 17.1.0. The generated encrypted zip package we transfer with DFU and the APP and this is working great. The application image is too big to use the dual image feature. We have an external flash connected with QSPI and already implemented the possibility to receive and store the same zip package in this external QSPI flash.

Now we have to change the secure bootloader to read the new zip file content from this external flash in the bootloader and not over the BLE DFU feature. To get this feature, I checked the QSPI_booloader project in the examples folder (examples\peripheral\qspi_bootloader\pca10056\blank\ses) but can't see where this project is using the bootloader features like to check the CRC, the crypto key and all other features like in the secure bootloader project. Or is the idea to use this project to implement the start address to the existing secure bootloader project and this code will start reading from the external flash instead of the received files from the BLE DFU connection?

Is there an existing sample how to implement this feature in the secure bootloader project?

Thanks a lot for inputs, Dominik

Parents Reply Children
  • I merged the code from this SPI Bootloader Page to implement the SPI feature, but now I got the error:

    .bootloader_settings_page is too large to fit in FLASH memory segment

    I increased the bootloader size from actual 32kb to 64kb, but this didn't solve the error. The bootloader size can be increased without limit? (of course the Application will be smaller of this size)

    in the function the size will be calculated with the old SDK with the UICR feature,

    static uint32_t nrf_dfu_find_cache(uint32_t size_req, bool dual_bank_only, uint32_t * p_address)
    {
        uint32_t free_size =  DFU_REGION_TOTAL_SIZE_QSPI - DFU_APP_DATA_RESERVED;
        
    .....
    
    #define DFU_REGION_TOTAL_SIZE_QSPI               ((* (uint32_t *)NRF_UICR_BOOTLOADER_START_ADDRESS) - CODE_REGION_1_START)

    I changed this because of the new SDK 17.1.0 to:

    #define DFU_REGION_TOTAL_SIZE_QSPI               ((* (uint32_t *)BOOTLOADER_START_ADDR) - CODE_REGION_1_START)
    ....
    
    #ifndef BOOTLOADER_START_ADDR
    #if (__LINT__ == 1)
        #define BOOTLOADER_START_ADDR (0x3AC00)
    #elif defined(CODE_START)
        #define BOOTLOADER_START_ADDR (CODE_START)
    #else
        #error Not a valid compiler/linker for BOOTLOADER_START_ADDR.
    #endif
    #endif
    
    #elif defined(__SES_ARM)
    extern uint32_t * _vectors;
    extern uint32_t __FLASH1_segment_used_end__;
    #define CODE_START ((uint32_t)&_vectors)
    #define CODE_END   ((uint32_t)&__FLASH1_segment_used_end__)
    #define CODE_SIZE  (CODE_END - CODE_START)
    
    

    Because this code is used on the original DFU ver BLE, maybe this is wrong?

    Thanks

Related