Firmware development in Windows

Firmware/software/electronics/mechanics
matejkarasek
Beginner
Posts: 11
Joined: Tue Jul 09, 2019 11:50 am

Re: Firmware development in Windows

Post by matejkarasek » Mon Jul 29, 2019 10:32 pm

Hi,
Yes, am running cfloader natively under Windows, and use the libusb-win32 (v1.2.6.0) driver...
But, I finally succeeded to flash! :D The issue seems to be related to my USB.

I only have a single USB port (Surface Pro 4) so I use a USB hub. Apparently, it does not work through the USB hub (at least natively under Windows)... If I connect the crazyradio *directly to the USB port*, then the first time it also fails (with the same error message as I posted earlier), but if I try immediately for the second time, it then starts and succeeds. BTW, I observe the same behavior when trying to flash from the Crazyflie PC client, the first time it gives an error, the second time is ok.

Interestingly, just the datalink works fine through the USB hub. Although, sometimes (quite often actually, am running at 2M as recommended with the LPS deck) the connection breaks due to "Too many packets lost".

And, even more interestingly, when running things from the VM, the flashing works fine *through the USB hub*, directly on the first attempt...

So while I now have a working workflow (thanks a lot theseankelly!!!), it is still a bit puzzling, and also a bit annoying as I have to disconnect the hub everytime I want to flash.
Why would the Crazyradio performance be worse in Windows than in the VM (running on the same machine on the same Windows intallation...)? Driver issue? Or USB port settings?

One thing I have noticed: while in the VM the radio device stays connected all the time, in Windows when I start flashing via cfloader (or via the PC client), I hear the sound of disconnecting and connecting USB device in Windows...



matejkarasek
Beginner
Posts: 11
Joined: Tue Jul 09, 2019 11:50 am

Re: Firmware development in Windows

Post by matejkarasek » Tue Aug 06, 2019 9:32 pm

Just a small update, following these instructions I was able to get it working also on a second PC with clean Windows 10 (ver 1903).
The USB driver issue is not present here.

@kimberly I can help to update the corresponding wiki page, should that be helpful...

kimberly
Expert
Posts: 107
Joined: Fri Jul 06, 2018 11:13 am

Re: Firmware development in Windows

Post by kimberly » Wed Aug 07, 2019 7:56 am

Hi Matej,

Yes! that will be great. We are currently busy of migrating the wiki pages to markdown pages in the repositories. @thesankelly also wanted to contribute to an tutorial as well, but it might be better to wait until we got the move more finalized. You can start making markdown pages of the instructions in the mean time and once I give the heads up you can make a pull request to the designated repositories?

But maybe best to discuss the right strategy in this thread for the documentation :) viewtopic.php?f=2&t=3596

Post Reply