Day: November 4, 2012

Flashing a firmware on STM32F100 of STM32VLDiscover

Connect your STM32VLDiscover (update with Versalon firmware) on your computer and execute:

# openocd -f stlinkversa.cfg

Open other terminal and execute:

$ telnet 4444

Halt the processor:

> reset halt
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc

Verify if your device detects the flash memory:

> flash probe 0
device id = 0x10016420
flash size = 128kbytes
flash 'stm32x' found at 0x08000000

Erase flash memory:

> stm32x mass_erase 0
stm32x mass erase complete

Write your binary (i.e. blinky.bin) at beginning of flash:

> flash write_image blinky.bin 0x08000000
wrote 132 bytes from file blinky.bin in 0.158301s (0.814 KiB/s)

Reset the processor and starts executing:

> reset run