Before I begin the post proper, an aside...
Larry Cuban just made a wonderful blog post titled Fixing Schools Again, and Again in which he says,
"If amnesia were like aphrodisiac pills, policymakers have been popping capsules for years. Memory loss about past school reforms permits policymakers to forge ahead with a new brace of reforms and feel good."To an educator of 24 years these words ring so true! Time and time again I've watched my own school system move from one initiative to another, never stopping for a moment to look back at where we've been so that we might learn something from our journey.
In this intensive Summer of learning, I've been trying to juggle several learning goals, each associated with either NOVA Web Development or the future IT curriculum at Arlington Tech (or hopefully, both):
- GIS, specially web GIS mapping of LIDAR data
- Firefox OS App development
- Django and django CMS
- MicroPython programming on the pyboard
I'll be using the Pyboard Firmware Update guide my dear friend and co-conspirator Kevin Cole mentioned in a blog post, along with the instructions Kevin documented in the same post.
The first step in the process is to connect my pyboard physically to my to my desktop workstation by USB cable and verify that I can interact with it. When I connected the cable, a filesystem named PYBFLASH auto-mounted, showing these contents:
screen, when I checked, I didn't have screen installed, so I ran:
$ sudo aptitude install screen dfu-util
So I checked to see if the device was there:.$ screen /dev/ttyACM0 [screen is terminating] $
$ ls -l /dev/ttyACM*Ahh, I bet I'm not in the dialout group.
crw-rw---- 1 root dialout 166, 0 Jul 4 15:39 /dev/ttyACM0
$ groups [username]That's better. I still needed to restart my machine before I could connect, but after that screen /dev/ttyACM0 gave me a blank screen, and after I hit <Enter> I saw:
[username] : [username] adm cdrom sudo dip plugdev lpadmin sambashare
$ sudo adduser [username] dialout
[sudo] password for [username]:
Adding user `[username]' to group `dialout' ...
Adding user [username] to group dialout
$ groups [username]
[username] : [username] adm dialout cdrom sudo dip plugdev lpadmin sambashare
I'm in! Now let me move on upgrading the firmware. Typing ^D (that's Ctrl+D) at the python prompt gave me:Traceback (most recent call last): File "
", line 1 SyntaxError: invalid syntax >>>
PYB: sync filesystemsKevin's next instruction says, "Next, disconnect the USB cable, jumper the BOOT0 and 3V3 pins, and reconnect the USB cable". There is a picture of this on the Pyboard Firmware Update guide:
PYB: soft reboot
Micro Python v1.3.10 on 2015-02-13; PYBv1.0 with STM32F405RG
Type "help()" for more information.
|My pyboard with paper clip jumper|
$ lsusbI've highlighted in green the line we are interested in.
Bus 003 Device 002: ID 8087:8001 Intel Corp.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2a Intel Corp.
Bus 001 Device 009: ID 0424:2228 Standard Microsystems Corp. 9-in-2 Card Reader
Bus 001 Device 008: ID 0424:2602 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 007: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 006: ID 413c:3016 Dell Computer Corp. Optical 5-Button Wheel Mouse
Bus 001 Device 005: ID 046d:0825 Logitech, Inc. Webcam C270
Bus 001 Device 004: ID 413c:2003 Dell Computer Corp. Keyboard
Bus 001 Device 002: ID 050d:0234 Belkin Components F5U234 USB 2.0 4-Port Hub
Bus 001 Device 012: ID 0483:df11 STMicroelectronics STM Device in DFU Mode
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ sudo dfu-util -lAgain, I highlighted in green the line we are looking for, the internal flash.
[sudo] password for [username]:
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to firstname.lastname@example.org
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, alt=3, name="@Device Feature/0xFFFF0000/01*004 e", serial="346135523333"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, alt=2, name="@OTP Memory /0x1FFF7800/01*512 e,01*016 e", serial="346135523333"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, alt=1, name="@Option Bytes /0x1FFFC000/01*016 e", serial="346135523333"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="346135523333"
After disconnecting the pyboard, removing the jumper (paper clip), and reconnecting the pyboard and starting a screen session to it, and typing ^D, I was rewarded for my efforts when I saw:$ sudo dfu-util --alt 0 -D pybv10-2015-07-04-v1.4.4-65-gb19d273.dfu dfu-util 0.8 Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc. Copyright 2010-2014 Tormod Volden and Stefan Schmidt This program is Free Software and has ABSOLUTELY NO WARRANTY Please report bugs to email@example.com Match vendor ID from file: 0483 Match product ID from file: df11 Opening DFU capable USB device... ID 0483:df11 Run-time device DFU version 011a Claiming USB DFU Interface... Setting Alternate Setting #0 ... Determining device status: state = dfuERROR, status = 10 dfuERROR, clearing status Determining device status: state = dfuIDLE, status = 0 dfuIDLE, continuing DFU mode device DFU version 011a Device returned transfer size 2048 DfuSe interface name: "Internal Flash " file contains 1 DFU images parsing DFU image 1 image for alternate setting 0, (2 elements, total size = 273128) parsing element 1, address = 0x08000000, size = 13580 Download [=========================] 100% 13580 bytes Download done. parsing element 2, address = 0x08020000, size = 259532 Download [=========================] 100% 259532 bytes Download done. done parsing DfuSe file $
Now let's see what Kevin and the MicroPython interns can do with our newly flashed pyboards...PYB: sync filesystems PYB: soft reboot Micro Python v1.4.4-65-gb19d273 on 2015-07-04; PYBv1.0 with STM32F405RG Type "help()" for more information. >>>