haarates.blogg.se

Stm8 cosmic tutorial
Stm8 cosmic tutorial




stm8 cosmic tutorial

This demonstrates setting up and using the UART for serial I/O. We present a simple Demo that repeatedly outputs "Hello World!" on UART2 (the only UART the STM8S105 has). In case there are any errors, such as header files not found, check that pkg-config and development files for libusb are installed. using unzip stm8flash-master.zip) change into the directory stm8flash-master and type make.

stm8 cosmic tutorial

To compile it, a C compiler, such as gcc, pkg-config and libusb need to be installed. The stm8flash source can be found at its GitHub location, where there is also a download link for a zip archive of the sources. SDCC binaries or a source tarball can be downloaded from its website. In particular, SDCC 3.4.0 has an issue with the library search path this can be worked around by explicitly specifying the path to the standard library when linking. While SDCC 3.4.0 should be sufficient for this tutorial, you might want to try a newer version in case you encounter any bugs. We used a USB-to-serial converter and gtkterm.ĭepending on your operating system there might be an easy way to install SDCC 3.5.0 or newer using a package system or similar (e.g. On the other end the serial cable is attached to an RS232 port on a computer running a terminal program configured for 9600 baud, no parity, 8 bits, 1 stop bit and no flow control.

stm8 cosmic tutorial

We connect the RS232 board to power pins and for data to the I/O pins (TxIN to PC3, RxOUT to PC2) the serial cable is then attached to the RS232 board. The board does have an USB connector, which can be used to power it, but it should only be used when there is no ST-Link attached. To write our program to the board, we attach a an ST-Link/V2.

  • stm8flash, to write programs onto devices.
  • The SDCC compiler, version 3.5.0 or later to compile C programs for the stm8.
  • I used a Debian GNU/Linux system, but the tutorial should work for other Linux distributions, *BSD or other Unices. This short tutorial presents a simple "Hello World" program for this setup, with an extra WaveShare RS232 board. There are cheap ST-Link/V2 devices available from China, and I bought one at 4.49€, putting the total price at 5.88 €, which is not that far from some of ST's STM8-Discovery boards. While the boards themselves are very cheap, an stlink is not included. For many other cheap boards these are not included. This board is actually already one of the better ones, since it has pin headers already mounted. It turned out to have an STM8S103F3P6 ♜ though. I bought one "STM8S003F3 Dev Board 5V/3.3V Power Input Onboard 3V3 Regulator" at 1.39€ including shipping. There are lots of very cheap STM8 development boards available from China.






    Stm8 cosmic tutorial