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 127.0.0.1 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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s