can no longer upgrade the firmware

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
smhodge
Posts: 40
Joined: Tue Jan 22, 2019 2:16 am

can no longer upgrade the firmware

Post by smhodge » Sun Feb 02, 2020 8:56 pm

A few months ago I successfully upgraded the firmware to v11.1 from (IIRC) v9.

I did this on 2 boards with no problems, using the DfuSe Demo utility, but now that utility refuses to list any pyboards, despite using as many variations as I can think of (reset the board, open/close the utility, wait for several minutes to find the board, etc).

This is the case with both of the two boards previously upgraded to v11 and with two other more recently purchased boards, one which came with v11 and the other with v10.

I then tried to install the alternate programmer, dfu-util, which requires the pydfu package, but pip cannot install that (but can install other packages just fine) and I cannot tell from the long list of error messages displayed why it fails. I presume something is wrong with the pydfu package. I am running Windows 10, with the latest automatic upgrades from MS.

Any help would be much appreciated, thanks.

User avatar
jimmo
Posts: 1177
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: can no longer upgrade the firmware

Post by jimmo » Sun Feb 02, 2020 10:36 pm

dfu-util is a standalone program -- doesn't use Python or pydfu.

pydfu is part of the MicroPython codebase. I'm not sure it's available on pip, but it only depends on usb (pip install libusb) -- You can download it directly from https://github.com/micropython/micropyt ... s/pydfu.py

When you put the boards into DFU mode (by connecting boot0 to 3.3 then pressing reset), does the LED turn red? (i.e. is the board definitely in DFU mode... make sure you can't get to the REPL)

Also, you can try the other way of getting to the bootloader which is to type (at the REPL):

Code: Select all

>>> import machine
>>> machine.bootloader()
I don't know much about Windows, but I have heard a few reports along these lines where Windows is a bit confused about which driver to use. There's a tool called Zadig that you can use to configure this, but I don't know why this is necessary?

See these threads:
viewtopic.php?f=20&t=7298&p=41569 (Someone else with a PYBV11)
viewtopic.php?f=20&t=6751&p=38778 (suggests to use STMCubeprogrammer)
https://www.hanselman.com/blog/HowToFix ... ndows.aspx (how to use Zadig)
viewtopic.php?f=6&t=6896&p=39290 (more info about zadig)

smhodge
Posts: 40
Joined: Tue Jan 22, 2019 2:16 am

Re: can no longer upgrade the firmware

Post by smhodge » Sun Feb 02, 2020 11:32 pm

Both the red and the blue leds come on. Not terribly bright, but definitely on.

I tried entering the bootloader with the REPL the way you suggest and the leds came on the same, and I could no longer issue a Ctrl-C with the REPL so I assume it was in DFU mode.

Is there a way to upgrade with the REPL once you are connected to the bootloader?

I looked at the pydfu.py link but can't figure out how to use it. Do you copy it to the pyboard flash and then do a reset? Does it prompt for the file name?

Thanks

User avatar
jimmo
Posts: 1177
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: can no longer upgrade the firmware

Post by jimmo » Mon Feb 03, 2020 1:31 am

smhodge wrote:
Sun Feb 02, 2020 11:32 pm
Both the red and the blue leds come on. Not terribly bright, but definitely on.

I tried entering the bootloader with the REPL the way you suggest and the leds came on the same, and I could no longer issue a Ctrl-C with the REPL so I assume it was in DFU mode.
OK, sounds like you're in DFU mode.
smhodge wrote:
Sun Feb 02, 2020 11:32 pm
I looked at the pydfu.py link but can't figure out how to use it. Do you copy it to the pyboard flash and then do a reset? Does it prompt for the file name?
You run it on your computer. There are some instructions (also for dfu-util too) at https://github.com/micropython/micropyt ... are-Update
smhodge wrote:
Sun Feb 02, 2020 11:32 pm
Is there a way to upgrade with the REPL once you are connected to the bootloader?
Not on the PYBV11.

smhodge
Posts: 40
Joined: Tue Jan 22, 2019 2:16 am

Re: can no longer upgrade the firmware

Post by smhodge » Mon Feb 03, 2020 10:09 pm

Well, it was a battle, but I got it to upgrade. The link to the instructions on github were a big help. I had to do the whole zadig bit to get the WinUSB driver installed, and then use the dfu-util to do the upgrade. All went pretty much, but not completely, as described in that link.

After I got dfu-util to do the upgrade, I tried pydfu.py. It still could not find any DFU devices, even though dfu-util could, so I have no idea what the issue there is. And the DfuSE Demo utility from ST continues to not work either, even though it did last fall. My guess is both of these failures are a Windows thing. Only zadig + dfu-util works for me.

Thanks for the help.

Post Reply