# Set WORKAREASIZE based on RAM size of 20kb set WORKAREASIZE 0x4fff source [find target/stm32f1x.cfg] proc init_stm32 {} { init reset halt adapter_khz 1500 } proc program_flash {bin_file} { init_stm32 wait_halt flash erase_sector 0 0 last flash write_bank 0 $bin_file 0 reset run shutdown }