In this article I described how to flash the IFLAT-32 through X-Link/OpenOCD. If you only intend to flash the device (and not to debug on chip), you don’t even need a JTAG (like the X-Link). When setting the STM32 boot mode to “System Memory”, after reset it “sits and waits” for incoming data to flash on the USART. Thus, the only thing needed is an TTL capable USB to serial adapter, and a little tool called “stm32flash”.
For an USB to serial converter I use the FT232RL. Connect RX of the FT232RL to TX of the IFLAT-32 and TX of the FT232RL to RX of the IFLAT-32. If you connect the IFLAT and the FT232RL to the same USB port there is no need to connect the two ground lines together. Otherwise connect ground from the FT232RL to the IFLAT-32.
Next set the boot mode jumper to “System Memory” on the IFLAT. I replaced the jumper on my IFLAT with a 2 state switch which allows me to toggle the boot modes (remember, that the IFLAT “sits and waits” after a power cycle when in boot mode “System Memory”).
Now we need the tool for flashing. Get “stm32flash” from the svn:
svn checkout http://stm32flash.googlecode.com/svn/trunk/ stm32flash-read-only
And build it:
cd stm32-flash-read-only sudo make install
Now if your IFLAT is connected, and reseted, you can check if the stm32-flash utility is able to connect by issuing:
This should give you some information about your IFLAT-32.
To flash a firmware (bin, hex or elf format), issue the following command:
stm32flash -w firmware.bin -v /dev/ttyUSB0 -g 0x0
This flashes the file “firmware.bin”, and starts execution at the beginning afterwards (“-g 0×0″). Sometime more then one reset is needed on the IFLAT before flashing could be done successfully.