Skip to main content
Visitor II
June 23, 2024
Question

Update firmware from W25Qxx flash

  • June 23, 2024
  • 1 reply
  • 1160 views

I use a board with STM32F405 + W25Qxx. At the moment, I have implemented downloading the firmware file to an external flash memory (via CAN). The process of downloading and verification is implemented in the main firmware. It is necessary to implement overwriting the firmware from the external flash memory, and the following reboot

    This topic has been closed for replies.

    1 reply

    Graduate II
    June 23, 2024

    Make a Loader that lives in the first 16KB sector that can read the W25Qxx and manage the erase and update of the Application which now starts at 0x08004000.

    Don't initiate the Loader until you have a complete and validated image in the external flash.

    In usual operation the Loader transfers control to the Application. The Loader is always present, doesn't erase itself, and perhaps offers other recovery modes via CAN and UART

    Kuzma30Author
    Visitor II
    June 24, 2024

    I use IAR compiler, can you help me adapt this https://github.com/pramodk51/bootloader_for_stm32f4 
    How to add Header memory region in IAR?

    Graduate II
    June 24, 2024

    Not using IAR, would suspect it would get done in the .ICF file, the equivalent to the Linker Script / Scatter File methods used by other tools.

    Still, probably easier just to embedded the image length in a spare vector, and append the CRC on the end. I've shown how this is done in Keil multiple times on the forum.

    Perhaps review IAR's documentation, or work with your support contact there, with regards to the CRC methods and application they support directly.

    You can also just write C applications with STDIO file handling and manage the packaging yourself as a post-link step.