How to flash firmware: Difference between revisions
No edit summary |
|||
Line 17: | Line 17: | ||
:RC-1 = Uart1-Tx -> connect it to Rx of the usb-ttl adapter | :RC-1 = Uart1-Tx -> connect it to Rx of the usb-ttl adapter | ||
{{COMMENT|neither a 5V nor a 3.3V nor any other power pin on the usb-ttl adapter is used... only three wires running from adapter to board}}<br/> | |||
{{COMMENT|for v1.1 boards the connections are identical, except that the RC port is located left to the RC2 port}}<br/> | |||
{{COMMENT|v0.17/v1.0 boards are deprecated (they have different pin assignements, please check the web)}} | |||
  [[File:Flashing w usbttladapter connections1.jpg|480px]] |   [[File:Flashing w usbttladapter connections1.jpg|480px]] | ||
Line 28: | Line 28: | ||
'''5.''' run the GUI and go to the {{GUI|Flash Firmware}} tab (see the screenshot) | '''5.''' run the GUI and go to the {{GUI|Flash Firmware}} tab (see the screenshot) | ||
{{COMMENT|in principle you can use any GUI version to flash any version of the firmware, however, a GUI which is of the same or higher version than the firmware provides easy access to the firmware via the selector fields on the {{GUI|Flash Firmware}} window}} | |||
  [[File:8flashfirmware.png|480px]] |   [[File:8flashfirmware.png|480px]] | ||
Line 38: | Line 38: | ||
'''8.''' in the {{GUI|Com Port}} field select the COM port which your usb-ttl adapter is connected to | '''8.''' in the {{GUI|Com Port}} field select the COM port which your usb-ttl adapter is connected to | ||
{{COMMENT|we are talking here about the {{GUI|Com Port}} field in the {{GUI|Flash Firmware}} tab, not the {{GUI|Port}} field in the lower left of the main window}}<br/> | |||
{{COMMENT|if you're not sure which the correct COM port is, then disconnect the usb-ttl adapter from the PC, inspect the drop-down list and memorize the available COM ports, connect your adapter and wait until its enumerated by Win, finally inspect the drop-down list and chose the newly added COM port}} | |||
'''9.''' if required or desired check the {{GUI|Perform full chip erase}} check button | '''9.''' if required or desired check the {{GUI|Perform full chip erase}} check button | ||
Line 49: | Line 49: | ||
This may sound complicated, but one will quickly realize that this can be done by "rolling" the finger tip from the left to right. | This may sound complicated, but one will quickly realize that this can be done by "rolling" the finger tip from the left to right. | ||
{{COMMENT|both leds will stop flashing... they should appear "dead"}} | |||
'''11.''' finally, hit the {{GUI|Flash Firmware}} button | '''11.''' finally, hit the {{GUI|Flash Firmware}} button |
Revision as of 09:13, 29 June 2014
The following describes the process of flashing firmware onto v1.1 and later boards.
Flashing Firmware using a USB-TTL Adapter
1. you need a standard usb-ttl adapter (FTDI, CP2102,...), ensure that it's working (drivers installed etc.)
2. you don't have to worry if it's a 5V adapter or not, the pins we're going to connect the adapter to are 5V tolerant
3. the adapter has to be connected to UART1, which is NOT the port labelled UART on the board, the correct pins are found on the port labelled RC! Namely:
- RC-GND = GND -> connect it to GND of the usb-ttl adapter
- RC-0 = Uart1-Rx -> connect it to Tx of the usb-ttl adapter
- RC-1 = Uart1-Tx -> connect it to Rx of the usb-ttl adapter
Comment: neither a 5V nor a 3.3V nor any other power pin on the usb-ttl adapter is used... only three wires running from adapter to board
Comment: for v1.1 boards the connections are identical, except that the RC port is located left to the RC2 port
Comment: v0.17/v1.0 boards are deprecated (they have different pin assignements, please check the web)
File:Flashing w usbttladapter connections1.jpg
4. the board should be powerd via the USB plug or through a battery/power supply connected to the BAT pins (only experts who know what they're doing should use any of the 3.3V pins on the board)
5. run the GUI and go to the [Flash Firmware] tab (see the screenshot)
Comment: in principle you can use any GUI version to flash any version of the firmware, however, a GUI which is of the same or higher version than the firmware provides easy access to the firmware via the selector fields on the [Flash Firmware] window
6. select the correct board and desired firmware version from the selectors, or browse to a specific hex file
7. select "System Bootloader @ UART1" in the [STM32 Programmer] field
8. in the [Com Port] field select the COM port which your usb-ttl adapter is connected to
Comment: we are talking here about the [Com Port] field in the [Flash Firmware] tab, not the [Port] field in the lower left of the main window
Comment: if you're not sure which the correct COM port is, then disconnect the usb-ttl adapter from the PC, inspect the drop-down list and memorize the available COM ports, connect your adapter and wait until its enumerated by Win, finally inspect the drop-down list and chose the newly added COM port
9. if required or desired check the [Perform full chip erase] check button
10. this is now important: before hitting the [Flash Firmware] button one has to get the board prepared to be ready for being flashed. For that, with the board connected to power, one has to
- press and hold down both the Reset and Boot0 buttons (the exact sequence of when which button is pressed is irrelevant, as long as they're both hold down)
- then, release the Reset button while still holding down the Boot0 button
- then, release also the Boot0 button
This may sound complicated, but one will quickly realize that this can be done by "rolling" the finger tip from the left to right.
Comment: both leds will stop flashing... they should appear "dead"
11. finally, hit the [Flash Firmware] button
Now a black window (DOS console) should open and run the flash loader program, as shown in the screenshot. Wait until it's finished (takes a couple of seconds).
12. if this is the first flash of the firmware on a "fresh" board, and if the board is connected via USB to a PC, then Win 7 will immediately start with installing the appropriate driver. This takes a while (several minutes). Please, be patient and wait until Win 7 reports that the device is ready for use. In particular, do not disconnect the board from the PC or otherwise interrupt the process before the install is completed. This can mess up things quite considerably, and installing the driver later could be a challenge.
Trouble Shooting
- On Win XP flashing via the GUI using the usb-ttl adapter will fail (the compiled exe version of the flashloader doesn't work on XP, sorry for that).
- If the verify fails then first check that you're not using an outdated GUI version. Otherwise, check the [Perform full chip erase] check button and repeat. This will however also erase any setting which you might have stored before. In that case save the settings beforehand using the option in the "Setting" menu.
- If upon flashing you get Windows errors such as mfc110.dll is missing, msvcr110.dll is missing, or application was unable to start correctly (0xc000007b), then first check that you're not using an outdated GUI version. Otherwise, you need to install the VC++ runtime libraries. Download vcredist_x64.exe or vcredist_x86.exe depending on your Win system from here, and run the exe file.
Flashing Firmware using a STLink/V2 (SWD) Programmer
PLEASE ADD