Closed jhoenicke closed 9 years ago
I would much rather see it done in C, I believe it will be more accessible and there is plenty of flash space for that so optimization is not a real issue in my opinion.
I don't have a device at hand yet to do the C work myself and it will be a shame to have duplicate efforts.
What can I do to help you out to get going with the C compiler?
At least on Debian all I needed was to apt-get install sdcc and you'll want the fx2lib library as well. There is an example code in the sigrok fx2lafw firmware that does logic analyzer in a similar hardware (it usually uses the 56 pin package though).
I looked at fx2lib and it seems to be part of the source code of the original firmware. I willl try it with this library.
Gentlemen,
fx2lib is in the original firmware? I think fx2lib is GPL/LGPL, and I'm not sure exactly how to interpret "static/dynamic linking" in this context, but wouldn't that possibly mean that the original firmware should be either GPL or LGPL?
On Sat, May 2, 2015 at 1:41 AM, Baruch Even notifications@github.com wrote:
Sources of help for writing the firmware:
- fx2lafw http://sigrok.org/wiki/Fx2lafw - Sigrok FX2LP firmware for a logic analyzer
- OsciPrime http://www.osciprime.com/index.php?p=specs - a slow scope implemented with FX2LP, open source firmware
- UUUSB http://lea.hamradio.si/%7Es57uuu/uuusb/ - A data acquision with great explanation for using FX2LP FIFOs, also links to software
— Reply to this email directly or view it on GitHub https://github.com/rpcope1/Hantek6022API/issues/16#issuecomment-98326467 .
I don't know if fx2lib is in the original firmware. The way the code is written with jump tables looks like it was written in assembly to me and I doubt they would have bothered with fx2lib in that case. It is more likely they used the original code from Cypress.
IF they used the fx2lib then you could claim that you have a right to their full source code. It will take a lot of effort and the only one who can sue them anyhow is the author of fx2lib, you can only come forward with a claim and if they refuse ask the fx2lib author to join in the fight if he wants to. That is all IF they really did use the original fx2lib code. That will be non-trivial to prove too.
I personally wouldn't bother with going that route for this project, we probably can create at least the same level of firmware if not better by just reverse engineering their wirings.
Here is my first attempt of a firmware:
https://github.com/jhoenicke/Hantek6022API/commits/customfirmware
It can be switched between isochronous and bulk transfer by setting the alternative interface (set_interface(1) for iso, set_interface(0) for bulk). It's not completely tested yet, but I could successfully record some traces using the isochronous interface.
You have to compile the firmware separately by going into the HantekFirmware/custom directory and running make
there.
Very cool! I'll give it a try later.
I added a pull request for my custom firmware. I think it is ready now. I didn't test the old read modes much, though. I really recommend isochronous mode, unless you really need 30 MHz sampling or two channels with 16 MHz. With isochronous mode, you can sample 24 MHz with one channel or 12 MHz with two channels. Of course, you can also choose lower sampling rates. In that case you can also use a different isochronous interface with less bandwidth. The scope will only use the bandwidth it needs anyway, but you save a few handshakes and it may allow you to run two or more scopes on a single usb hub (once that is supported by the library).
I plan to write the firmware from scratch to avoid copyright problems. The new firmware will probably be written in assembler (I'm too lazy to get the C compiler running).
The new firmware should support two USB configurations, one for bulk and one for isochronous. The bulk configuration should be interface-compatible to the stock firmware. We could then also add new firmware features more easily.