These instructions are oriented towards Windows users using a contemporary Windows XP SP3-based distribution.
First, you’ll need some tools:
In order to follow these instructions, you will need:
- A binary of the bootloader you want to upload
- RS232 cable for communicating between the Spruce and your computer over serial. The bootloader is downloaded over the RS232 port, while the Arduino program is downloaded over the USB port.
- Python version 2.5 or higher, with the PySerial library installed.
- maple_boot.bin (Bootloader binary)
Step 1: Obtain a bootloader binary.
The first thing you’ll need to do is to compile your bootloader binary. Note that an ASCII representation of the binary, such as the Intel .hex format, won’t work. If you just wantto flash the default Spruce bootloader (the one that was installed on your Spruce when it arrived), we host apre-compiled copy, which works on all Spruce Revs.
Step 2: Connect Spruce Serial 1 to your computer.
Serial 1 is J4 connector. At this point, you’re ready to plug the RS232 connector into your computer (via DB-9 cable).
Step 3: Put your Solid-STM32-Arduino into serial bootloader mode.
Do this by pressing the RESET button, then while RESET is held down, Remove the J2 jumpers (J2,open is ISP mode). Next, making sure to keep J2 open, release the RESET button and wait for a few seconds before shorting J2.
Step 4: Get stm32loader.py.
We’ll use maple_boot.bin as the path to the bootloader binary from Step 1,
and ser-port as the Spruce’s serial port device file or COM port.
On Linux, ser-port will probably be something like /dev/ttyUSB0, although
the exact number could be different (it could be /dev/ttyUSB1,
On OS X, ser-port will probably look like /dev/tty.usbserialXXXX, where
XXXX is some random string of characters.
On Windows, ser-port will be something like COM1, COM2, etc.
To upload a bootloader binary, run this command from the Unix shell:
$python stm32loader.py -p ser-port -evw maple_boot.bin
Or this command from the Windows command prompt:
python.exe stm32loader.py -p ser-port -evw maple_boot.bin
You can also run the following to get usage information:
python stm32loader.py -h
python.exe stm32loader.py -h
If all goes well, you’ll see a bunch of output, then “Verification OK”. If
something goes wrong, you can always contact us directly!
One Stop Example: Flashing the Spruce Bootloader base on Windows XP
Install Tools: python-2.7.1 and pyserial-2.5.win32; All default installation; Download stm32loader.py and maple_boot.bin ; Create a folder under the C drive, and this folder name is ‘spruce’. Copy stm32loader.py and maple_boot.bin to ‘spruce’ folder;