Firmware update

Ya bastards! (not really)
Last week I borrowed a windows computer installed usb drivers and got past the bootloader problem. Back to Linux and all is well.

This week I get an email saying all is fixed and I should use the new ide.
OK I use the new ide, and it insists on a new bootloader! And it doesn’t work the same as it used to not work.

Why not make the ide send dialog saying, bootloader update is available, attempt to upload it? And if you click No, it just continues without trying to upload it. (at my own risk).

So, we changed the debug API around a bit going from version v1.4 (release version) to v1.7. It’s just easier to do the IDE without trying to support multiple firmwares.

That said, this assumes everyone can use the bootloader. Which I fear isn’t going to be possible given that it’s only active for 500 ms. When we build new hardware that will get updated to 1000 ms or more. But, for all the cams in the wild now were stuck with the current bootloader.

So, this is what I’ll do. I can make connect not need the bootloader. And I’ll change the firmware version label into a tool button so when you click on it the system’s firmware will get updated. If the firmware you are using is out of date the version label will turn red and say click on me to update or something like that.

In the mean time, just change the firmware version in the file here for the IDE to ignore your cams firmware:

/share/qtcreator/firmware/version.txt

Hey, just a quick update on this issue…

We found a few issues with the way the IDE handles the bootloader process (which causes the “Unable to connect to the bootloader! This fails sometimes…” message) we’re pretty sure we can fix this in the next release, so the IDE will be able to connect to the bootloader even if it only waits for 250m. As soon as we have more time we’ll work on a new release.

This is starting to get really annoying; I’ve let it aside some time and just saw the new IDE 1.3
Installs fine
Connects to the board (says No valid drives were found to associate with your OpenMV Cam!)
Mentions my firmware 1.8.0 is out of date
Clicked to upgrade (says Connecting, cancelled after 15 minutes as nothing happened)

Tried the proposed DFU Bootloader option, which gave this error message :


  • DFU firmware update failed!

  • The command “/MyDocuments/Apps/openmv_v1.3/share/qtcreator/pydfu/pydfu.py” terminated with exit code 1.

  • Traceback (most recent call last):
    File “/MyDocuments/Apps/openmv_v1.3/share/qtcreator/pydfu/pydfu.py”, line 20, in
    import usb.core
    ImportError: No module named usb.core

  • PyDFU requires the following libraries to be installed:

sudo apt-get install libusb-1.0 python-pip
sudo pip install pyusb


python-pip is installed, as well as pysub

What’s wrong ? Any idea ?

The error message literally tells you what you need to install:

sudo apt-get install libusb-1.0 python-pip
sudo pip install pyusb

Please see this link: Home · openmv/openmv Wiki · GitHub

pydfu the dfu upgrade script requires you to install some things that I can’t install for you.

Oh, wait, I see that you have them installed in your message. Please check that link and confirm you have the versions in the link installed.

Okay, make sure you’ve done all this for pydfu to work. I would have preferred a better solution but this is the best we can do for now:

sudo apt-get install python2.7 python-dev python-pip
sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev
sudo pip install numpy pyserial==2.7 pyusb==1.0.0b2 Pillow

cd /share/qtcreator/pydfu
sudo cp 50-openmv.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules

So, basically have all the pyusb stuff installed and make sure that your udev rules have been updated.

Well done all this and versions are ok (minor differences)

launching pydfu still says :

Traceback (most recent call last):
File “pydfu.py”, line 20, in
import usb.core



PS : I use OpenSuse Leap 42.1

Mmm, I don’t know then. Ibrahim will have to answer this. It seems the script cannot import the pyusb library. But, running all the commands I mentioned should give you 100% of what you need. On a Ubuntu machine running all that stuff works for me… Googled around a bit on it: Google. Can’t seem to find anything that may be a good answer.

Do you have a windows computer around? The IDE has DfuSE (STM Tool) builtin on windows which has an 100% chance of upgrading the firmware. Also, since you’re at version 1.8.0 you don’t need to update the firmware to use the Cam with the IDE. The com protocol is stable for v1.7.0 and up.

And… I’m sorry about this still, I have really been trying to get all this 100% working for everyone. Setting the serial timeout to connect to the boot loader to 500 ms has… cost me a lot of time… The next run of OpenMV Cams will have a much, much, higher timeout value.

Otherwise, beside for the bootloader issue v1.3 should be really good. However, I’m confused on why the IDE didn’t find the OpenMV Cam flash drive. On linux the IDE assumes the drive is in either /run/* /mnt/* or /media/*. Does OpenSuse mount he flash drive somewhere else?

I’ll try on a Windows machine; as for the mount, it now seems to work, it’s in run/media

My concern is that I’ve talked to someone in my town who owns an electronics shop, because I think it could be a great product for him; I just want to make sure the cams reach enough maturity so as it can be easy to set-up, show and help out if necessary

Yeah, I know exactly how you feel. I want to start advertising online but we’re not quite there yet.

With the next rev of the cam I think it will be ready for your friend. We’re going to be posting about a new Cortex M7 version soon which will have the bootloader issue fix along with a better USB connector and a bunch of other minor fixes. We get the dev boards back next week form MacroFab for this.

If your friend is using windows then things are pretty solid for that.

As for the mounting issue. The IDE checks all those paths I mentioned for a FAT flash drive when you connect. If it doesn’t find one it gives that error. Simply wait for everything to be mounted before connecting for that problem to go away. Also, you can click on the drive label in the lower right hand corner of the IDE and it will search for drives again.

Yep it worked fine on Windows and brought it to v2

as for the mount issue, it works sometimes… just tried it and gave the error although it was mounted ( /run/media/user/2989-0800> )

PS : By the way, not sure if it has a link, but in Windows, the leds flash continuously when it’s plugged in, but in Linux, it flashes a few secs. and then stops, (I can still connect though), and here and then a quick short fred flash

Strange

When the blue led is flashing the OpenMV Cam is running a script that blinks the blue led. When the red led flashes that’s the OS looking at the flash drive on the cam. The blue led should be flashing when the cam is connected until the IDE connects which stops that script. The red led should flash randomly, that’s completely up to the OS.

Mmm, as for the mount problem I guess I can make that error silent. It will still fail but I can just not warn you. I can also make the IDE tell you to click on the drive button to search for drives. That should make it less annoying.