Close

Initial Support for STM8L051F3

A project log for eForth for cheap STM8S gadgets

Turn cheap modules from AliExpress into interactive development kits!

thomasThomas 12/29/2017 at 21:186 Comments

I had ordered a couple of STM8L051F3P6 chips months ago, and soldered one of them to a breakout-board. I had thought that getting them to work with STM8 eForth would be a matter of minutes.

I was wrong.

What I didn't take into account is that the STM8L family is a complete remake of the STM8S. It comes with a new reference manual RM0031 (597 pages) and it's up to the user to compare it with the 462 pages of the STM8S manual to find the many breaking changes. Nice job, ST!

However, after creating new register symbol files and after understanding that GPIOs for peripherals have to be assigned in many cases, I had a STM8 eForth console running. Compiling Forth code to Flash also works. The background task requires some fixing (the interrupt vector of TIM2 has changed).

The STM8L family appears to have a much richer set of peripherals (DMA, 12bit ADC, RTC), much like an STM32 chip only with less memory, and a fraction of the CPU power. Of course, the STM32F030, which in small quantities costs about the same, is better in almost all parameters (except the minimum supply voltage).

EDIT: the interrupt vector issues are now fixed, and the STM8L051F3 configuration is ready to use.

Discussions

Andrew Clapp wrote 05/05/2020 at 17:46 point

Just got my L051's in the mail!  Excited to make a board and get going today!

  Are you sure? yes | no

Thomas wrote 05/06/2020 at 05:31 point

Some takeaways from our discussion .in the HaD chat:

* for STM8L STM8 eForth currently doesn't support the simulated serial port (due to differences in handling GPIO compared with the STM8S family)

* the serial console can either use [ pin5-PA2-USART-TX, pin6-PA3-USART-RX ] or [ pin1-PC5-USART-TX, pin2-PC6-USART-RX ]

* the steps for selecting the USART GPIO pair is explained in the README.md.

... and I just got the message that the chip works on the breadboard. Congrats!

  Are you sure? yes | no

Andrew Clapp wrote 04/28/2020 at 17:47 point

It looks like they just want to use the STM8L051F3 for the 12 bit ADC.  I did not find support for it in sduino, so I was a little concerned at first.  If they want to change the chip, I'll just use forth.  :-)

  Are you sure? yes | no

Thomas wrote 04/28/2020 at 18:36 point

For the sduiono community it's the same as for everybody else who has an STM8S code base: the core is the same but the peripherals make the STM8L a different platform.

Getting a team to accept Forth might be a challenging, but that depends on the team, of course :-). Mixing in some C might help to sweeten the deal.

  Are you sure? yes | no

Andrew Clapp wrote 04/28/2020 at 16:58 point

This is great!  I was just "informed" that we may be moving to this chip for my project at work.

  Are you sure? yes | no

Thomas wrote 04/28/2020 at 17:45 point

Thanks to a number of community contributions support for the STM8L family is much better now than then :-)

STM8L Low Density devices are quite nice and the peripherals are clearly superior to those of the STM8S family. STM8L Medium and High Density are even better but I'd rather think twice before picking the STM8L101 (or STM8L001) unless their specific feature set provides a very good reason for using it.

  Are you sure? yes | no