summaryrefslogtreecommitdiff
path: root/README
blob: d7de35f6759bd9c72712c56ad373a123681c923d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Dependencies
============

make
sdcc
libusb-dev (for stm8flash)


udev example rules
==================

STM8S-Discovery:
----------------

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE:="0666", GROUP:="dialout", SYMLINK+="stlink_%n"

The discovery board also emulates an USB mass storage device. However the
implementation is buggy and it doesn't really work with linux. It's best to
just ignore the usb-storage endpoints. You can do this temporarly using the
following command:

  # echo "0483:3744:i" >/sys/module/usb_storage/parameters/quirks

To make this permanent, create a file '/etc/modprobe.d/stdiscovery.conf' with
the following content:

<snip>
options usb-storage quirks=0483:3744:i
</snip>

The changes will take effect on next reboot or after manually unloading the
usb-storage driver

  # modprobe -r usb_storage

This might not work if there is another device connected that is or emulates
an USB storage device.


Build
=====

Getting the source via GIT:
---------------------------

git clone git://git.spreadspace.org/stm8-utils.git
cd stm8-utils
make -C contrib

build and flash blink example
-----------------------------

# cd blink
adapt Makefile (set BOARD_TYPE)
# make program


Some Hints
==========

The object files for builded libs will be called lib-<name>.o so make sure
not to use files named like this for your own code. i.e. if you want
to use the `led` library it's not possible to have a source file name
lib-led.c inside your project.

To use the STM8S StdPeriph Library in your project you have to provide the
path to the library source code. You may do this by calling `make` inside
the contrib tree. But any external path is ok. In order to build the spl
object file the build system has to call `make clean` inside the SPL_PATH
so make sure there is no build inside which you still need. Also paralell
builds of several projects using the same SPL_PATH is not possible.

License
=======

The spreadspace STM8 utils are licensed under GPLv3. You can find the
full text of the license in the file LICENSE.