Hi @all,
I'm a mac user, and I'm really happy to play with MicroPython and try the latest micro python firmware image.
Using the dfu-util and a paper clip it is possible to update the firmware also with Mac.
Here we go how to do it:
As a prerequisite you need to have mac port installed ( to install: download from here https://guide.macports.org/chunked/inst ... ports.html ) and install it.
Xcode command line Tools most ports will likely fail to build if Xcode is not installed.
Once you have macport installed, open a console and type:
gianmac:~$ sudo port dfu-util install dfu-util
# once the installation is completed test with this command line
gianmac:~$ dfu-util -V
# this is the result
dfu-util 0.7
Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Now flash the new firmware:
put in dfu mode the micro python ( short cut the 3.3v and the Boot pin as shown in the user guide http://micropython.org/static/doc/Micro ... -setup.pdf ) press reset or connect the micro python to the Mac
then from command console type:
gianmac:~$ dfu-util -l
# this is the result
dfu-util 0.7
Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=1, name="@Option Bytes /0x1FFFC000/01*016 e"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=2, name="@OTP Memory /0x1FFF7800/01*512 e,01*016 e"
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=3, name="@Device Feature/0xFFFF0000/01*004 e"
this means that your micro python board can "communicate" to dfu-util and vice versa.
to update it, download the flash image from the download area then flash it with this command :
gianmac:~$ dfu-util -c 1 -i 0 -a 0 -D pybv10-2014-07-20-v1.2-13-gcb66f41.dfu
dfu-util 0.7
Copyright 2005-2008 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2012 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org
Opening DFU capable USB device... ID 0483:df11
Run-time device DFU version 011a
Found DFU: [0483:df11] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg"
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
Dfu suffix version 11a
DfuSe interface name: "Internal Flash "
file contains 1 DFU images
parsing DFU image 1
image for alternate setting 0, (2 elements, total size = 251892)
parsing element 1, address = 0x08000000, size = 392
.
parsing element 2, address = 0x08020000, size = 251484
...........................................................................................................................
done parsing DfuSe file
gianmac:~$
This means that the flash went flawless and you can use the latest micro python firmware !
Hope this helps.
Cheers Gian
Update firmware using mac
Re: Update firmware using mac
Thanks for the guide Gian, I installed dfu-util using homebrew, for those who might be on that package manager, and want to install it.
I think the instructions for downloading the original firmware off the board before flashing it that were on the github wiki page are also useful, but I don't have the time to grab it just at the moment.
Code: Select all
brew install dfu-util
Re: Update firmware using mac
A small gotcha for the instructions above. The Apple Magic Mouse also presents itself as a DFU capable device, causing the following error message:
To avoid this you can either disconnect the mouse, or specify the pyboard explicitly using the –-device (or -d) option. The correct vendor:product ID can be found using dfu-util –-list but I assume it'll be constant for all release pyboards, so the below should work for most people.
This should also work if you have devices other than the Magic Mouse that lead to a similar error.
Code: Select all
More than one DFU capable USB device found, you might try `--list' and then disconnect all but one device
Code: Select all
dfu-util -d 0483 -c 1 -i 0 -a 0 -D pybv10.dfu