11# STM8S Discovery
22
3+ A widespread evaluation board made by ST. All CPU pin are easily accessible
4+ on 2x6 pin headers. It costs only $9 and includes a ST-Link/v1 flash
5+ programmer on board.
6+
7+ It should work now, but the support is very fresh and not thoroughly tested.
8+ At least Blink.c is known to work already.
9+
310STM8S105C6T6 microcontroller, 32 KB Flash, 2 KB RAM, 1 KB EEPROM
411
512 - LED on PD0, active low.
613 - Touch button on PC1, PC2.
7- - external cristal 16MHz on PA1/PA2
14+ - external crystal 16MHz on PA1/PA2
815
916
1017
@@ -23,26 +30,37 @@ Pin | Signal
2330## Usage with Linux and stm8flash
2431
2532The discovery board implements two USB devices: A ST-LINK/V1 interface and a
26- (not very useful) mass storage device with some links to the ST website.
27- The implementation of this mass storage device is very buggy and renders the
33+ (not very useful) mass storage device with some links to the ST website. The
34+ implementation of this mass storage device is very buggy and renders the
2835hole board useless. You need to make modprobe to ignore it by adding this
2936line to /etc/modprobe.conf or by adding a file
3037/etc/modprobe.d/stdiscovery.conf with this line:
3138
3239 options usb-storage quirks=0483:3744:i
3340
34- Unplug the Discovery board, unload the usb mass storage driver with
41+ Unplug the Discovery board and unload the usb mass storage driver with
3542
3643 modprobe -r uas usb_storage
3744
38- and reconnect the board. If you can't unload the usb_storage drive because
39- it is in use with other devices you can temporary trigger the same effect by
40- this line:
45+ If you can't unload the usb_storage drive because it is in use with other
46+ devices you can temporary trigger the same effect by this line:
4147
4248 echo "0483:3744:i" >/sys/module/usb_storage/parameters/quirks
4349
44- Now dmesg should show that the mass storage device of the Discovery board is
45- ignored:
50+ The second step is to add a new udev rule in order to access the USB port.
51+ Save this as root in in ` /etc/udev/rules.d/99-stlink.rules ` :
52+
53+ # ST-Link/V2 programming adapter
54+
55+ # ST-Link V1, if using a STM8S discovery board
56+ # important: It needs a special entry in /etc/modprob/blacklist
57+ ATTR{idVendor}=="0483", ATTR{idProduct}=="3744", MODE="0666", GROUP="plugdev"
58+
59+ # ST-Link/V2, the china adapter with the green plastic housing
60+ ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666", GROUP="plugdev"
61+
62+ Finally, it is time to (re-) connect the board. Now dmesg should show that
63+ the mass storage device of the Discovery board is ignored:
4664
4765 [ 815.228928] usbcore: deregistering interface driver uas
4866 [ 815.229201] usbcore: deregistering interface driver usb-storage
0 commit comments