Pytrack firmware update

  • Hi Pycomers !

    I am trying to upgrade my (newly) Pytrack firmware.
    I followed the procedure as described here.
    Here is what I get :

    $ sudo dfu-util -D pytrack_0.0.8.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
    Match vendor ID from file: 04d8
    Match product ID from file: f014
    Opening DFU capable USB device...
    ID 04d8:f014
    Run-time device DFU version 0100
    Claiming USB DFU Runtime Interface...
    Determining device status: state = dfuIDLE, status = 0
    dfu-util: WARNING: Runtime device already in DFU state ?!?
    Claiming USB DFU Interface...
    Setting Alternate Setting #0 ...
    Determining device status: state = dfuIDLE, status = 0
    dfuIDLE, continuing
    DFU mode device DFU version 0100
    Device returned transfer size 64
    Copying data from PC to DFU device
    Download	[======================== ]  96%        15808 bytesdfu-util: Error sending completion packet

    The timing seems hard to catch with button pressure/release.

  • I came across this "bytesdfu-util: Error sending completion packet" error today when attempting to upgrade a Pycom Expansionboard 3.1 connected to an Ubuntu 18.04 LTS.

    Running ls -la /dev showed that the serialport had restricted access, so a quick fix was:

    sudoedit /etc/udev/rules.d/50-myusb.rules

    and insert the following:



    sudo reboot

    After rebooting the firmware upgrade worked great (holding the s1 button when connecting the USB-cable; releasing s1 after one second; then running dfu-util within a few seconds).

    sudo su -
    dfu-util -D /home/user/Download/expansion31_0.0.11.dfu

  • Hi @pwest, I've added it to our documentation to avoid further confusion.

  • @robert-hh
    This solved my problem. Evidently my problem was that I was following the directions at where the instructions for step e) are to run:
    $ dfu-util -D pytrack_0.0.8.dfu
    no mention of the sudo part... With sudo, it worked first try!


  • @dan debian 8. But, as said below, it works now without sudo.

  • @robert-hh which OS are you using? I'll look into this when I have some time

  • @dan If I run it w/o sudo, I got the message:

    dfu-util: Cannot open DFU device 04d8:f014

    So I added a udev rule in a file called /etc/udev/rules.d/77-pycom.rules with the content:

    # Attribute for Pytrack PIC
    ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f014", MODE="0666"

    Just giving read/write access to everyone. Could be more specific.

  • Hi @jeko and @robert-hh, it might take a few tries, I'm glad you managed to do it. You don't need to run it with sudo, it should work without it

  • @jeko I agree that this workflow is most unfriendly and curse prone:

    a) Remove the device from USB
    b) Push the button
    c) Plug in the device while the button is pushed
    d) Release the button
    e) Start the sudo DFU-util .... command within 6-7 seconds

    Even if you came to that point, your busted, because sudo asks for the password (better if so), and once you entered it, the e) time windwow is closed. So start over at a), and if you're fast enough, the sudo password is still valid.

    And: for me, the "make flash" command with the new expansion board does not work at all. Not only that it needs Python3, it does not switch the PIC to firmwareload mode. So I go back to the P2->GND method, or us my hand-assembled board with the espressif reset circuitry.

  • Oh boy I did it ! Sounds like the timing is crucial and has to be determined experimentally haha ! Lets move on.

Pycom on Twitter