Revision 43464dd5

View differences:

README.md
111 111
`Makefile` with installation capabilities. Just Follow the instructions given in
112 112
the file `./Host/Source/stm32flash/INSTALL`.
113 113

  
114
Alternatively, some Linux distributions provide the tool in their software
115
repositories. If you do have root permissions on your system, you can install
116
the tool this way. However, the scripts will always check for a 'local'
117
installation in `./Host/Source/stm32flash/` first and only try a system-wide
118
installation afterwards.
119

  
114 120

  
115 121
1.5 GNU ARM Embedded Toolchain
116 122
------------------------------
......
146 152
======================
147 153

  
148 154
The software tools named in this section are not essential for simply using or
149
further development of AMiRo-BLT, but can help for both scenarios.
155
further development of AMiRo-BLT, but are useful in both scenarios.
150 156

  
151 157

  
152 158
2.1 PlantUML
......
165 171
projects, use the setup script and follow the instructions. It will
166 172
automatically generate the required files and you can import the projects by
167 173
opening the `.creator` files with QtCreator IDE.  
168
Please note that you will need to recompile the AMiRo-OS source code after each
169
project generation, since the generator runs a compiler call.
174
Please note that you will need to recompile the AMiRo-BLT source code after each
175
project generation, since the generator executes a compiler call.
170 176

  
171 177

  
172 178

  
173 179
3 Compiling the Source Code
174 180
===========================
175 181

  
176
The AMiRo-BLT project is separated into two major parts: target- and host-
177
related software. The former comprises the bootloaders for the three base
178
modules of the AMiRo platform. The latter is the `SerialBoot` tool, which can be
179
used to flash further binaries (e.g. an operating system) to the
180
microcontrollers without connecting to the module directly (data is passed
181
through via CAN bus). Since the programming connector of the lowermost AMiRo
182
module is the only one accessible when the robot is fully set up, this enables
183
to update the firmware even for other modules.
182
The AMiRo-BLT project is separated into two major parts: target- and
183
host-related software. The former comprises the bootloaders for the base modules
184
of the AMiRo platform. The latter are the `stm32flash` tool as already mentioned
185
above and the `SerialBoot` tool, which can be used to flash further binaries
186
(e.g. an operating system) to the microcontrollers without connecting to the
187
module directly (data is passed through via CAN bus). Since the programming
188
connector of the lowermost AMiRo module is the only one accessible when the
189
robot is fully set up, this enables to update the firmware even for other
190
modules.
184 191

  
185 192

  
186 193
3.1 Host Software
187 194
-----------------
188 195

  
189 196
The `stm32flash` tool is requried to flash bootloader binaries to the MCUs.
190
Instructions for builing the tool are given in chapter 1.4 of this file.
197
Instructions on how to build and intall the tool are given in chapter 1.4 of
198
this file.
191 199

  
192 200
The `SerialBoot` tool can be built by using `cmake`. The according
193 201
`CMakeLists.txt` file can be found in the `./Host/Source/SerialBoot/` directory.
......
206 214
`make` in the `./Target/` folder.
207 215

  
208 216
In order to flash the bootloader to a microcontroller, you first have to set
209
full read and write permissions to the USB ports of your system. To do so, first
210
create a new file by executing the following command:
217
full read and write permissions to the USB ports of your system when a
218
programming cable is plugged in. To do so, first create a new file by executing
219
the following command:
211 220

  
212 221
    >$ sudo touch /etc/udev/rules.d/50-usb-serial.rules
213 222

  
......
223 232
    ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", MODE="0666"
224 233

  
225 234
Now connect the module you want to flash directly to your system (note that
226
indirect flashing is not possible for the bootloader itself) and run the command
235
indirect flashing using `SerialBoot` is not possible for the bootloader itself) and run the command
227 236

  
228 237
    >$ make flash
229 238

  
230 239
If the procedure was not successful, the following hints might help:
231 240

  
232
*   Did your system apply the new `udev` rules?
233
    Reboot and try again!
234
*   Could the makefile execute the stm32flash tool?
235
    Reinitialize the submodule and try again!
236
*   Are the permissions for USB ports set correctly?
241
*   Did your system apply the new `udev` rules?  
242
    Re-login (or reboot) and try again!
243
*   Could make execute the stm32flash tool?  
244
    Check the stm32flash installation (reinitialize the submodule if required) and try again!
245
*   Are the permissions for USB ports set correctly?  
237 246
    Check the udev rules!
238
*   Are there any other applications using the serial connection?
247
*   Are there any other applications using the serial connection?  
239 248
    Close any other applications using the serial connection!
240
*   Is the AMiRo module connected to your system?
241
    Use the programming cable to connect the module to your system.
242
*   Is the AMiRo module powered up?
243
    Keep a charger plugged in during flashing.
249
*   Is the AMiRo module connected to your system?  
250
    Use the programming cable to connect the module to your system!
251
*   Is the AMiRo module powered up?  
252
    Keep a charger plugged in during flashing!
253
*   Was there an error when opening the ports?  
254
    Please read on!
255

  
256
By default, the scripts use the first matching port (i.e. `/dev/ttyAMiRo0` or
257
`/dev/ttyUSB0`) for flashing. If you have connected multiple AMiRo boards to
258
your system, those will be listed with increasing numbers in their identifiers.
259
Furthermore, other USB devices (also internal components) might be listed as
260
such as well. In those cases, you have to specify the correct port manually when
261
calling `make`:
262

  
263
    >$ make flash STM32FLASH_PORT=/dev/ttyAMiRo#
264

  
265
where you have to replace the trailing `#` with the according integer.
244 266

  
245 267
**Attention**: Never flash a bootloader to the wrong module! Doing so might
246 268
cause severe errors and damage the hardware.

Also available in: Unified diff