platformio / platform-ststm8

ST STM8: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm8
Apache License 2.0
41 stars 26 forks source link

Add as platfrom STM8 #1

Closed namoaton closed 5 years ago

namoaton commented 8 years ago

Board STM8L Discovery compiler SDCC - Small Device C Compiler

kissste commented 8 years ago

bump

xorbit commented 8 years ago

I would love to have this added as well

bergernetch commented 7 years ago

Would be great as there now is an ESP board with an STM8: ESP-14

jourjine commented 7 years ago

+1, please add support for stm8L family

javigf commented 7 years ago

+2, please add support for stm8L family

fuho commented 7 years ago

bump

tatulaiot commented 6 years ago

Not yet in Platformio??

kissste commented 6 years ago

nope

xorbit commented 6 years ago

In the mean time, there's this: https://stm8-binutils-gdb.sourceforge.io/ It seems to work well, and maybe Platform.io can use it as a base for integration?

dontsovcmc commented 5 years ago

+1

dontsovcmc commented 5 years ago

As I see STM8 supported by SDCC - Small Device C Compiler https://www.fischl.de/stm8/stm8svl_discovery_linux/

Khelicon commented 5 years ago

+1 for STM8L

DrNorfolk commented 5 years ago

I will be glad to see support of STM8!

ivankravets commented 5 years ago

Folks, do you have any board from this list https://github.com/tenbaht/sduino/blob/development/sduino/hardware/sduino/stm8/boards.txt ?

Gei0r commented 5 years ago

I have one of those extremely cheap STM8S103 breakout boards, which I guess is called stm8sblue in your link. Although my board has an STM8S103F2, which only has 4 KiB of Flash.

I'll be willing and able to help implementing and testing.

img_20181221_190403

ivankravets commented 5 years ago
  1. Please open PlatformIO IDE Terminal and type
    pio platform install https://github.com/platformio/platform-ststm8.git
  2. Restart VSCode and create a new project using PlatformIO IDE > PIO Home > New Project

Does it work?

Gei0r commented 5 years ago

I'm not using VS Code, I'm running platformio directly from the command line (plain cmd on Win10).

Compiling works.

But when uploading, the following error occurs:

Configuring upload protocol...
AVAILABLE: serial
CURRENT: upload_protocol = serial
Looking for upload port...
Error: Please specify `upload_port` for environment or use global `--upload-port` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
*** [upload] Explicit exit, status 1

Upload command should be:

stm8flash.exe -cstlinkv2 -pstm8s103f2 -s flash -w .pioenvs\blue\firmware.ihx

However, this command mysteriously only works about 10 % of the time. But that might be some bad wiring, I'll keep investigating. Edit: As I suspected, this was because of very shoddy dupont wires that came with my stlink.

Gei0r commented 5 years ago

I now tried VS Code. Same problem with the upload tool.

Another problem is that when creating a new project, a main.cpp file is automatically created, which confuses the build system (SDCC is only a C compiler):

Compiling .pioenvs\stm8sblue\FrameworkArduino\WInterrupts.c.rel
In file included from C:\users\a\.platformio\packages\framework-arduinoststm8\cores\sduino/Arduino.h:32:0,
from src\main.cpp:1:
C:\users\a\.platformio\packages\framework-arduinoststm8\STM8S_StdPeriph_Driver\inc/stm8s.h:90:3: error: #error "Unsupported Compiler!"
#error "Unsupported Compiler!"          /* Compiler defines not found */
^~~~~
In file included from C:\users\a\.platformio\packages\framework-arduinoststm8\cores\sduino/Arduino.h:32:0,
from src\main.cpp:1:
C:\users\a\.platformio\packages\framework-arduinoststm8\STM8S_StdPeriph_Driver\inc/stm8s.h:2762:11: fatal error: intrinsics.h: No such file or directory

It works when the main.cpp is manually renamed to main.c.

ivankravets commented 5 years ago

Resolved in https://github.com/platformio/platform-ststm8/releases/tag/v1.0.0

Please file a new issue if you have any problems.