Hi all,
I’m working on a custom bootloader for STM32F7, which performs OTA updates using TCP/IP (Ethernet and/or WINC3400 WiFi). The bootloader writes the new firmware to flash, then attempts to jump to the application using the standard sequence: cleaning and disabling caches, setting VTOR, setting MSP, and jumping to the application's reset handler.
The Problem:
- If the application binary is small, everything works: the bootloader jumps and the app runs as expected.
- If the application binary is larger (for example, over X KB/MB), the bootloader appears to complete the OTA and jump, but the application does not start (no output, no main runs, or immediate lockup/hard fault).
What I Have Tried:
- Verified that the full image is written to flash (checked total bytes and flash content matches binary).
- Cleaned and disabled D/I caches before jump.
- Set VTOR and MSP to the application address.
- Disabled all interrupts, deinitialized all peripherals, shut down the WINC3400, and reset all related GPIOs/SPI.
- When flashing the same large binary directly (not via bootloader), it runs perfectly.
Questions:
- Has anyone else experienced an issue where large application binaries fail to run after a bootloader jump, but small binaries work fine on STM32F7?
- Are there any known size limits, alignment, or memory configuration pitfalls (stack, heap, vector table, linker script) that can cause this?
- Is there any difference in how the bootloader or application should handle cache, MPU, or peripheral reset for large versus small images?
Any advice, references, or similar experiences would be greatly appreciated!