Introducing Sduino for the STM8

Arduino on the STM8 (8 bit processor)
MarkB
Posts: 10
Joined: Sun Oct 02, 2016 11:40 pm

Re: Introducing Sduino for the STM8

Post by MarkB » Mon Oct 23, 2017 4:41 pm

ag123 wrote:
Sat Oct 21, 2017 4:49 pm
any one figured out more than the above? which seem to suggest debug for stm8s is probably hitting a wall with open sourced tools.
Having fallen deep down the eForth rabbit hole, I haven't got around to trying it out, but there is an STM8 into GDB project here since earlier this year: https://sourceforge.net/projects/stm8-b ... gdb/files/

tenbaht
Posts: 12
Joined: Wed Oct 11, 2017 3:10 pm

Re: Introducing Sduino for the STM8

Post by tenbaht » Mon Oct 23, 2017 9:01 pm

STM8 support in SDCC is progressing fast in the last 12 months and IMHO perfectly production ready. The code size still seems to be bigger than with the commercial compilers, but I never investigated in detail how big the difference really is.

I really love the very direct access to the inner workings of the compilation stages, especially the extremely useful assembler listings. That is much better than for any other compiler I have used so far.

The simulator is progressing as well, but it is not yet for production use.

STM8 supports debugging via ST-Link. Are you aware of this project: https://stm8-binutils-gdb.sourceforge.io/ ? OpenOCD and gdb support for the STM8 via ST-Link. I didn't try it myself yet, but it sounds very interesting.
https://github.com/tenbaht/sduino - Programming the STM8 the Arduino way

gungsukma
Posts: 6
Joined: Thu Jan 12, 2017 5:44 am

Re: Introducing Sduino for the STM8

Post by gungsukma » Mon Nov 27, 2017 7:31 am

Please add a menu or something to unlock the protected chip

On linux terminal, it is:
echo "00 00 ff 00 ff 00 ff 00 ff 00 ff" | xxd -r -p > factory_defaults.bin
stm8flash -c stlinkv2 -p stm8s103f3 -s opt -w factory_defaults.bin

evildave_666
Posts: 34
Joined: Mon Apr 27, 2015 11:20 pm

Re: Introducing Sduino for the STM8

Post by evildave_666 » Wed Dec 06, 2017 3:29 am

Is it intentional that a board manager install is unable to directly access include paths and I still have to manually copy header/library files from the library directories when using the IDE or is my install somehow corrupt (something that's not entirely unlikely since I have half a dozen other cores installed)?

tenbaht
Posts: 12
Joined: Wed Oct 11, 2017 3:10 pm

Re: Introducing Sduino for the STM8

Post by tenbaht » Wed Dec 06, 2017 12:31 pm

No, you are not expected to copy library files. It should just work - the same way it does for the regular Arduino libs. But it only works for libraries that are modified for use with Sduino as most Arduino libs are written in C++ instead of plain C.

What exactly are you trying to do?
https://github.com/tenbaht/sduino - Programming the STM8 the Arduino way

tenbaht
Posts: 12
Joined: Wed Oct 11, 2017 3:10 pm

Re: Introducing Sduino for the STM8

Post by tenbaht » Wed Dec 06, 2017 12:39 pm

gungsukma wrote:
Mon Nov 27, 2017 7:31 am
Please add a menu or something to unlock the protected chip
Good suggestion, thank you. I set up a feature request: https://github.com/tenbaht/sduino/issues/37
I am little busy right now, but I will look into it as soon as time permits.
https://github.com/tenbaht/sduino - Programming the STM8 the Arduino way

evildave_666
Posts: 34
Joined: Mon Apr 27, 2015 11:20 pm

Re: Introducing Sduino for the STM8

Post by evildave_666 » Wed Dec 06, 2017 3:38 pm

tenbaht wrote:
Wed Dec 06, 2017 12:31 pm

What exactly are you trying to do?
Just compiling a simple sweep program using the servo library is failing due to not finding Servo.h unless I copy it and the rest of the library directory into my sketch.

If it is supposed to work I think I'm going to have to try a fresh install due to how many cores I have cluttering things up.

Jimmus
Posts: 15
Joined: Tue Nov 28, 2017 4:08 am

Re: Introducing Sduino for the STM8

Post by Jimmus » Thu Jan 04, 2018 9:33 pm

I love these things! I bought 5 mini boards from Hong Kong because it was $4.95 and I like the idea. I thought it might be a pain to get them going or I might have to program them in Assembler or something. Thanks to tenbaht, it was way easier than I expected.

It did take me about 20 minutes to figure out how to get my STLink gadget working. And figuring out which pins to connect to the serial adapter, and how to convert the Serial.print() to Serial_print_s() calls took a little bit longer. I wish there were a couple of sample programs somewhere I could have looked at. They could have saved me some time.

I really like the 5v tolerance of these things. Why do they even have a voltage regulator? I ripped the voltage regulator and power indicator LED off one of them so I could kick it into power saving mode. It still runs off one 18650 or three AAA batteries. It sure makes it easier to figure out how to power it.

zmemw16
Posts: 1608
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Introducing Sduino for the STM8

Post by zmemw16 » Fri Jan 05, 2018 12:50 am

why don't you post your code 'noddies' in snippets ?
simply what you've got would help us all.
srp

User avatar
mrburnette
Posts: 2062
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Introducing Sduino for the STM8

Post by mrburnette » Fri Jan 05, 2018 12:56 am

Jimmus wrote:
Thu Jan 04, 2018 9:33 pm
I love these things!
<...>
Just curious as I used to get some kicks from the ATtiny85... (cheap, used to buy 'em in 25x qty.)

I get the $1 each approx. board price, but can you share your use cases for the STM8?

The STM32-bit blue boards are at $2 or 100% cost premium for 20x SRAM
The 8-bit ATmega328P mini is a 70% cost premium* and has 2x SRAM and is 100% Arduino compatible (higher Isink and Isource, too)

* An ATmega328P mini is $1.70 qty 10x from Aliexpress)

Ray

Code: Select all

Key Features

Core
16 MHz advanced STM8 core with Harvard architecture and 3-stage pipeline
Extended instruction set
Memories
Program memory: 8 Kbyte Flash; data retention 20 years at 55 °C after 10 kcycle
Data memory: 640 byte true data EEPROM; endurance 300 kcycle
RAM: 1 Kbyte
Clock, reset and supply management
2.95 to 5.5 V operating voltage
Flexible clock control, 4 master clock sources
Low power crystal resonator oscillator
External clock input
Internal, user-trimmable 16 MHz RC
Internal low-power 128 kHz RC
Clock security system with clock monitor
Power management:
Low-power modes (wait, active-halt, halt)
Switch-off peripheral clocks individually
Permanently active, low-consumption power-on and power-down reset
Interrupt management
Nested interrupt controller with 32 interrupts
Up to 27 external interrupts on 6 vectors
Timers
Advanced control timer: 16-bit, 4 CAPCOM channels, 3 complementary outputs, dead-time insertion and flexible synchronization
16-bit general purpose timer, with 3 CAPCOM channels (IC, OC or PWM)
8-bit basic timer with 8-bit prescaler
Auto wake-up timer
Window watchdog and independent watchdog timers
Communication interfaces
UART with clock output for synchronous operation, SmartCard, IrDA, LIN master mode
SPI interface up to 8 Mbit/s
I2C interface up to 400 kbit/s
Analog to digital converter (ADC)
10-bit, ±1 LSB ADC with up to 5 multiplexed channels, scan mode and analog watchdog
I/Os
Up to 28 I/Os on a 32-pin package including 21 high sink outputs
Highly robust I/O design, immune against current injection
Image

Post Reply