STM8L at the center of the STM8 eForth 2.2.26 development cycle

A project log for eForth for cheap STM8S gadgets

Turn cheap modules from AliExpress into interactive development kits!

ThomasThomas 08/22/2020 at 06:290 Comments

This release will be about STM8L devices (i.e. the likes of STM8L051F3, STM8L151R6 or STM8L162R8). While STM8S peripherals are simple and the pin and clock configuration is trivial, the STML designers clearly had both many more, and much larger, spec sheets.

Many "more specs" one can clearly see in the number of configuration dependencies one has to infer when configuring one of the many features of the peripherals. @Andrew Clapp started with the C code abstractions for STM8L051 provided by ST: it turned out that it's easy to get results but the code uses the peripherals in a quite wasteful way (e.g. repeated initialization). The code, however, shows that ST's library designers also had a hard time creating something that's both flexible and lean. 

For STM8 eForth this means that some things that were implicit or hard-coded need to be reviewed and restructured, and tested. A good example is Issue #340: the background task priority now works across devices and families (although STM8L is still limited to using TIM2 for the BG interrupt).

Another target is symbol files: @Eelco provided a first draft of an STM8L151.efr file. I then made a synthesis of datasheets and improved the generic STM8L.efr so that it covers most STM8L devices (that is all except the STM8L101 family).

On GitHub you'll find a new pre-release STM8 eForth 2.2.26.pre2 that contains the changes mentioned above and some more goodies.