cancel
Showing results for 
Search instead for 
Did you mean: 

I'd like to share an STM8 emulator I've been writing for the last few weeks.

MCham.3
Associate II

I'm writing an STM8 emulator. Maybe it will be useful to someone else as well. It's still early on in development, but it's working. The peripheral support is minimal right now. Only UART1, UART3, TIM2, ADC and GPIO (which isn't really a peripheral per se). And those supported are not all 100% complete.

My main focus right now is filling out the range of supported peripherals, and cleaning up the CPU core code a bit. I'd also like to have a proper disassembler in the future that can spit the instructions back out into readable assembly, and the ability to step through code slowly while examining register and memory behavior.

Here's the code as it stands now. It can load ELF files and run them, and UART can be redirected to stdio console, serial port or a TCP socket. (Server mode only for the TCP at the moment)

https://github.com/mikechambers84/STM8-Emulator

Current supported STM8 models are:

  • STM8S003F3 (Flash: 8 KB, RAM: 1 KB, EEPROM: 128 bytes)
  • STM8S207S6 (Flash: 32 KB, RAM: 6 KB, EEPROM: 1 KB)
  • STM8S207R8 (Flash: 64 KB, RAM: 6 KB, EEPROM: 2 KB)

It did have some text console representations of a few products designed by the company I work for, which could be interacted with. Character displays, LEDs, buttons, etc. But I removed those because I didn't want to share any of our proprietary designs. I may recreate something similar soon, but just with recreations of some of the ST Discovery boards instead.

I didn't write this specifically for my employer, it was done on my own time for fun and education, but I've been using it at work to speed up firmware development.

0 REPLIES 0