|
1 | | -# Installing the needed tools |
| 1 | +# Installation |
| 2 | + |
| 3 | +Supported Systems: |
| 4 | + |
| 5 | +* Linux 64 bit: Tested on Ubuntu 16.04 |
| 6 | +* Linux 32 bit: Tested on Ubuntu 16.04 |
| 7 | +* Windows: Tested on Windows 7. Sduino might work on XP (not tested), but |
| 8 | + the ST-Link/V2 driver is not available anymore for XP. |
| 9 | +* MacOS: Not tested, but should be very close to working. Will need a manual |
| 10 | + install, but IDE integration should be easy now. Any volunteers? |
| 11 | +* Raspian/Raspberry Pi: Untested. Will require a manual install. |
| 12 | + |
| 13 | + |
| 14 | +## GUI install |
| 15 | + |
| 16 | +Starting with version 0.3.0 automatic IDE integration is supported via the |
| 17 | +Arduino Boards Manager. This is the recommanded way of installation now. |
| 18 | +Arduino IDE versions 1.8.5 and 1.6.13 are tested, but any version >=1.6.6 |
| 19 | +should work. |
| 20 | + |
| 21 | +Start the Arduino-IDE. In File->Preferences, Settings tab, enter |
| 22 | + |
| 23 | + https://github.com/tenbaht/sduino/raw/master/package_sduino_stm8_index.json |
| 24 | + |
| 25 | +as an Additional Boards Manager URL. |
| 26 | + |
| 27 | +Open Tools->Board:...->Boards Manager. Find Sduino by typing 'sd' into |
| 28 | +the search line. Click on the list entry, Click on Install. |
| 29 | + |
| 30 | +Now you should find a new entry "STM8S Boards" in the list at |
| 31 | +Tools->Board:... Choose *STM8S103F3 Breakout Board* from the list, open the |
| 32 | +standard Blink example from File->Examples->01. Basics->Blink and compile it |
| 33 | +by hitting 'Verify'. |
| 34 | + |
| 35 | + |
| 36 | +### using make on the command line |
| 37 | + |
| 38 | +All the needed tools are now installed, but they are not in your path or |
| 39 | +where the Makefile expects them to be. There is work needed here. #23 |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +## Manual install |
| 44 | + |
| 45 | +Only required if you want to use a current repository snapshot or if the GUI |
| 46 | +install fails for your system (please take the time to file a [bug |
| 47 | +report](https://github.com/tenbaht/sduino/issues)). |
2 | 48 |
|
3 | 49 | All tools are available for Linux, MacOS and Windows, most of them even for |
4 | 50 | Raspbian on a RaspberryPi. |
5 | 51 |
|
6 | | -SDCC support for the STM8 is still quite fresh and not very mature. It |
7 | | -improves significantly from version to version. Be sure to use |
8 | | -[the latest snapshot build](http://sdcc.sourceforge.net/snap.php) from the |
9 | | -[project site on sourceforge](http://sdcc.sourceforge.net/), not the older |
10 | | -version that might be included in your distribution. |
| 52 | +- Clone or download and extract the |
| 53 | + [repository](https://github.com/tenbaht/sduino) to a convenient location. |
| 54 | +- Download [the latest snapshot build](http://sdcc.sourceforge.net/snap.php) |
| 55 | + for your system from the [SDCC project site on |
| 56 | + sourceforge](http://sdcc.sourceforge.net/). Support for the STM8 improves |
| 57 | + significantly from version to version. Do not use the older version of |
| 58 | + SDCC that might be included in your distribution (Version 3.6 is |
| 59 | + definitely too old). |
11 | 60 |
|
| 61 | +Later in the process you will unpack the SDCC archive. You only need support |
| 62 | +for the stm8. You can safely delete all the files related to the PIC CPUs in |
| 63 | +the `pic*` and `non-free` directories. That safes more than 90% of the used |
| 64 | +disk space and leaves only 20MB out of 240MB. |
12 | 65 |
|
13 | 66 |
|
14 | | -## Linux |
15 | 67 |
|
16 | | -Download the lastest snapshot build for SDCC from |
17 | | -http://sdcc.sourceforge.net/snap.php and extract it under `/opt`. |
| 68 | +### Linux |
18 | 69 |
|
19 | | - mkdir /opt |
20 | | - tar xvjf ~/Downloads/sdcc-snapshot* -C /opt |
| 70 | +Link the hardware/sduino folder of the downloaded repository to your local |
| 71 | +Arduino hardware folder (usually in `~/sketchbook` or `~/Arduino`). Create |
| 72 | +the hardware folder, if not already present: |
| 73 | + |
| 74 | + cd ~/Arduino |
| 75 | + mkdir hardware |
| 76 | + cd hardware |
| 77 | + ln -s [the-extracted-repository]/sduino/hardware/sduino . |
| 78 | + |
| 79 | +Extract the [downloaded SDCC archive](http://sdcc.sourceforge.net/snap.php) |
| 80 | +under `/opt`: |
21 | 81 |
|
22 | | -`make` is part of the standard repository for any Linux distribution. |
23 | | -Example for Debian-type systems (like Ubuntu, Mint, Elementary etc.): |
| 82 | + sudo mkdir /opt |
| 83 | + sudo tar xvjf ~/Downloads/sdcc-snapshot* -C /opt |
24 | 84 |
|
25 | | - apt-get install make |
| 85 | +Create a link to SDCC from the tools directory of the sduino repository: |
26 | 86 |
|
27 | | -`stm8flash` is included in the tools directory of this repository. Copy it |
28 | | -to a convient place in your path, e.g. `/usr/local/bin`. To use it you might |
29 | | -need to add a udev rule in order to access the USB port. Save this as root |
30 | | -in in `/etc/udev/rules.d/99-stlink.rules`: |
| 87 | + cd [the-extracted-repository]/sduino/hardware/sduino/tools |
| 88 | + ln -s /opt/sdcc . |
| 89 | + |
| 90 | +`stm8flash` and `stm8gal` are both included as precompiled binaries in this |
| 91 | +tools directory. Create a link `linux` to the linux tools directory that |
| 92 | +matches your system and copy the binaries to a convient place in your path, |
| 93 | +e.g. `/usr/local/bin`: |
| 94 | + |
| 95 | + ln -s linux64 linux |
| 96 | + cp -av linux/* /usr/local/bin |
| 97 | + |
| 98 | + |
| 99 | +`make` and libusb-1.0 (needed by stm8flash) are part of the standard |
| 100 | +repository for any Linux distribution. Example for Debian-type systems (like |
| 101 | +Ubuntu, Mint, Elementary etc.): |
| 102 | + |
| 103 | + sudo apt-get install make libusb-1.0-0 |
| 104 | + |
| 105 | +Finally, add a udev rule in order to access the USB port for your flash |
| 106 | +tool. Save this as root in in `/etc/udev/rules.d/99-stlink.rules`: |
31 | 107 |
|
32 | 108 | # ST-Link/V2 programming adapter |
33 | 109 |
|
34 | 110 | # ST-Link V1, if using a STM8S discovery board |
35 | | - # important: It needs a special entry in /etc/modprob/blacklist |
| 111 | + # important: It needs a special entry in /etc/modprobe.d |
36 | 112 | ATTR{idVendor}=="0483", ATTR{idProduct}=="3744", MODE="0666", GROUP="plugdev" |
37 | 113 |
|
38 | 114 | # ST-Link/V2, the china adapter with the green plastic housing |
39 | 115 | ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666", GROUP="plugdev" |
40 | 116 |
|
| 117 | +Using the STM8S-Discovery board as a flash programmer requires a [special |
| 118 | +modprobe configuration |
| 119 | +entry](hardware/stm8sdiscovery#usage-with-linux-and-stm8flash). |
| 120 | + |
41 | 121 |
|
42 | 122 |
|
43 | | -## MacOS |
| 123 | +### MacOS |
44 | 124 |
|
45 | | -Quite similar. [Install Homebrew](https://brew.sh/) if you haven't done it |
46 | | -yet, than: |
| 125 | +Quite similar to the Linux install. [Install Homebrew](https://brew.sh/) if |
| 126 | +you haven't done it yet, than install make and unpack the sdcc snapshot: |
47 | 127 |
|
48 | 128 | brew make |
49 | 129 | mkdir /opt |
50 | 130 | tar xvjf sdcc-snapshot* -C /opt |
51 | 131 |
|
52 | | -Not sure about stm8flash, I didn't try it. Have a look at the |
53 | | -[stm8flash repository](https://github.com/vdudouyt/stm8flash). |
| 132 | +Adopt the other steps from the Linux install. The arduino hardware folder is |
| 133 | +in your Documents folder at `/Users/<username>/Documents/Arduino/hardware`. |
| 134 | + |
| 135 | +Not sure about stm8flash, I didn't try it. Have a look at the [stm8flash |
| 136 | +repository](https://github.com/vdudouyt/stm8flash). It would be great if |
| 137 | +someone could summarize the procedure and send it to me together with a |
| 138 | +compiled binary for the repository. |
| 139 | + |
| 140 | + |
54 | 141 |
|
| 142 | +### Windows |
55 | 143 |
|
| 144 | +There is more work to do here, as it is lacking all the tools for the build |
| 145 | +system, a package system to install them and even a file system concept |
| 146 | +where to store them. |
56 | 147 |
|
| 148 | +#### SDCC |
57 | 149 |
|
58 | | -## Windows |
| 150 | +Unpack the downloaded SDCC archive into hardware/sduino/tools. |
59 | 151 |
|
60 | | -Harder, but still possible. It is lacking all the tools, a package system to |
61 | | -install them and even a file system concept where to store them. For |
62 | | -convinience, I collected the bare minimum of needed tools in a |
63 | | -[separate repository](https://github.com/tenbaht/sduino-windowstools). |
64 | | -Download it and copy the directory tree into the sduino |
65 | | -directory. Add the sduino/tools/bin directory to your path or move the files |
66 | | -in there to a directory that is already in your path. |
| 152 | +#### MinGW |
| 153 | + |
| 154 | +The bare minimum of needed unix-like tools is collected in a [separate |
| 155 | +repository](https://github.com/tenbaht/sduino-windowstools). This is used |
| 156 | +for building the archive file for the Board Manger based install. Download |
| 157 | +it and copy the directory tree into the sduino directory. |
| 158 | + |
| 159 | + |
| 160 | +#### ST-Link, stm8flash |
| 161 | + |
| 162 | +If not already done, install the ST-Link driver from the ST website for |
| 163 | +hardware access. |
67 | 164 |
|
68 | 165 | You are not bound to `stm8flash`, you can use the regular flash tool by ST |
69 | 166 | as well. |
70 | 167 |
|
71 | 168 |
|
| 169 | +#### Using the Makefile-based build system |
72 | 170 |
|
73 | | -### The individual pieces |
| 171 | +For IDE based builds you are done now. For use of the Makefile-based build |
| 172 | +system you need to update your `%PATH%`: |
| 173 | + |
| 174 | +- Add a link `c:\sdcc` to your SDCC installation directory and add this to |
| 175 | + your `%PATH%`. |
| 176 | +- Add the `sduino/tools/win` directory to your path or move/copy/link the |
| 177 | + files in there to a directory that is already in your path. |
74 | 178 |
|
75 | | -All the tools in the convinience package are 32 bit. If you need the 64 bit |
76 | | -versions you might have to collect them yourself. |
77 | 179 |
|
78 | | -You need SDCC, `make` with some basic tools and maybe `stm8flash`. Get SDCC |
79 | | -from the project website. `make` is a standard tool included in either |
80 | | -MinGW/Msys or cygwin. Both are fine, MinGW/Msys is smaller. `stm8flash` from |
81 | | -the [stm8flash repository](https://github.com/vdudouyt/stm8flash). |
82 | 180 |
|
| 181 | +#### The individual pieces |
83 | 182 |
|
| 183 | +All the tools in the convinience package are 32 bit. If you need the 64 bit |
| 184 | +versions you might have to collect them yourself. |
84 | 185 |
|
85 | | -#### SDCC |
| 186 | +You need `make` with some basic tools and maybe `stm8flash`. `make` is a |
| 187 | +standard tool included in either MinGW/Msys or cygwin. Both are fine, |
| 188 | +MinGW/Msys is smaller. `stm8flash` from the [stm8flash |
| 189 | +repository](https://github.com/vdudouyt/stm8flash). |
86 | 190 |
|
87 | | -1. Download the lastest snapshot build from http://sdcc.sourceforge.net/snap.php |
88 | | -2. unzip into c:\sdcc (use a path name without whitespace) |
89 | 191 |
|
90 | | -You only need support for the stm8. You can safely delete all the files |
91 | | -related to the pic1x CPUs (that safes more than 90% of the used disk space |
92 | | -and leaves only 20MB out of 240MB) |
93 | 192 |
|
94 | 193 |
|
95 | 194 | #### MinGW |
|
0 commit comments