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

Update SD+BL+APP from SDK v12 to v14 DFU fails

While migrating from SDK 12.2 to SDK 14.2 DFU fails while flashing application and the pages assigned get in the switch case of FDS_PAGE_UNDEFINED always ,thus jumping from one page to next and not finding anything on the pages assigned.

It always finds itself in this loop-

else
{
// The page contains non-FDS data.
// Do not initialize or use this page.
total_pages_available--;
m_pages[page].p_addr = p_page_addr;
m_pages[page].page_type = FDS_PAGE_UNDEFINED;
page++;
}

and after that it doesnt finds the minimum FDS pages -

if (total_pages_available < 2)
{
ret &= NO_PAGES;
}

thus returning NO_PAGES.

Can someone help me with this problem.

The configuration that I am using is 

#define FDS_VIRTUAL_PAGES 5

#define FDS_VIRTUAL_PAGE_SIZE 2048

Parents
  • Hi Gaurav, 

    just to confirm, you're using the nRF52832?

    Setting the FDS_VIRTUAL_PAGE_SIZE to 2 means that each FDS page is 8kB(2048*4bytes). So with the FDS_VIRTUAL_PAGES set to 5, FDS will use in total 40kB(5*8kB) for flash storage and will need minimum 16kB(2 virtual pages), i.e. 4 flash pages of 4kB each, free between the bootloader and the application. 

    So the default bootloader start address in SDK v14.2.0 is 0x78000, which means that the application end address must be 0x78000-0x4000= 0x74000 to meet the minimum requirement from FDS. Ideally you need to allocate the entire 40kB if you do not want FDS to overwrite the application( given that the application uses all the available flash between the application start address and the BL start address - FDS_VIRTUAL_PAGES*FDS_VIRTUAL_PAGE_SIZE . 

    Best regards

    Bjørn 

  • I debugged and found out that its not able to read the bootloader_start_Address properly thats why its setting it to 0x80000 which probably is wrong.

    And in the debugging mode I am getting the error as BOOTLOADER_NOT_VERIFIED

    and its showing BL_ADDRESS as 0x23000 which is the application address.

    I am still not sure from where its reading the bootloader start address

  • The bootloader start address is stored in the NRFFW[0] UICR register ( 0x10001014). This register is flashed with the bootloader start address when the bootloader is flashed to the board, see nrf_bootloader_info.c 

    #if defined (__CC_ARM )
        #pragma push
        #pragma diag_suppress 1296
        uint32_t  m_uicr_bootloader_start_address __attribute__((at(NRF_UICR_BOOTLOADER_START_ADDRESS)))
                                                        = BOOTLOADER_START_ADDR;
        #pragma pop
    #elif defined ( __GNUC__ ) || defined ( __SES_ARM )
        volatile uint32_t m_uicr_bootloader_start_address  __attribute__ ((section(".uicr_bootloader_start_address")))
                                                = BOOTLOADER_START_ADDR;
    #elif defined ( __ICCARM__ )
        __root    const uint32_t m_uicr_bootloader_start_address @ NRF_UICR_BOOTLOADER_START_ADDRESS
                                                = BOOTLOADER_START_ADDR;
    #endif
    

    Note: The bootloader start address cannot change between the update from SDK 12.2.0 to SDK v14.2, it must be identical for the old and new bootloader. 

    Best regards

    Bjørn 

Reply
  • The bootloader start address is stored in the NRFFW[0] UICR register ( 0x10001014). This register is flashed with the bootloader start address when the bootloader is flashed to the board, see nrf_bootloader_info.c 

    #if defined (__CC_ARM )
        #pragma push
        #pragma diag_suppress 1296
        uint32_t  m_uicr_bootloader_start_address __attribute__((at(NRF_UICR_BOOTLOADER_START_ADDRESS)))
                                                        = BOOTLOADER_START_ADDR;
        #pragma pop
    #elif defined ( __GNUC__ ) || defined ( __SES_ARM )
        volatile uint32_t m_uicr_bootloader_start_address  __attribute__ ((section(".uicr_bootloader_start_address")))
                                                = BOOTLOADER_START_ADDR;
    #elif defined ( __ICCARM__ )
        __root    const uint32_t m_uicr_bootloader_start_address @ NRF_UICR_BOOTLOADER_START_ADDRESS
                                                = BOOTLOADER_START_ADDR;
    #endif
    

    Note: The bootloader start address cannot change between the update from SDK 12.2.0 to SDK v14.2, it must be identical for the old and new bootloader. 

    Best regards

    Bjørn 

Children
No Data
Related