This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

can not download app from nRFgo Studio after download bootloader

Hi, Nordic I use SDK12.1 with nRF52832, I found one issue:

if I do not program bootloader, nRFgo Studio can program app.

First, erase all flash, then program softdevice.

If next I program bootloader, app can not program success, show flash is not erase

If next I program app, bootloader can not program success, show flash is not erase.

I do not understand why, bootloader and app ram address and size is OK.

s132_nrf52_3.0.0_softdevice.hex

nRF52_Application.hex

nRF52_Bootloader.hex

nRF52_application.rar

nRF52_bootloader.rar

Parents
  • Hi Chaw,

    I found the cause, its one of the known issues with the experimental buttonless DFU example in the SDK, see this answer.

    Long story short, the buttonless DFU example, which you have used to add DFU support in your application, reserves a codepage at 0x7E000 for MBR parameters, which is not necessary and should not been added in the application, only in the bootloader. If the codepage is added in the application, then it will collide with the same codepage that is defined in the bootloader.

    Thus, the entire section in nrf_dfu_settings.c shown below should be commented out in the application. However, be sure that you do not compile the secure bootloader with this section commented out, as it also uses this file!

    #if defined ( NRF52 )
    
    /**@brief   This variable reserves a codepage for mbr parameters, to ensure the compiler doesn't
     *          locate any code or variables at his location.
     */
        
        
    #if defined ( __CC_ARM )
    
        uint8_t m_mbr_params_page[CODE_PAGE_SIZE]       __attribute__((at(NRF_MBR_PARAMS_PAGE_ADDRESS))) __attribute__((used));
    
    #elif defined ( __GNUC__ )
    
        uint8_t m_mbr_params_page[CODE_PAGE_SIZE]       __attribute__ ((section(".mbrParamsPage")));
    
    #elif defined ( __ICCARM__ )
    
        __no_init uint8_t m_mbr_params_page[CODE_PAGE_SIZE]     @ NRF_MBR_PARAMS_PAGE_ADDRESS;
    
    #else
    
        #error Not a valid compiler/linker for m_mbr_params_page placement.
    
    #endif
    
    
    /**@brief   This variable makes the linker script write the mbr parameters page address to the
     *          UICR register. This value will be written in the HEX file and thus written to the
     *          UICR when the bootloader is flashed into the chip.
     */
     
    #if defined ( __CC_ARM )
        uint32_t m_uicr_mbr_params_page_address __attribute__((at(NRF_UICR_MBR_PARAMS_PAGE_ADDRESS)))
                                                        = NRF_MBR_PARAMS_PAGE_ADDRESS;
    
    #elif defined ( __GNUC__ )
        volatile uint32_t m_uicr_mbr_params_page_address    __attribute__ ((section(".uicrMbrParamsPageAddress")))
                                                        = NRF_MBR_PARAMS_PAGE_ADDRESS;
    #elif defined ( __ICCARM__ )
    
        __root    const uint32_t m_uicr_mbr_params_page_address @ NRF_UICR_MBR_PARAMS_PAGE_ADDRESS
                                                        = NRF_MBR_PARAMS_PAGE_ADDRESS;
    
    #else
    
        #error Not a valid compiler/linker for m_mbr_params_page placement.
    
    #endif
    
    #endif // defined ( NRF52 )
    
Reply Children
No Data
Related