First experiences (firmware upgrade & hardware design issue/mitigation)
Posted: Sun Apr 19, 2020 6:31 pm
Hello,
First poster here, thanks for developing the hardware and this forum! I am new to (micro)python as well, so I use the Pyb-D and the ESP8266 as vehicles to learn an enjoy ... .
The two PYBD_SF6W devices I have had firmware revision 1.11 so I wanted to upgrade to 1.12. Since the upgrade process is not entirely trivial (as it emerged from some posts) I decided to write down all steps for the first device upgrade. In the end I was able to successfully upgrade it (indeed it took quite some time and some research / trial-and-error) and following these steps exactly the second device followed successfully without issues. Therefore I hope the following detailed description serves other users of the D-series as well:
Detailed procedure using Dfutils for upgrading PyB-D SF6W from 1.11 to 1.12
Hardware used:
Pyboard-D model SF6W, mounted on WBUS-DIP28 and accessed through the latter's USB-port
PC: Surface Pro 6 and/or the much older Surface 3 (both Windows 10)
Preparation:
1. Install PyUSB (I ran "pip install pyusb" from PowerShell in Admin mode)
2. Download Zadig ( https://zadig.akeo.ie/ )
3. Donwload DFUtils, unpack the zipped file ( http://dfu-util.sourceforge.net/ ) and then go to the directory with the unpacked files. This directory should contain several files/executables, including the "dfu-util-static" executable
4. Download a recent firmware DFU file (http://micropython.org/download/pybd/ ) into the same directory as the Dfutils executables from step 3. I used the PYBD-SF6-20191220-v1.12.dfu baseline file, but the latest dfu build works as well.
Execution:
1. Install PyUSB (I ran "pip install pyusb" from PowerShell in Admin mode)
2. Get the PyBoard-D in bootloader mode. There are several ways, but a very easy one was as suggested by Jimmo, direct from REPL (I use Thonny for that, but anything goes):
>>> import machine
>>> machine.bootloader()
As a consequence the Repl (or editor using it) gets disconnected and the red led starts flashing each second, indicating the board is in bootloader mode. Also around this time Windows *might* signal that it has found and will install a new driver, just let this happen, this will be overridden in the next step. Keep the PyB-D connected physically.
3. Now install the proper driver by running Zadig (Libusbk works for me as a device driver (as recommended by Jimmo somewhere else on this forum), but WinUSB does appear to work equally well, as tested on my second board to be upgraded) :
a. Start up Zadig (it is a standalone program that does not require installation)
b. From the main menu in Zadig, select Options -> List all devices
c. Select the PyBoard DFU as the device (be careful not to accidently select anything else. Furthermore, if you do not see the Pyboard DFU as an option then your device is not in bootloader mode)
d. Upgrade the driver to WinUSB or Libusbk
4. Start up Powershell (Administrator) and go to the dir with the unpacked Difutils files. Run Difutils in PowerShell with the following command (correct the dfu file name for the latest version you have downloaded, and mark the .\ at the start of the command):
.\dfu-util-static.exe -D PYBD-SF6-20191220-v1.12.dfu
5. Now you should see a stream of messages, ending with the message "Download Done. Done parsing DfuSe file"
That is it, you can now disconnect the PybD physically. Next time you start connecting to REPL or your favorite editor, the PyBoard will greet you with the updated firmware version!
Using pydfu (python script) instead of dfutils
Using pydfu (python script) instead of dfutils (replacing step 4) did not work for me, a timeout error was reported and I was not able to fix that in any way … .
First poster here, thanks for developing the hardware and this forum! I am new to (micro)python as well, so I use the Pyb-D and the ESP8266 as vehicles to learn an enjoy ... .
The two PYBD_SF6W devices I have had firmware revision 1.11 so I wanted to upgrade to 1.12. Since the upgrade process is not entirely trivial (as it emerged from some posts) I decided to write down all steps for the first device upgrade. In the end I was able to successfully upgrade it (indeed it took quite some time and some research / trial-and-error) and following these steps exactly the second device followed successfully without issues. Therefore I hope the following detailed description serves other users of the D-series as well:
Detailed procedure using Dfutils for upgrading PyB-D SF6W from 1.11 to 1.12
Hardware used:
Pyboard-D model SF6W, mounted on WBUS-DIP28 and accessed through the latter's USB-port
PC: Surface Pro 6 and/or the much older Surface 3 (both Windows 10)
Preparation:
1. Install PyUSB (I ran "pip install pyusb" from PowerShell in Admin mode)
2. Download Zadig ( https://zadig.akeo.ie/ )
3. Donwload DFUtils, unpack the zipped file ( http://dfu-util.sourceforge.net/ ) and then go to the directory with the unpacked files. This directory should contain several files/executables, including the "dfu-util-static" executable
4. Download a recent firmware DFU file (http://micropython.org/download/pybd/ ) into the same directory as the Dfutils executables from step 3. I used the PYBD-SF6-20191220-v1.12.dfu baseline file, but the latest dfu build works as well.
Execution:
1. Install PyUSB (I ran "pip install pyusb" from PowerShell in Admin mode)
2. Get the PyBoard-D in bootloader mode. There are several ways, but a very easy one was as suggested by Jimmo, direct from REPL (I use Thonny for that, but anything goes):
>>> import machine
>>> machine.bootloader()
As a consequence the Repl (or editor using it) gets disconnected and the red led starts flashing each second, indicating the board is in bootloader mode. Also around this time Windows *might* signal that it has found and will install a new driver, just let this happen, this will be overridden in the next step. Keep the PyB-D connected physically.
3. Now install the proper driver by running Zadig (Libusbk works for me as a device driver (as recommended by Jimmo somewhere else on this forum), but WinUSB does appear to work equally well, as tested on my second board to be upgraded) :
a. Start up Zadig (it is a standalone program that does not require installation)
b. From the main menu in Zadig, select Options -> List all devices
c. Select the PyBoard DFU as the device (be careful not to accidently select anything else. Furthermore, if you do not see the Pyboard DFU as an option then your device is not in bootloader mode)
d. Upgrade the driver to WinUSB or Libusbk
4. Start up Powershell (Administrator) and go to the dir with the unpacked Difutils files. Run Difutils in PowerShell with the following command (correct the dfu file name for the latest version you have downloaded, and mark the .\ at the start of the command):
.\dfu-util-static.exe -D PYBD-SF6-20191220-v1.12.dfu
5. Now you should see a stream of messages, ending with the message "Download Done. Done parsing DfuSe file"
That is it, you can now disconnect the PybD physically. Next time you start connecting to REPL or your favorite editor, the PyBoard will greet you with the updated firmware version!
Using pydfu (python script) instead of dfutils
Using pydfu (python script) instead of dfutils (replacing step 4) did not work for me, a timeout error was reported and I was not able to fix that in any way … .