gicking / stm8gal

PC tool for uplading hexfiles to the STM8 microcontroller via UART or SPI , using the built-in ROM bootloader. Works under Windows and Posix operating systems
Apache License 2.0
80 stars 21 forks source link

open port failed under mac and ubuntu wsl #30

Closed alex-frx closed 1 year ago

alex-frx commented 1 year ago

I get the error open serial port '/dev/bus/usb/001' ... Error: in 'init_port(/dev/bus/usb/001)': open port failed under mac and ubuntu wsl lsusb output:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0483:3748 STMicroelectronics ST-LINK/V2
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

command i run: sudo stm8gal -p /dev/bus/usb/001 -w STM8L15X_MD.hex with and without sudo

stm8gal -p does not list anything

maybe its my programmeri dont know. just wanted to let you know! stm8flash is working - if we work this out together i can provide Mac os m1 builds :)

gicking commented 1 year ago

I just checked back on this issue and found that my response from ~2 weeks ago somehow got lost... Darn! :-(

stm8gal is a tool to upload code to STM8 using the ROM bootloader. Specifically most devices support flashing not only via SWIM/ST-Link, but also via UART, SPI or CAN (if present). This often allows flashing a gadget via the external interface without access to the PCB. Most commonly used is the UART interface via a USB<->UART adapter. This should show up under MacOSX (and Linux) as a serial device, e.g. /dev/ttyACM0. Under Windows this would be COM1 or so.

However, your lsusb output above indicates that you want to program via ST-Link and the SWIM debug interface, not UART. If this is correct(?), you can e.g. use the stm8flash tool, which AFAIK also works under MacOSX.

Please let me know if this solves your problem, then I can close this issue. Thanks a lot in advance!

alex-frx commented 1 year ago

Thank you for the extensive answer! :) Learned a lot about the stm8 in the last few weeks. Yes I tried programming it via the ST-Link - came from the Arduino world an was expecting that UART is exposed via usb. And Yes stm8flash works on MacOs fine.