@@ -39,15 +39,15 @@ the hardware folder, if not already present:
3939Extract the downloaded [ SDCC archive] ( http://sdcc.sourceforge.net/snap.php )
4040under ` /opt ` :
4141
42- ``` text
42+ ``` bash
4343 sudo mkdir /opt
4444 sudo tar xvjf ~ /Downloads/sdcc-snapshot* -C /opt
4545```
4646
4747Create a link to SDCC from the tools directory of the sduino repository
4848(required for IDE builds):
4949
50- ``` text
50+ ``` bash
5151 cd ~ /Arduino/hardware/sduino/tools
5252 ln -s /opt/sdcc .
5353```
@@ -59,7 +59,7 @@ tools directory. Create a link `linux` to the linux tools directory that
5959matches your system and copy the binaries to a convient place in your path,
6060e.g. ` /usr/local/bin ` :
6161
62- ``` text
62+ ``` bash
6363 ln -s linux64 linux
6464 cp -av linux/* /usr/local/bin
6565```
@@ -69,7 +69,7 @@ e.g. `/usr/local/bin`:
6969repository for any Linux distribution. Example for Debian-type systems (like
7070Ubuntu, Mint, Elementary etc.):
7171
72- ``` text
72+ ``` bash
7373 sudo apt-get install make libusb-1.0-0
7474```
7575
@@ -81,10 +81,19 @@ tool. Save this as root in in `/etc/udev/rules.d/99-stlink.rules`:
8181
8282 # ST-Link V1, if using a STM8S discovery board
8383 # important: It needs a special entry in /etc/modprobe.d
84- ATTR{idVendor}=="0483", ATTR{idProduct}=="3744", MODE="0666", GROUP="plugdev"
84+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", \
85+ MODE:="0666", \
86+ SYMLINK+="stlinkv1_%n"
8587
8688 # ST-Link/V2, the china adapter with the green plastic housing
87- ATTR{idVendor}=="0483", ATTR{idProduct}=="3748", MODE="0666", GROUP="plugdev"
89+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", \
90+ MODE:="0666", \
91+ SYMLINK+="stlinkv2_%n"
92+
93+ # ST-Link/V2.1, the new Nucleo STM8 boards
94+ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", \
95+ MODE:="0666", \
96+ SYMLINK+="stlinkv2-1_%n"
8897```
8998
9099Using the STM8S-Discovery board as a flash programmer requires a [ special
@@ -99,7 +108,7 @@ entry](../hardware/stm8sdiscovery#usage-with-linux-and-stm8flash).
99108Quite similar to the Linux install. [ Install Homebrew] ( https://brew.sh/ ) if
100109you haven't done it yet, than install make and unpack the sdcc snapshot:
101110
102- ``` text
111+ ``` bash
103112 brew make
104113 mkdir /opt
105114 tar xvjf sdcc-snapshot* -C /opt
@@ -110,8 +119,7 @@ in your Documents folder at `/Users/<username>/Documents/Arduino/hardware`.
110119
111120Not sure about stm8flash, I didn't try it. Have a look at the [ stm8flash
112121repository] ( https://github.com/vdudouyt/stm8flash ) . It would be great if
113- someone could summarize the procedure and send it to me together with a
114- compiled binary for the repository.
122+ someone could summarize the procedure and send it to me.
115123
116124
117125
@@ -121,13 +129,51 @@ compiled binary for the repository.
121129
122130## Windows
123131
124- Same idea again, but additionally we need to install a minimal MinGW command
125- line environment with tools needed by make and the Makefile. Let's start
132+ Same idea again, but additionally we need to install a minimal command line
133+ environment with all the tools needed by make and the Makefile. Let's start
126134with that:
127135
128136
137+ ### Installing a command line environment
138+
139+ This can be any of these options (in order of complexity):
140+
141+ - busybox and make
142+ - Msys2
143+ - MinGW
144+ - Cygwin
145+
146+ The makefile ` sduino.mk ` uses busybox by default when running on Windows. To
147+ change that, set these environment variables accordingly:
148+
149+ SHELL=bash
150+ .SHELLFLAGS=-c
151+
152+ Alternativly, it is possible to include these lines in the project ` Makefile `
153+ or edit ` sduino.mk ` directly (lines 68, 69).
154+
155+
156+
157+ #### Install busybox and make
158+
159+ This is by far the easiest way to get going. busybox already comes with
160+ sduino in the ` hardware/sduino/tools/win/ ` folder. A statically linked copy
161+ of make-4.2 can be found in the
162+ [ windowstools] ( https://github.com/tenbaht/sduino-windowstools ) repository.
163+
164+ Just copy these two binaries into a place somewhere in your ` %PATH% ` .
165+
166+
167+
129168#### Install Msys2
130169
170+ Msys2/mingw is more capable than busybox and even comes with a proper
171+ package manager. Install this if you plan on using the command line tools
172+ for more than just running sdunio compilations.
173+
174+ mingw is a full (cross-) compilation environment and it uses msys2, which is
175+ just a collection of basic UNIX tools. msys2 is enough for using sduino.
176+
131177- Download and run the installer from [ http://www.msys2.org ] ( http://www.msys2.org )
132178- Install make: ` pacman -S make `
133179- define the environment variable ` HOME ` in the windows settings as
@@ -139,6 +185,24 @@ Now we can start working.
139185)
140186
141187
188+ #### Cygwin
189+
190+ cygwin is similar to msys2, but even more complete in the sense that it
191+ tries to emulate a full POSIX environment. It is really more like a virtual
192+ machine than just a set of libraries.
193+
194+ Almost anything that compiles for UNIX can be compiled for cygwin with
195+ minimal effort. The downside is that the resulting binaries are linked
196+ against cygwin specific libraries and that they don't mix very well with
197+ Windows native applications. It is possible to do it, but it might require
198+ some extra effort.
199+
200+ Install this if you need full POSIX compliance. (e.g. compiling
201+ stm8flash with support for espstlink, that requires the POSIX termios
202+ library).
203+
204+
205+
142206#### Install the core files and SDCC
143207
144208Thanks to the running bash the remaining steps are the same as for Linux,
0 commit comments