How to flash firmware: Difference between revisions

From STorM32-BGC Wiki
Jump to navigation Jump to search
Line 19: Line 19:
If your v3.x STorM32 board runs already a firmware, then this is the canonical procedure for upgrading:
If your v3.x STorM32 board runs already a firmware, then this is the canonical procedure for upgrading:


'''1.''' Connect the board via the USB plug to the PC.
{{COMMENT|If the board has already a firmware installed and this is the first-time it is connected via USB to a PC, then Win will immediately start with installing the appropriate USB driver. This takes quite a while (several minutes). Please, be patient and wait until Win reports that the device is ready for use. {{WARNING|'''Do not interrupt the driver installation process before it is completed'''}}. This can mess up things quite considerably, and installing the driver later can be a challenge.}}
'''2.''' 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:Stom32-wiki-flash-firmware-01.jpg|640px]]
'''3.''' Select the correct board and desired firmware version from the selectors.
{{COMMENT|With these two selectors the correct firmware .hex file is chosen in the {{GUIFIELD|Selected Firmware Hex File}} field.}}<br/>
{{COMMENT|It is {{WARNING|'''important'''}} to choose the correct board version; otherwise the board will not functions correctly.}}
'''4.''' Select {{GUIPARAM|System Bootloader @ UART1}} in the {{GUIFIELD|STM32 Programmer}} field.
'''5.''' In the {{GUIFIELD|Com Port}} field select the COM port which your USB-TTL adapter is connected to.
{{COMMENT|We are talking here about the {{GUIFIELD|Com Port}} field in the {{GUIFIELD|Flash Firmware}} tab, not the {{GUIFIELD|Port}} field in the lower left of the main window.}}<br/>
{{COMMENT|If you are 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, and finally inspect the drop-down list and chose the newly added COM port.}}
'''6.''' If required or desired check the {{GUIFIELD|Perform full chip erase}} check button.
'''7.''' Finally, hit the {{GUIFIELD|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 some seconds).<!-- If the program doesn't proceed and asks to "Press any key to continue" the board is write protected. See "Removing Write Protection" below.-->
::[[File:flash.png|640px]]
'''8.''' The STorM32 board will be reset and start running.


== First-Time Flashing ==
== First-Time Flashing ==

Revision as of 13:57, 23 April 2018

This page is for instructions on how to flash firmware onto v3.x STorM32 boards.

For instructions on how to flash v1.1/v1.2/v1.3/v1.3x STorM32 boards, please consult How to flash v1.x STorM32 boards.

The flashing manual is different for the v3.x and v1.x boards because the v3.x boards can be upgraded via the USB plug, which is not possible with the v1.x boards. For the v3.x boards in fact two situations can be distinguished, which are called "Upgrading" and "First-Time Flashing":

  • Upgrading: If your v3.x board runs a valid STorM32 firmware, and you want to upgrade or downgrade, then this is the procedure to choose, since it is most simple.
  • First-Time Flashing: In all other cases, i.e., if your v3.x board has not yet a STorM32 firmware installed or you don't want to use the upgrade method, then this is what needs to be done.

In the following the flashing procedures for both cases are described.

Comment: The same distinction also exists for flashing NT modules, see How to flash NT Modules.

Updating Firmware

If your v3.x STorM32 board runs already a firmware, then this is the canonical procedure for upgrading:

1. Connect the board via the USB plug to the PC.

Comment: If the board has already a firmware installed and this is the first-time it is connected via USB to a PC, then Win will immediately start with installing the appropriate USB driver. This takes quite a while (several minutes). Please, be patient and wait until Win reports that the device is ready for use. Do not interrupt the driver installation process before it is completed. This can mess up things quite considerably, and installing the driver later can be a challenge.

2. 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.

Stom32-wiki-flash-firmware-01.jpg

3. Select the correct board and desired firmware version from the selectors.

Comment: With these two selectors the correct firmware .hex file is chosen in the [Selected Firmware Hex File] field.
Comment: It is important to choose the correct board version; otherwise the board will not functions correctly.

4. Select "System Bootloader @ UART1" in the [STM32 Programmer] field.

5. 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 are 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, and finally inspect the drop-down list and chose the newly added COM port.

6. If required or desired check the [Perform full chip erase] check button.

7. 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 some seconds).

Flash.png

8. The STorM32 board will be reset and start running.

First-Time Flashing

If your v3.x STorM32 board has not yet been flashed with a STorM32 firmware, or runs a different firmware, then one needs to resort to grass roots flashing methods for flashing the firmware (first-time flashing).

In general, the STM32 micro-controllers which are used in the STorM32 boards provide two different in-built methods for flashing firmware:

  1. via the serial system bootloader on the UART port using a USB-TTL adapter
  2. via SWD using a ST-Link programmer

For v3.x boards method (1) is relatively convenient, since these boards have a USB-TTL adapter integrated and thus no additional hardware is needed for doing this. However, the grain of salt, the BOOT0 pin needs to be temporarily shortened to GND by closing the solder pad.

Method (2) requires a dedicated ST-Link programmer. These are cheaply available, but nevertheless it is an additional piece of hardware, which one needs.

Flashing via System Bootloader

Flashing via SWD

This procedure is exactly identical for all STorM32 hardware (v1.x and v3.x boards and NT modules). It is described in this article Flashing Firmware using a STLink/V2 (SWD) Programmer.