STM8 for dummies?

Due to a weird turn of events, I need to program on an STM8S003F3 - the program will read an i2c device's output, small analysis and print on an LED display.

I ordered a couple of eval boards and a SWIM interface. One of them I will program to simulate the i2c data source and then I could play with the device I am developing.

However, the really bad part of my situation is that I am a software developer (not even a good one) for x86-64 (ie: "regular computers"), mainly Java server/db stuff...

My "accomplice" :slight_smile: will help with wiring and general hardware stuff but he's not an expert on STM8 and his knowledge stops at MCU's. He can barely program an arduino for a few simple things.

I've done a lot of digging in google and the best I could find is:

You can see this guy knows what he's talking about but his style is a little too messy for a beginner like me, who doesn't feel very secure as it is...

Could you please advice of any nice resources to learn this thing? I reckon my main problem would be that I don't know the API or routines or whatever you call the primitive methods and data types for programming that chip...

I guess more beginner questions will follow. I hope not to exceed my welcome!

The Arduino ecosystem is a simplified API that was initially applied to AVR processors, but there exists support for Arduino or Arduino-like APIs for processors from a wide variety of manufacturers. The issue in general with non-AVR processors is that drivers for specific external peripherals (e.g. your I2C device) may have to be ported.

STM has Arduino support for the STM8 which is an abstraction layer on top of STM's full "professional development" API: GitHub - stm32duino/Arduino_Core_STM8: STM8 core support for Arduino I haven't used this, so can't speak to how well it all comes together. My impression is that they're mostly targeting this for higher end STM8 processors than the STM8S003F3, but people have used it on that device. The install process involves getting the free version of their licensed C++ compiler so one has to register an account.

There is an open source Arduino-like project "Sduino" that uses the open-source SDCC compiler. Since SDCC is C, not C++ like Arduino, there are differences in the API and it does not have the full range of Arduino functionality. I've used this and it is straightforward to install and use for small projects. Without knowing the details of your project beyond i2c, I'd start here. It's likely you'll have to write or port a device specific driver for your I2C device. GitHub - tenbaht/sduino: An Arduino-like programming API for the STM8

There are, of course, STM's "professional" development environments which have libraries giving much more control over the processor details at the cost of requiring a much greater investment in understanding the library to do even simple things. I've played a bit with the free (licensed) STM Studio, but the learning curve is much steeper than the Arduino approach. The free version of STM Studio limits the size of the executable but they are large enough to not restrict the STM8S003F3 since it has only 8k bytes of flash anyway.

On completely different tack, there is an open-source implementation of FORTH that targets STM8 and mostly the STM8S003F3 / STM8S103F3 variant. FORTH is a bit of a relic from the days when hobby computers all had a few kilobytes of memory and thus there was wide-spread utility in a self-hosted interactive console and compiler running on such limited hardware. This is still useful for exploring the capabilities of the internal peripheral set of the MCU and the documentation for this project is extensive and exceptionally well done. On the other hand one will inevitably have to crack open the STM8 technical manuals and do low level coding to do much with the device peripherals.GitHub - TG9541/stm8ef: STM8 eForth: a user-friendly Forth for cheap µCs with docs

much obliged, sir!
It's a friend of mine who got stuck and this is his last chance to keep his company alive. He's much closer to the topic than I am but I think he's, at this point, mentally exhausted. I hope with my efforts to program his chips so his boards can be delivered to customers, that he gets some wind back in the sails and we'd have saved a brilliant hardware designer!

To others who may have stumbled on this topic in search of similar information, I would like to bring up the following resource I was able to find (by nagging to everyone I can):

It looks very friendly and comprehensive.
I'll give both approaches my best.

Definitely, once I get something going I will post a video for dummies like me to get a foot into the STM8 and then be able to study and research the topic with confidence.

Thanks again