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

DFU image with gcc optimisation bricks device

Hello,

I am experiencing some strange behaviour through DFU process when build with GCC -O2 optimisation.

The upgrade process seems to complete successfully but after this our device is unresponsive. Looking through the RTT logs, it seems to throw an SoftDevice exception and halts through the APP_ERROR_CHECK macro right after initialising the FDS module.

The error is the following:

ERROR 1 [NRF_ERROR_SVC_HANDLER_MISSING] at :0
PC at: 0x00000000

Thanks in advance:

Andoni

Parents
  • Hello,

    Please try replacing the nrf_bootloader_app_start_final.c->jump_to_addr() function with the new one from SDK 17.0.0 below. I'm pretty sure it will fix the problem. Our old GCC assembly implementation would break when optimization was turned off and cause the program to jump to the wrong address.

    /**@brief Function that sets the stack pointer and starts executing a particular address.
     *
     * @param[in]  new_msp  The new value to set in the main stack pointer.
     * @param[in]  addr     The address to execute.
     */
    void jump_to_addr(uint32_t new_msp, uint32_t addr)
    {
        __set_MSP(new_msp);
        ((void (*)(void))addr)();
    }

    Best regards,

    Vidar

  • Hi Vidar, thank you for your response, I will give this a try! But seems like a better solution would be to upgrade our whole system to the latest SDK version.

    Once again, much appreciated!

    Andoni

Reply Children
Related