2026-01-23 11:46 AM
STM32G491KEU3 on custom board. Using STM32CubeProgrammer to read/change option bytes.
With BOOT_LOCK unchecked I use STM32CubeIDE to flash and debug my project. However SysTick_Handler() is never called, so HAL_GetTick() always returns the same value (zero).
With BOOT_LOCK checked, HAL_GetTick() returns incrementing tick counts as expected.
I thought I understood the ref manual description of BOOT_LOCK. Does BOOT_LOCK do other things?
2026-01-23 11:58 AM
BOOT_LOCK doesn't affect systicks. If BOOT0 is floating, maybe it's going into the bootloader rather than user flash. when BOOT_LOCK=0. How are the relevant option bits configured?
2026-01-23 12:52 PM
#1 Originally I had:
Using STM32CubeIDE I could flash and debug, but no systick. MCU reset did not boot from flash.
#2 I changed to:
I could flash and debug, systick OK. MCU reset booted from flash.
#3 Then I realized PB8 used for CAN. Changed to:
I could flash and debug, systick OK. MCU reset booted from flash.
Either #2 or #3 above work OK.
For #1, I am curious why no systick. System bootloader disables systick and HAL_Init() doesn't enable? Doubtful.
2026-01-23 1:00 PM
Probably what happens is the chip starts up in the bootloader and then the debugger jumps to the main code with a partially initialized system. Bootloader may be disabling interrupts during a critical section. Check to see if global interrupts are disabled.