New Windows OLS FPGA (& PIC firmware!) image loader...

A cheap logic analyzer. Get one for $50, including worldwide shipping. A collaboration between the Gadget Factory and Dangerous Prototypes.

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby dogsbody » Mon Mar 14, 2011 4:43 am

Here is a version that properly detects/describes the Logic Sniffer on Windows XP, Vista & Win7. Turned out to be really quite annoying to fix.

The registry entry for the Logic Sniffer had a description line stating "Logic Sniffer". However, none of the setupapi functions would return that. Only "Communications Port" or the location info. XP was fine. Not Vista or Win7. Nice improvement there Microsoft. Ug.

So now ols_winloader plies the depths of the USB database, and grabs the product description direct.

Cheers!
-- IED
Attachments
ols_winloader_v2.03.zip
(107.18 KiB) Downloaded 503 times
ols_winloader_src_v2.03.zip
(113.4 KiB) Downloaded 424 times
User avatar
dogsbody
Full Member
Full Member
 
Posts: 181
Joined: Wed Jan 05, 2011 3:17 am
Location: San Jose, California

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby octal » Fri May 06, 2011 7:35 am

Would it not be easier if we switch from using CDC to HID?
With HID you can easily detect the device under any OS (at least the APIs are well documented everywhere under any version of Winxxx)!
octal
Sr. Member
Sr. Member
 
Posts: 283
Joined: Mon Apr 12, 2010 10:46 am
Location: France

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby dogsbody » Fri May 06, 2011 1:41 pm

A HID based search for the OLS in the USB database is exactly what I do now. It works fine, but takes a lot of setup for the API call's, and is noticeably slower.

I could have cheated & hardcoded the strings, but I was feeling extremely annoyed with Microsoft, and d*mn determined to find a way to get that description. :-)
-- IED
User avatar
dogsbody
Full Member
Full Member
 
Posts: 181
Joined: Wed Jan 05, 2011 3:17 am
Location: San Jose, California

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby honken » Fri May 06, 2011 2:48 pm

Not having looked at your detection sw, what's wrong with searching for vid/pid? It is supposed to be unique for the ols.

Then again, I have only used pyUSB for host software, which is great by the way.

I beleave your trouble lies in that cdc-acm is used as an abstraction layer. It is supposed to hide all usb details from user (software). It lays the responsibilty on the user (human) to correctly choose the right com port

I have an dfu bootloader in the works. All generic sw written but bug ridden. Needs some cpu specific flash write functions as well as code guarding and general rootkitness implemented.

Dfu works by adding an extra interface on the device for handeling the fw updates.

It has been a painfully slow development. At least three month and some 300 lines of code without any tries to even compile asI know it wouldn't work. But if there is intrest to follow I could branch the stack in cvs and add the dfu part.

[EDIT] Just realized this post is probably in the wrong topic. Desregard and reread with another state of mind. It is friday knight, shrimps (marine not logic) and white wine (drink not os abstraction)...
User avatar
honken
Full Member
Full Member
 
Posts: 190
Joined: Fri Feb 26, 2010 10:34 am
Location: Stockholm/Sweden

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby octal » Fri May 06, 2011 3:02 pm

dogsbody wrote:A HID based search for the OLS in the USB database is exactly what I do now. It works fine, but takes a lot of setup for the API call's, and is noticeably slower.



Why looking for HID device in registry or db?
If you know your VID/PID, you can "find" your device directly, with a single function call. Why do you want to look at it in registry?
octal
Sr. Member
Sr. Member
 
Posts: 283
Joined: Mon Apr 12, 2010 10:46 am
Location: France

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby dogsbody » Fri May 06, 2011 3:11 pm

I'm not looking in the registry. I'm enumerating the USB device tree. Also HID was poor choice of words on my part. HID is a type of USB device & a mode of the OLS can operate in, different from the COM port.

The VID/PID of the OLS is what is used to search the USB database. Enumerating root nodes, then any discovered hubs & endpoints, repeatedly enumerating those for more devices, etc... until finding an OLS.

I'm unaware of any single function call able to return the true USB description (& not some helpfully Windowized text), that works on XP/Vista & 7. Then again, this was my first foray into USB hell.
-- IED
User avatar
dogsbody
Full Member
Full Member
 
Posts: 181
Joined: Wed Jan 05, 2011 3:17 am
Location: San Jose, California

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby octal » Fri May 06, 2011 3:45 pm

dogsbody wrote:HID is a type of USB device & a mode of the OLS can operate in, different from the COM port.
-- IED

This is what I said, if we change the communication mode from CDC (virtual com port) to HID (Human Interface Device like key or mouse), we can do it quite easily.
octal
Sr. Member
Sr. Member
 
Posts: 283
Joined: Mon Apr 12, 2010 10:46 am
Location: France

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby dogsbody » Fri May 06, 2011 9:16 pm

Ok... sorry. Just being a little slow. Haven't thought about this thing for a couple months.

There are a few issues...

First, it's hard to get away from the COM port. The command to switch into bootloader mode is issued over the COM port. So you have to enumerate the serial ports anyway.

Next, you must query the hardware-id to verify the correct VID/PID. Don't want to issue anything to a non-OLS.

Next, issue the bootloader switch command, which causes the OLS to disconnect & reconnect into HID mode. So Windows goes be-doop, do-beep whenever starting your tool. Possibly multiple times if you have multiple OLS's hooked up.

Next, if I remember correctly, the OLS has a different VID/PID in bootloader mode with a different description. So you won't get the "CDC-232 Logic Sniffer" description anyway. Doh.

Lastly, if the user exits your tool you need to restore the serial port mode (another disconnect/reconnect). Otherwise the user would have to hit the reset button. Doesn't strike me as user friendly.

One last thought... does the PIC bootloader even support updating the fpga flash chip? Thought it was only for updating firmware.
-- IED
Last edited by dogsbody on Sat May 07, 2011 4:35 am, edited 1 time in total.
User avatar
dogsbody
Full Member
Full Member
 
Posts: 181
Joined: Wed Jan 05, 2011 3:17 am
Location: San Jose, California

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby octal » Sat May 07, 2011 3:48 am

Hi Dogsbody,
we can simply use the PICKit2 Pins on the OLD and add a jumper on them, then when user resets the PIC it goes in bootloader mode. After all, bootloader mode is not for use 50 times per day, it will be used only once each firmware release. I think a special command to make OLS switching to bootloader mode is useless.
octal
Sr. Member
Sr. Member
 
Posts: 283
Joined: Mon Apr 12, 2010 10:46 am
Location: France

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby dogsbody » Sat May 07, 2011 4:45 am

When working on new FPGA images, I easily reflash my OLS a dozen+ times/day. Having to fool around with jumpers in addition to the reset button would be a real hassle. Avoiding bootloader mode whenever possible is probably a lot faster also.

I specifically wrote ols_winloader to make -my- life easier during fpga development. If other people find it useful, that's a bonus. :-)

My current method for obtaining the OLS product description is a pain, but it works, so I'm not inclined to tempt fate.

However, if you come up with a cleaner/faster method of fpga image programming I'll definitely be interested.

Cheers!
-- IED
User avatar
dogsbody
Full Member
Full Member
 
Posts: 181
Joined: Wed Jan 05, 2011 3:17 am
Location: San Jose, California

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby ian » Sat May 07, 2011 4:49 am

One last thought... does the PIC bootloader even support updating the fpga flash chip? Thought it was only for updating firmware.


You're right, the bootloader is quite small (fits in the first few pages of flash) and it only does the firmware upgrades. If the bootloader did the flash updates too, we couldn't add support for new ROM chips without a bootloader update.

The command to jump to bootloader helps people who don't have the ICSP header, it also makes an all-in-one upgrade app possible.

I really like this app, I use it for a lot of FPGA development :) Firmware stuff though, is usually done directly with a debugger.
User avatar
ian
Crew
Crew
 
Posts: 10803
Joined: Mon Jul 06, 2009 6:14 am

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby baxev2005 » Sun Jan 15, 2012 2:53 pm

Excelent tool. I was afaraid to upgrade, seemed too complicated to me, until I tried your tool. Everything went ok, PIC & FPGA firmware were upgraded without a sinlge problem. Use Win XP. Many many thanks
baxev2005
Newbie
Newbie
 
Posts: 3
Joined: Sun Jan 15, 2012 2:44 pm

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby firehopper » Mon May 14, 2012 12:33 pm

this program is nice but does not support the newest flash chips found on some of the newer OLS boards gotten from linksprite.

windbond w25x80

ef 40 14 00
firehopper
Newbie
Newbie
 
Posts: 4
Joined: Mon May 14, 2012 11:49 am

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby dogsbody » Mon May 14, 2012 2:02 pm

Thanks for the heads up!

It's weird... I updated olswinloader (to v2.04) with the latest table nearly a year ago (May 19th, 2011). Could have sworn I uploaded it to the forum, but it was still showing 2.03. v2.04 definitely has the "ef 40 14 00" sequence at least.

I've also got a little support page for it here: http://mygizmos.org/ols/olswinloader.html.

Hope this helps!
-- IED
Attachments
ols_winloader_v2.04.zip
(107.21 KiB) Downloaded 417 times
ols_winloader_src_v2.04.zip
(113.42 KiB) Downloaded 357 times
User avatar
dogsbody
Full Member
Full Member
 
Posts: 181
Joined: Wed Jan 05, 2011 3:17 am
Location: San Jose, California

Re: New Windows OLS FPGA (& PIC firmware!) image loader...

Postby firehopper » Mon May 14, 2012 4:06 pm

yes it did :) thanks I found my way to there somehow and got it downloaded, works good now :) thanks :)
firehopper
Newbie
Newbie
 
Posts: 4
Joined: Mon May 14, 2012 11:49 am

PreviousNext

Return to Open Bench Logic Sniffer

cron