Chris has written this procedure as a slower, more deliberate, walk-through of the update process after making many mistakes following the Pycom documentation. We'll assume all downloaded files are in your Downloads folder. All the below is done with the Pysense/Pytrack board alone; no Pycom microcontroller board should be mounted on it.

Transcript

G'day guys, Chris from Core Electronics again. Today I'd like to show you how to update the firmware on the expansion boards from PyCom. So we're not talking about microcontrollers like this WiPy, we're talking about the expansion boards that you put on the back of those. As always there's documentation linked down below, so you can take your time the documentation for this procedure is quite verbose because I found the documentation from PyCom's brief to the point of difficult. So I hope you appreciate the level of detail I've got into here and I hope you can go from top to bottom without making a mistake because I've put all the learnings from my mistakes into that documentation.

So, we'll start off by having a look at the hardware that I have here on that bench and then we'll go to the PC and do most of the work from there. So on the bench here I have an expansion board 2.0 and I'm pointing to just below the USB socket, there's a chip there which is an FTDI chip. It's just a serial translation chip to run the USB connection. This board has no microcontroller and therefore can't be updated so expansion board 2.0, job done. I've got a WiPy here, just to reiterate we're not even using the microcontroller boards as part of the update process, we don't need a WiPy, we don't need any of the microcontrollers at all, we're working just with PI sins and PyTrack on their own and the USB connection to the PC. Now the reason I mentioned why that FTDI chip was there, is that in the same location on both of these boards is a Pic microcontroller and there is firmware code on that Pic microcontroller for both of these. So now we'll go to the PC and I'll show you the process of updating them.

If we open up a browser head to the Core electronics page, through "Learn", into tutorials and then I can just pick PyCom and the second latest tutorial that's gone up is PyTrack and PySense firmware, here on the left so I'm going to click into that one. All right, so this is my procedure that's quite verbose some big screenshots in it, but I'm sure you can get through a top-to-bottom fairly quickly. I'll take you to the second paragraph, here I have a link to the Python documentation and I'll just open that now. So in the Python documentation, this linked directly to updating the PySense and PyTrack but I'll step back from that just for a moment. Okay so this is the updating process for PySense and PyTrack and if you look at the contents we're down in chapter 4, 4.2.1 updating firmware. Not to be confused with if you go further up under the "getting started - 1.3.1 updating firmware" heading. So this other updating firmware area is talking about updating the firmware on the microcontroller and the reason I'm being pedantic about updating the firmware on the expansion board, PySense and PyTrack board is because of what's documented here. So if we were updating a microcontroller say A WiPy, we would read this procedure. If we were using a PySense or a PyTrack, we would have to switch over to this tab and the first item on the procedure is before connecting your module to a PySense, PyTrack board you should update the firmware on the board, instructions on that can be found here. So before doing an update on any of you microcontroller devices the expansion board behind it needs to be updated. So if I click here I go back to the page that I started on.

Ok, so now we're talking about firmware on PySense and PyTrack. Just going to open up a Windows Explorer, window and drop into my downloads folder, just so I can watch where things land, we need to download the PyTrack device firmware update, I think that's what DFU stands for, will also download PySense DFU and looking down the page until we get to the windows instructions, we also need a DFU utility we'll click and download that and we also need an installer tool this thing called Zadig. So that takes us to the Zadig website and near the bottom of the page here I'm going to click Zadig 2.3 to download that.

Alright so going back to my instructions here, this is our preparation we've got the files, we've done part 1 part 2. Now, we need to organize the files we need this one file that we downloaded that's a zip file, we need the contents of that to begin the Downloads folder, in the root folder of downloads. So we're going to extract that file and then navigate through two folders to get to its contents, scoop up all of those files, cut them, drop back into the Downloads folder and paste them in there. So as per Pycom's instructions, we now have all of the files that we could possibly need in the same folder.

Now because I've run through this a couple of times, the best thing to do is to have, Pycom documentation and my documentation, as well as device manager so I'm just going to hit start and type "dev", yes device manager we might pull that over to the bottom right here and we need to run this Zadig utility, so just from downloads and with a double clicking on Zadig 2.3, yes, let's allow that to run and we'd also need a command prompt, okay we'll use this as well.

Now, a dry run is what I've called the next part. What we want to do is get familiar with how this process works, so that you're familiar with especially the timing of it. There's a built-in seven-second delay in this process, where when you connect PySense or PyTrack with the button held down, it goes into device firmware update mode and it stays in that mode for seven seconds and then reverts back to being just a normal serial device. So there's a seven-second window to get something done and rather than try to do the whole thing in seven seconds we can just do it over and over and get a step done each time.

So that we can see how that looks let's do a dry run I'm looking at device manager on my screen and I'm going to pick the PyTrack at the moment turn it around the right way. So when I plug in the PyTrack without touching the button, the PyTrack should appear in device manager will see device manager blinked a couple of times. Right so now under ports we have a USB serial device content that's our PyTrack. If we unplug it not only does the USB serial device disappear but so does the ports category because there are no other ports.

Now let's see what happens if I hold down the button, which is in the middle of the board hold down the button and connect at the same time. Now a device has appeared called unknown device, under other devices. Now watch it because it's about to disappear, right, it's gone back to being a serial device and now we've got content again so for seven seconds there. There was an unknown device found and there was no driver installed for it.

So that's what the Zadig utility is going to do for us in the top right. When we plug in the Pyrack with the button down it will be in firmware update mode. Zadig will allow us then to install the Windows driver for that device. Unfortunately, as Zadig comes up with the wrong driver selected by default. So where it says libusb in the driver box, we need to use the little radio buttons on the end there, toggle buttons, whatever and change it to, libusbK, there we go.

So I'm going to disconnect the device again, hold down the button, now watch the Zadig application when I reconnect in the top grey box, it has found the unknown device and if I click the install driver button now it should install the driver. However, spend too much time talking and I need to just hurry up and get it done.

So I'm going to leave my mouse here hovering over the install WCID driver button ever going to repeat the process way unplugging, holding down the button, reconnecting the USB, putting it my hand on the mouse and hitting install driver.

Right so you can almost ignore the messages you get from Zadig, it has given me error messages to tell me it failed when it succeeded, it's also told me, that it has succeeded, when it failed, so I don't trust this completion message from Zadig. I want to check with device manager to make sure this is right. So what I'm looking for now is that when I put the device in firmware update mode and connect it a new category will appear in device manager that will be the libusbK category and our device should appear under that. So I'm gonna hold down the button again, reconnect the USB again, looking at device manager, there's now a libusbK category, with unknown device number one in it. That's the driver successfully installed, however as always 7 seconds pass and that device effectively disappears and turns back into a serial port.

So, I've actually gone ahead and done the driver installation part without pointing to the documentation for that. Now we're going to go ahead and do the firmware update.

So there's a little error in my documentation here "dfu-util-static.exe - d pys" I'm going copy that and in my command window here, I need to go into the Downloads folder and that D should be a capital D. Now the reason I've got pys there, is that you can just press tab to complete the file, for the firmware image, but because I've got a PyTrack I need to change that to PYT and hit tab.

Ok, so now we're going to tell the DFU utility to install the driver, I'm sorry to install the firmware for PyTrack, so again disconnect, hold down the button, reconnect, when we're sure the device has appeared in the right category in device manager, we can hit enter, "boom" done.

So it spews a bit of text here in the command prompt, most importantly at the bottom we see download went to hundred-percent, download done, state two, here it says no error condition present, done. So that appears to be successful and because the device is reverted to a serial port, it certainly seems like it's working.

Now one of the things that can go wrong along the way is that you might accidentally install the wrong driver using Zadig, so I'll show you how that works. If I need to remove this device from the pc, now again, the firmware update version of this device, I'm going to press the button and reconnect, it again go to Device Manager,look for the libusbK category, right click, uninstall the device, tick, delete, the driver software for this device. Now I've deliberately paused here because it seems everything's frozen, we don't seem to have a seven-second lag here, because I think the device is reverted but device manager hasn't updated. What we're doing here is removing the driver from Windows this isn't doing anything to the board. Right so remove the driver from Windows and now if we were to put in firmware update mode, it would go back to being just an unknown device button then connect the cable and now it's listed as an unknown device.

Now I'm going to close and reopen the Zadig utility, mainly because it tends to lock onto a different device, once it's successfully installed the driver and it's safer just to open it blanket. Now I'll see by default the libusb driver comes up, I'm going to go ahead and install that, it's the wrong one but I'll show you what happens.

So in device manager, when we go into firmware update mode, it will be listed under other devices and I'm just going to go ahead and hover my mouse pointer over install WCID driver and let's get a firmware update mode one more time, unknown device one has been found by Zadig, install the driver, driver successful, but ignore that message, again we have to go back to firmware update mode to see where it appears in device manager and this time it will appear at the bottom of the list and the USB devices. Bottom of the list USB devices unknown device one.

So we've installed the wrong driver that, will not allow us to do an update because we need the libusbK driver. So again as we just did, firmware update mode, one last time, go to the bottom of device manager, find your device, right click, uninstall, tick the box will delete the software, there we go Windows has forgotten all about it.

So, I hope you found that useful. It's a bit of a rigmarole to get through that but it's it's advisable to make sure that you've got your firmware update done on both of those devices, I don't know how often they might come out from PyCom but certainly when the next update comes I'll be ready, I'll know how to do it. So, thanks again for watching core electronics.

Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.