Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for STM8L101 and STM8L001 #349

Closed
TG9541 opened this issue Sep 19, 2020 · 1 comment
Closed

Add support for STM8L101 and STM8L001 #349

TG9541 opened this issue Sep 19, 2020 · 1 comment
Assignees

Comments

@TG9541
Copy link
Owner

TG9541 commented Sep 19, 2020

Yes, really. There will be some editing to do in the docs because I frequently stated that it's not possible.

What changed: with the help of OpenOCD (0.10.0+dev-01404-g3934483-dirty), an upgraded cheapo STLINK "V2J35S7 (API v2)" and STM8-GDB (8.1 with stm8-binutils patches)and a recent SDCC (4.0.3) I wasn't only able to flash a device (it never worked for me with stm8flash on Linux) but also to debug it step by step. Findings about the required OpenOCD configuration are here and here.

The new port shall support the following features:

  • viable memory layout for 1.5K RAM
  • UART for the console
  • some kind of anti-lock-out for STM8L001J3M3 (SWIM and TX share the same pin, again, but there is no UART bidirectional "hdx" mode)
  • no ADC words (no use for those)
  • background task with (at least) TIM2

Bonus:

  • A solution for the EEPROM (which is, in fact, a section of the Flash ROM)
  • Simulated serial (for substituting the missing UART hdx)
@TG9541 TG9541 self-assigned this Sep 19, 2020
@TG9541 TG9541 closed this as completed in 0aec088 Sep 20, 2020
TG9541 added a commit that referenced this issue Sep 20, 2020
fixes #349 add support for STM8L101 Low Density device family
@TG9541
Copy link
Owner Author

TG9541 commented Sep 23, 2020

Some STM8L001J3M3 test results:

  • flashing a chip finally worked (it took a change in the OpenOCD target config)
  • PC3/USART_TX won't block PA0/SWIM as long as the PC3 PC_DDR and PC_CR1 bits remain in reset state and an external pull-up is used instead
  • The simulated serial interface (using TIM4 and GPIO interrupts) works

Since the STM8L USART doesn't support half-duplex mode or GPIO remapping (both are STM8S Low Density features) practical application of this SOP-8 device with 6 GPIOs probably benefit from using some sort of bidirectional UART implementation on pin1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant