The BSL script iotlab-m3-bsl.py
for iot-lab_M3 nodes is a Python version of the doFlash.sh
script with additions regarding openocd
handling.
The doFlash.sh
script is itself an adaptation of code from the IoT-lab team.
The OpenOCD config file iotlab-m3.cfg
is a copy of iotlab-m3.cfg; the same license and copyright applies.
We are grateful to Cedric Adjih and the IoT-lab team, in particular Roger Pissard-Gibollet and Gaetan Harter, for their help and for making this code available.
- Download
openocd
Windows binary package from http://openocd.org/ - Extract to
C:\openocd
(or similar) - Add
C:\openocd\bin
(32-bit Windows) orC:\openocd\bin-x64
(64-bit Windows) to your WindowsPATH
environment variable. - Rename the openocd executable from
openocd-xxx-x.x.x.exe
toopenocd.exe
. The OpenWSN bootloader Python script expectsopenocd.exe
to be found in thePATH
. You can test all is OK by typingopenocd.exe
in a Windows command prompt. - Positions the switch on the IoT-lab_M3 mote in the position away from the USB connector.
- Connect the IoT-lab_M3 mote to the USB port of your Windows computer.
- Download Zadig from http://zadig.akeo.ie/. This will use to install the
libusb-win32
drivers openocd requires. - Open the Zadig executable. Click
Options
>List All Devices
. - Two entries corresponding to the same
IoT-lab_M3
node should appear:M3 (Interface 0)
M3 (Interface 1)
- For interfacing with openocd, one of the two ports must be associated with the OpenOCD
usb-win32_ft2232
driver available in the OpenOCD installation (see tutorial). We will useM3 (Interface 0)
. - Select
M3 (Interface 0)
from the drop down list in Zadig. Selectlibusb-win32 (xxx)
driver and click on the button to replace/install the driver for this interface. Once this is done successfully, openocd in Windows can interact with IoT-lab_M3 node and flash it. - To reprogram the mote, use the usual OpenWSN build scripts. Navigate to the
openwsn-fw/
directory and typescons board=iot-lab_M3 toolchain=armgcc bootload=0
NOTE: openocd does not support flashing using typical /dev/ttyUSB*
or COMX
interfaces. The Python script will flash the first IoT-lab_M3 node connected to the PC, independent from the bootload=
argument value.
- install openocd by issuing 'sudo apt-get install openocd'
- To flash, use the same OpenWSN workflow as in the Windows instructions above.