Bootloader Jump Address Calculator
Calculate STM32 bootloader jump addresses. Configure VTOR, stack pointer, and application entry point.
Key Formulas
VTOR = App vector table base address
SP = first word of vector table
Frequently Asked Questions
What does the Bootloader Jump Address Calculator compute?
This tool calculates the precise memory address where an STM32 application begins execution after bootloader handover — including the application’s reset vector (entry point), initial stack pointer value, and VTOR (Vector Table Offset Register) configuration. It ensures correct alignment with flash sector boundaries and accounts for bootloader size to avoid overwriting critical code.
Why is the Vector Table Offset (VTOR) important in bootloader transitions?
VTOR tells the Cortex-M core where to find the application’s interrupt vector table after jumping from the bootloader. If misconfigured, interrupts (e.g., SysTick, NVIC) will fail or crash the system. This calculator computes the correct VTOR value based on your application’s start address and ensures it’s aligned to a 512-byte boundary (required by ARM).
What do “Bootloader Size” and “Application Start Sector” represent?
“Bootloader Size” is the flash space reserved for your custom bootloader (e.g., 32 KB), while “Application Start Sector” specifies which flash sector (0-indexed) holds your main firmware. The tool uses these to compute the exact byte offset where the application begins — critical for safe, non-overlapping flash layout.
What are typical values for Flash Base and Sector Size on STM32 devices?
Flash Base is usually
0x08000000 for most STM32F/L/H/G series. Sector sizes vary: 1–4 KB for small-density devices, 16 KB (e.g., STM32F407), 32 KB (STM32F7), or 128 KB (STM32H7). Always verify using your device’s reference manual — incorrect sector size leads to misaligned jump addresses.How do I determine the correct Application Start Sector for my project?
Consult your linker script (.ld file) or IDE flash settings — the application’s
FLASH_START or __FLASH_SEG symbol defines its base address. Convert that address to a sector index using: (address − flash_base) / sector_size_in_bytes. For example, 0x08010000 with 16 KB sectors and base 0x08000000 → sector 4.My application crashes after jumping from the bootloader — what should I check first?
Verify that the calculated stack pointer points to valid RAM (not uninitialized or overlapping memory), the VTOR is correctly set *before* branching, and the application’s vector table contains valid reset and NMI handlers. Also confirm the jump address matches the actual
_start or reset handler symbol — not the image header or padding bytes.Can this calculator be used for dual-bank OTA or secure boot setups?
Yes — configure “Application Start Sector” and “Bootloader Size” to reflect your active bank layout (e.g., Bank 1 = sector 4–15, Bank 2 = sector 16–31). However, this tool does not handle signature verification or bank swapping logic; it only computes static jump parameters required for the CPU’s initial execution context.
Is the calculated jump address the same as the application’s reset handler address?
Yes — the primary output is the 32-bit address of the application’s reset vector (typically the first word in its vector table). The second word at that address is the initial stack pointer (SP), and the third word is the reset handler entry point — all derived from the application’s vector table located at the computed VTOR.
What happens if I enter an invalid sector number or out-of-range bootloader size?
The calculator will still compute a numerical result, but it may point outside valid flash memory or into protected/locked regions — causing hard faults or failed programming. Always cross-check results against your MCU’s flash memory map and ensure the final application start address falls within writable, unlocked sectors.
Do I need to modify my application’s startup assembly or linker script when using this tool?
Yes — your application must be built with
VECT_TAB_OFFSET defined (e.g., -DVECT_TAB_OFFSET=0x10000) and its vector table relocated accordingly. The linker script must place the vector table at the calculated VTOR offset, and startup code must load VTOR before enabling interrupts or calling main().