Home > Hardware, STMicro STM32 > Meet STMicro STM8S Based One Dollar Development Board

Meet STMicro STM8S Based One Dollar Development Board

ESP8266 modules are $3 Wi-Fi boards targeting IoT applications that can be used in standalone mode, or connected to another MCU based board. But what if you don’t actually need Wi-Fi, but instead require a tiny board to control a few GPIOs? Arduino Pro mini can be used for this, but it costs about $10 on Sparkfun, and it’s certainly cheap enough for most projects. Switching to Aliexpress, you can get Arduino Pro mini clones for about $2, and a bit less in 10 pieces quantities. But you can get even cheaper and add a micro USB port with STMicro STM8S based boards that can be found for 5.5 CNY (Less than $1) on Taobao.com, or – once oversea shipping is factored in – about $1.60 to $1.70 on BuyInCoins, or Aliexpress without headers, and the version with headers sells for about $2 or more.

One_dollar_development_boardLet’s check the board specifications:

  • MCU – STMicro STM8S103F3P6 8-bit MCU @ 16 MHz, with 1KB SRAM, 8KB flash, and 640 bytes EEPROM
  • USB – micro USB port for power and programming
  • Headers
    • 2x 10-pin (2.54 mm) with access to 3.3V (out), 5V (in), GND, GPIOs, I2C, UART, SPI, ADC, and PWM (TIM2).
    • 4-pin debug header (SWIM)
  • Misc – Reset button, Power and user (test) LED.
  • Power Supply – 5V via micro USB, or 4.4 – 15V input via -/+ through holes.
  • Dimensions – 3cm x 1.8cm

Sometimes boards sold on Chinese website have zero documentation and tools, but that one has some documents, tools, and source code. It’s

STM8S Board Schematics (Click to Enlarge)

STM8S Board Schematics (Click to Enlarge)

I could find three files:

  • STM8系列程序资料.zip – Datasheet, schematics, and code samples for STVP and IAR
  • STM8软件工具.zip – With ST Visual Programmer (STVP) and IAR development tool (Windows only), as well as ST-Link drivers.
  • STM8其他资料.zip – Some other documents including university papers, datasheets, and getting started guide (All in Chinese), as well as some other example projects.
STVP

STVP (Click to Enlarge)

So everything seems there, but it won’t be as easy to use as the Arduino boards. [Update: As mentioned in comments the MCU does not have a USB interface, so the micro USB is only for power, and you’ll need an extra ST-Link debug board to program the boards]

Thanks to Onebir for the tip.

  1. deets
    January 18th, 2015 at 12:33 | #1

    “micro USB port for power and programming”

    I think the USB port is for power only given that the MCU doesn’t support USB and the data lines are not connected on time schematic.

  2. January 18th, 2015 at 13:34 | #2

    @deets
    Yes, you’re right. So programming must be done via the Single Wire Interface with something like ST-LinkV2 then: http://www.ebay.com/itm/ST-LINK-V2-CN-STM8-STM32-JTAG-SWD-SWIM-In-circuit-Debugger-Programmer-Emulator-/261064535942

  3. deets
    January 18th, 2015 at 17:02 | #4

    @cnxsoft
    Thanks. When are you going to do a writeup on linkit connect?

  4. January 18th, 2015 at 17:21 | #5

    There is also SDCC support for this chip.

    And you can also find it at Electrodragon.

    No onchip usb in there, but i think i saw some vusb code somewhere on hackaday.

  5. January 18th, 2015 at 19:45 | #6

    @deets
    Never heard about it. But maybe tomorrow if I can find enough information. It looks like it’s not been announced yet, but they have some docs up already.

  6. Nils
    January 18th, 2015 at 19:51 | #7

    zoobab :
    There is also SDCC support for this chip.
    And you can also find it at Electrodragon.
    No onchip usb in there, but i think i saw some vusb code somewhere on hackaday.

    Yep, SDCC supports the STM8.

  7. January 18th, 2015 at 20:48 | #9
  8. deets
  9. January 19th, 2015 at 22:22 | #11

    Or you could get this stm8 discovery board, it have st link 2 inside.
    http://my.element14.com/stmicroelectronics/stm8s-discovery/stm8s-w-st-link-discovery-kit/dp/1775251

  10. Mike
    January 21st, 2015 at 03:45 | #12

    What tools are needed? I don’t think Arduino tools build for STM8 target.
    8KB of Flash may be too small. Arduino ATmega328P has 32kB

  11. January 21st, 2015 at 09:29 | #13

    @Mike
    Windows or Linux tools. It’s explained in the post and comments.

  12. Johanus
    May 12th, 2015 at 19:02 | #14

    The STM8 links to the baidu site above don’t seem to work. Sent me to error page saying ‘downloads are cancelled’.

    Are there are other links to development tools for these inexpensive STM boards?

  13. May 30th, 2015 at 04:35 | #15

    @Nils
    I wrote some basic (led counter incrementing once per second, Whetstone and Dhrystone benchmarks) tutorials for stm8 development on Linux with the sdcc compiler:
    http://colecovision.eu/stm8/
    So far there are only versions for two boards, but when I find time, I’ll add more.

    Philipp

  14. June 6th, 2015 at 06:07 | #16

    Your STM8S Board Schematics is wrong: The Test LED is between Ports D3 und B5. You can see it on your own photos.

  15. Rohit
    July 29th, 2015 at 05:25 | #17

    @Torsten C
    True! I also had some headache with electrodragon supplied schematic! It doesn’t match with my board which has LED on PB5 whereas in the electrodragon’s and above schematic it is shown PD3

  16. Teo
    December 12th, 2015 at 07:18 | #18

    You can write asm code for any STM7-8 with windows ST Visual Develop and debug with an STLinkV2 which is a matter of 3-4$ (just use native ST assembly toolchain).
    To use C source with ST Visual Develop and take benefith of the debug process i don’t know any toolchain except Raisonance and Cosmic solutions which are paid ones (but highly professional).
    You can also compile C code using sdcc on any operating system that supports it. There are also many ide supporting it.
    To upload/burn software, there is a free ST Visual Programmer for Windows and on linux/osx you can use stm8flash library, open source and public on github.

  17. Teo
    December 12th, 2015 at 18:56 | #19

    I just discovered that the Cosmic toolset is free up to 8Kb

  18. December 15th, 2015 at 17:03 | #20

    i tried for a while to build a hex disassembler but i am so mad that st won’t tell me how to get the stvd disassemble window to disassemble hex. or anything!!! hive me inspiration or help or sometyhing. p.s. i have the stlink and can write hex to the mcu and retrieve writen hex from the mcu. i just want to disassemble it so i can debug it

  19. December 15th, 2015 at 17:09 | #21

    @jonathan scott james
    I’m not sure about the Windows tools, I’ve only used Linux -> http://www.cnx-software.com/2015/04/13/how-to-program-stm8s-1-board-in-linux/

    But I have not tried to disassemble the hex, but it looks like something GNU tools would be able to do.

  20. December 19th, 2015 at 00:11 | #22

    Hello everyone,
    This STM8 dev board is amazing. I selected it for my Internet Of Things Platform.
    It’s an open Hardware + Open Software project on Github. You’ll find there samples for the free development environment (IAR) for RGB leds, temperature sensor, nRF24L01p radio module,…
    http://www.homesmartmesh.com/mediawiki/index.php/IoT_Node

  21. June 16th, 2016 at 01:27 | #23

    A comparison of 4 current (mid 2016) C compilers for the STM8 can be found at:
    http://colecovision.eu/stm8/compilers.shtml

    Philipp

  1. April 13th, 2015 at 17:00 | #1
  2. April 30th, 2015 at 15:15 | #2
  3. October 26th, 2015 at 18:30 | #3