tenbaht / sduino

An Arduino-like programming API for the STM8
http://tenbaht.github.io/sduino/
GNU Lesser General Public License v2.1
347 stars 213 forks source link

Not able to upload sketch to STM8S207C8T #112

Open Katzuno opened 3 years ago

Katzuno commented 3 years ago

Hello, I am trying to upload an example sketch to my new STM8S Board. I connected it to my PC using STLink/V2 Programmer.

Even with the Bare Minimum sketch I get the following error:


C:\Users\ADIDAN\AppData\Local\Arduino15\packages\sduino\tools\STM8Tools\2019.02.05/win/stm8flash -cstlinkv2 -pstm8s208?b -s flash -w C:\Users\ADIDAN\AppData\Local\Temp\arduino_build_186416/BareMinimum.ino.hex 
Determine FLASH area

libusb: info [cache_config_descriptors] could not access configuration descriptor (dummy) for '\\.\USB#VID_413C&PID_2513#5&2E1297A2&0&3': [31] A device attached to the system is not functioning.
Due to its file extension (or lack thereof), "C:\Users\ADIDAN\AppData\Local\Temp\arduino_build_186416/BareMinimum.ino.hex" is considered as INTEL HEX format!
1194 bytes at 0x8000... Tries exceeded
An error occurred while uploading the sketch

I think I am doing something wrong or missed a step.

Tools -> Upload method is ST-Link/V2 I selected the board: sduino MB (STM8S208MB6TB).

I hope someone can help me.

Thank you.

roybaer commented 3 years ago

There appear to be multiple issues, namely hardware and/or driver issues that prevent access to the programmer and missing support for your board.

The sduino MB is a prototypical board in Arduino Mega form factor designed by me and the matching board configuration has been written specifically for it. The STM8S208MBT6B and the STM8S207C8Tx have at least different pinouts and flash sizes and slightly different peripherals. I am therefore not sure how well a program compiled for one would run on the other.

If you cannot resolve your hardware or driver issue with the programming adapter, you could also try programming via TTL serial port adapter and the chip's integrated ROM bootloader. This is the preferred method on the sduino MB, because the board has its own USB-to-TTL-serial converter just like the Arduino boards.

Can you provide more details on the exact type of STM8S board you are using? A link, maybe?

Katzuno commented 3 years ago

Hello, I am using a new STB8S207C8T6 unmapped in a SIM808 application and I am using ST-Link V2 as a programmer.

Is there a possibility or a program to configure this STM8S and use the sduino library?

Thank you.

roybaer commented 3 years ago

If you are using the STM8S207C8T6 in a custom hardware configuration, nothing will lead around a custom software configuration.

You can create a new entry for your setup in boards.txt and add a matching new board variant with its own pins_arduino.h. Ideally, you would use mb208 as a template, because it is already quite similar. You will have to consult the datasheet to figure out a sensible pinout, although you could perhaps borrow some of it from the stm8disco variant, because it has a 48-pin chip, as well.

But the very first thing you should do is figure out the driver situation. Unfortunately, I cannot help you with Windows configuration, because I do not use that operating system. Also keep in mind that Sduino is C-based and therefore not entirely Arduino compatible and that it is still highly experimental.