-
Notifications
You must be signed in to change notification settings - Fork 21
Home
-
stm8gal and it's source code is distributed under the Apache License Version 2.0 (see License)
-
exception is some RAM code, which is required for flash programming. This code is available on the STM Homepage. All rights to this RAM code remain with STM.
stm8gal is an application for programming or reading out the STM8 microcontroller using the built-in ROM bootloader (BSL) via UART interface (SPI under development). It is compatible with Windows, MacOS X and Linux, including Raspbian. For a list of tested configurations see supported platforms.
Note: stm8gal is identical to STM8_serial_flasher. It was renamed after a proposal by Philipp Krause
Tools with similar functionality are:
- Flash Loader Demonstrator (UM0462) by STM (Windows only)
- stm8flasher by ottinger (Windows & Linux)
- stm-serial-flasher by gamadril (Chrome)
Notes:
-
this tool has been tested only for a few devices (see supported platforms). Theoretically it should work for all STM8 devices with bootloader, especially since STM8AF, STLUX, STNRG and STM8SPLNB seem to be test variants of the STM8S, and STM8AL and STM8T seem to be test variants of the STM8L. But this has not been tested, so any feedback is highly appreciated!
-
the popular STM8S Discovery and STM8L Discovery boards connect to a standard PC via SWIM (=debug) interface, so a separate adapter is required to connect to the respective STM8 interface pins. For examples see hardware setup or this tutorial.
-
the Raspberry Pi, or similar “embedded PCs“ with direct access to GPIO pins, allow a direct connection of the STM8 interface pins. For an example setup see page hardware setup.
-
when directly connecting IO pins, pay special attention to compatible voltage levels, e.g. never connect a 5V adapter to 3.3V STM8 pins ore vice versa!
-
the STM8 ROM bootloader (=BSL) must be enables for uploading new code
-
for virgin devices (i.e. flash erased) the BSL is automatically enabled
-
for other devices the BSL can be re-enabled
-
with the free ST Visual Programmer application (Windows only) by STM
-
by uploading and running the STM8 program in subfolder BSL_activate using stm8flash by Valentin Dudouyt (programmer via SWIM interface)
-
-
stm8gal by default activates the BSL after upload (see page usage)
-
-
the BSL can be entered only within 1s after reset. Reset can be triggered manually (reset button), via DTR (requires connection of DTR to STM8 RST pin), or via Raspberry Pi pin GPIO18 (see page hardware setup)
-
bootloader programming via UART, SPI or CAN is supported by most STM8 devices. However, not all devices support each interface. Also, some UART-BSLs operate in "reply mode", which require a "Rx echo" for each sent byte. A full description of the bootloaders can be found in UM0560 by STM. Here is an overview of STM8 devices with respective bootloader mode:
This mode is implemented to support single-wire interfaces like LIN or ISO9141. In additions, some UART-BSLs operate in "reply mode", which require a "Rx echo" for each sent byte. This mode is implemented to support single-wire interfaces like LIN or ISO9141. For UART-BSL "reply mode" and dual wires, stm8gal has to echo each received byte individually, which results in low upload speed.
- for an overview of STM8 devices with BSL modes see UM0560 by STM. The STM32 uses a very similar communication protocol, so adapting the flasher tool for STM32 should be straightforward. However, I have no board available, but please feel free to go ahead...
See other Wiki pages for instructions on building, hardware setup, and using the software. Have fun!