This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
forked from dawbarton/rtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-windows.txt
232 lines (154 loc) · 8.8 KB
/
install-windows.txt
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
Installing on Windows
=====================
Copyright David A.W. Barton ([email protected]) 2015.
All of the associated source code and documentation is released under the MIT
license.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Overview
--------
This document describes how to build firmware for the real-time controller,
install suitable device drivers for the real-time controller and use it with
Matlab.
It is not necessary to build the firmware if you have already have suitable
firmware to use.
To build the real-time controller firmware (optional)
-----------------------------------------------------
The instructions below uses the Cygwin environment to build the firmware. It
should also be possible to use the MSYS environment in much the same way
(untested!).
1. Download GCC ARM compiler from
<https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/+download/gcc-arm-none-eabi-4_9-2014q4-20141203-win32.exe>.
* Any recent version (i.e., post 2013) should work. Probably even ones
earlier than that will work as well.
2. Install ARM compiler.
* At the end you will have the option of adding the compiler to your path,
doing so will make your life *slightly* easier.
3. Download Cygwin from <http://www.cygwin.org/>.
4. Install Cygwin with git and make selected (both under the devel category).
* It will say that other packages are required; accept the suggestions.
5. Start the Cygwin terminal. By default the home directory is in
`c:\cygwin\home\<username>`.
* If you didn't add the compiler to your path, you will have to add it to
your path in Cygwin with the command
export PATH=$PATH:"/cygdrive/c/Program Files (x86)/GNU Tools ARM Embedded/4.9 2014q4/bin"
6. Decide where you are going to store the files.
* If you want to store them in your normal Windows Documents folder it is
easiest to create a symbolic link to the appropriate place. E.g., if you
have already created the folder "controlcont" in your Documents folder,
issue the command
ln -s /cygdrive/c/Users/<username>/My\ Documents/controlcont
to create a link to that folder in your Cygwin home directory, then
`cd controlcont`.
* Alternatively, create a new directory in your Cygwin home directory, e.g.,
`mkdir controlcont` followed by `cd controlcont`.
7. Clone the necessary repositories from [GitHub](http://github.com/db9052/).
git clone https://github.com/db9052/rtc rtc
cd rtc
git clone https://github.com/db9052/starterware starterware
8. Build TI Starterware.
cd build
make starterware
cd ..
9. Build the rig of your choice, e.g., duffing_numerical for a simple test
cd rigs/duffing_numerical
make
10. Put the resulting `.bin` file on a micro SD card as app.bin. There should
also be a file called `uEnv.txt` on the SD card which contains the following
text (only).
uenvcmd=mmcinfo;fatload mmc 0 0x80000000 app.bin; go 0x80000000
Once you have done all this once, you only need to repeat steps 9 and 10 to
compile new versions of your firmware.
Device drivers for the USB interface to the real-time controller
----------------------------------------------------------------
1. Build the firmware (as above) and start up the real-time controller by
plugging it into a suitable USB port.
* If your USB port cannot provide enough power, a 5V power supply can be
used to power the board using the barrel connector.
2. Ignore any of Window's requests for installing a device driver.
3. Download Zadig from <http://zadig.akeo.ie> and run it as an Administrator.
4. Select the "Real-time controller (Interface 0)" and the WinUSB driver. Press
"Install Driver".
5. Select the "Real-time controller (Interface 1)" and the WinUSB driver. Press
"Install Driver".
6. If you are using Windows 8 (or above) un-check "Ignore Hubs or Composite
Parents" under the options menu and then select "Real-time controller" from
the drop-down box. Ensure that the WinUSB driver is selected and then press
"Replace Driver".
8. The real-time controller is now ready for use with Matlab.
To use the real-time controller in Matlab
-----------------------------------------
1. [_Optional: see bullet point below_] Download the "Latest Windows binaries"
from <http://libusb.info> and extract `libusb-1.0.dll` from either the MS32
or the MS64 directory depending on whether you are using 32 bit Windows (and
Matlab) or 64 bit Windows (and Matlab). Put it in the `rtc\matlab` folder
alongside `rtc_interface.m`.
* If you are using a regular 64 bit installation of Windows, there is a copy
of libusb-1.0.dll already included in the repository and so you don't need
to do this.
2. Start Matlab.
3. [_Optional: see bullet point below_] Make sure that you have a suitable
compiler for using the Matlab mex function. (Check the output of
`mex -setup`.) Then compile the MEX functions using the compile_mex function
in `controlcont\rtc\matlab`.
* If you are using a regular 64 bit installation of Windows and Matlab,
there are compiled MEX files ready for use in the repository and so you
don't need to do this unless they don't work.
* If the MEX file fails to run with the error "Invalid MEX-file '...': The
specified module could not be found." then you need to download the
Microsoft Visual C++ Redistributable Packages for Visual Studio 2013 from
<http://www.microsoft.com/en-us/download/details.aspx?id=40784>. (These
are already installed on many computers.)
* A suitable (free) compiler is Microsoft Visual Studio Community Edition.
4. Add `controlcont\rtc\matlab` to the Matlab path (`help addpath`).
5. Add the appropriate rig directory to the Matlab path, e.g.,
`controlcont\rtc\rigs\duffing_numerical`.
6. Create the interface to the controller with
rtc = duffing_numerical_interface()
7. All the controller parameters are available through
`rtc.par.<variable name>`.
8. Time series data can be collected through the use of streams; see the help
for `rtc.set_stream`, `rtc.run_stream`.
* By default, 5 different streams (0-4) are available for use.
* The maximum amount of data a stream can return is around 8 MB. If too much
data is requested, the stream recording will refuse to start.
Note: this assumes that a rig specific interface is used to set default
parameters. This is not necessary and the generic rtc_interface can be used
instead if desired.
To use the real-time controller in Python (2.x or 3.x)
------------------------------------------------------
1. [_Optional: see bullet point below_] Download the "Latest Windows binaries"
from <http://libusb.info> and extract `libusb-1.0.dll` from either the MS32
or the MS64 directory depending on whether you are using 32 bit Windows (and
Matlab) or 64 bit Windows (and Matlab). Put it in the `rtc\python` folder
alongside `rtc_interface.py`.
* If you are using a regular 64 bit installation of Windows, there is a copy
of libusb-1.0.dll already included in the repository and so you don't need
to do this.
2. Start Python.
4. Import the Python module and create the interface to the controller with
import rtc_interface
rtc = rtc_interface.rtc_interface()
5. All the controller parameters are available through
`rtc.par.<variable name>`.
6. Time series data can be collected through the use of streams; see the help
for `rtc.set_stream`, `rtc.run_stream`.
* By default, 5 different streams (0-4) are available for use.
* The maximum amount of data a stream can return is around 8 MB. If too much
data is requested, the stream recording will refuse to start.
Note: if desired, rig specific interfaces for Python can be created in much the
same way as for Matlab.
<!-- pandoc -s install-windows.txt -o install-windows.html -->