Close

burn firmware CY7C68013A on a Mac [nightly brain dump]

davedarkodavedarko wrote 03/06/2017 at 01:50 • 4 min read • Like

Warning: Only read if you want to flash and use the CY7C68013A module with sigrok on a mac!


It all started six years ago with this article, written by @Mike Szczys: http://hackaday.com/2011/12/15/saleae-logic-analyzer-knockoff-hacking/


Once upon a time I bought a - CY7C68013A dev board [https://sigrok.org/wiki/Lcsoft_Mini_Board], because I read that one could use this shiny cheap thing with the fancy Saleae Software and it actually thinks it's one of their fancy equipment. I never really got it to work though (lack of experience, definitely). Skip forward 4 years and I thought to myself, this time I could make it work. Taking it with me on a vacation, I tried to make it work on a Raspberry PI, fooled around with the firmware, got frustrated, you guessed it, back in the drawer.

Now I'm fuzzing around with the Game Boy and thought that a logic analyzer would come in very handy, talked to guys in the #Hack Chat and gave it another try, this time with the open source program sigrok and their beautiful pulseview (you want that, not just the command line!) - side note: I'M ON A MAC.


If you want to have the beautiful GUI, you HAVE TO follow the build instructions called "UNSTABLE" - there is an instruction you can follow here: https://sigrok.org/wiki/Mac_OS_X - you need to have homebrew [https://brew.sh/] installed.

$ brew tap rene-dev/sigrok
$ brew install python3
$ brew install --HEAD libserialport
$ brew install --HEAD --with-libserialport libsigrok
$ brew install --HEAD libsigrokdecode
$ brew install --HEAD --with-libserialport sigrok-cli
$ brew install --HEAD pulseview

Do this and you should be fine with a non-tinkered or vacation-flashed EEPROM. Otherwise you're in trouble again, my friend. When I fired up my CYWHATEVER module with the jumper set, I got the module recognized as a Saelae 8 Channel device, but when I tried the 16-channel version, it failed on me. Hmm, bad. So I had to flash the EEPROM somehow with something. K.

https://sigrok.org/wiki/Lcsoft_Mini_Board/Info#Flashing_fx2lafw_to_the_EEPROM

You need a little program called fxload. I found a guy that ported cypress fx2 stuff to work with mac and another guy that wrote a "tutorial", but before the first guy moved the folder in the git. So here's how I "managed" to make it work.

git clone https://github.com/nall/nexys2-osx.git
cd nexys2-osx/fxload
xcodebuild
ln -s build/Release/fxload-osx /usr/local/bin/fxload
I'm not sure if the linking part is correct, I had to unlink and use a direct link from where I downloaded it into. The thing is, xcodebuild will probably fail on you, if you haven't installed the 2GB+ xcode. If you have that, open the downloaded files / main.m and wait for a "we need to fix stuff" - yellow warning thing that you can push, this will fix the issue with a missing path to osx10.5 library thing. After that you should be finally able to use the xcodebuild command (I'm not an xcode guy).

So "luckily" the guys of sigrok offer a firmware file for everything and we're ready to go, right? Wrong. They're actually something else, you need a hex file for that, and as they say: "To flash the firmware, you will need a hex file containing the firmware, fx2lafw-cypress-fx2.ihx. Since the hex file is a byproduct of the build, you will need to build the firmware from sigrok-firmware-fx2lafw sources".

I tried to download the sigrok firmware part and compile it, so I can get the needed hexfile, that is not in the precompiled firmware folder. Bummer. But the './configure' script broke down on me, wanting a "sdcc-sdcclib", so I finally gave up and tried googling again, before firing up my rPI. Here is where I found my hexfile "fx2lafw-cypress-fx2.ihx":

http://lagrange.cloud-7.de/et_al/sigrok070_for_suse13.2/build/sigrok-firmware-fx2lafw/build/hw/cypress-fx2/

fxload -v -t fx2 -D 04b4:8613 -I fx2lafw-cypress-fx2.ihx

Now I'm just happy to tell, that Port B and Port D are reading and streaming! - Well. Seems like there's something else wrong and pulseview can't upload the firmware correctly to the chip, but it works if I upload it myself before starting pulseview. So bash script it is. Fancy bash script. Download the pulseview App starter here [https://cdn.hackaday.io/files/16188692587392/pulseviewAPP.zip] - and copy it into your applications folder. Can't find it in the finder searchbar yet.


[UPDATE] The firmware fix was actually easy, I just had to copy the precompiled *.fw files into /usr/local/share/sigrok-firmware now runs without pre firmware fxload stuff. Yay! So not so useless after all.

I've made a little board / shield, to go on top of the module, since the pinout is less optimal. It's based on the suggestions of the sigrok pages, some resistors and diodes for protection.

Order from OSH Park

Like

Discussions

Reiner Buehl wrote 05/29/2019 at 17:49 point

I would like to use your board layout but have trouble finding 1N4148 diodes in the SOT-123FL package that is used in the BRD file. Are you able to recommend an alternative package size?

  Are you sure? yes | no

Reiner Buehl wrote 05/29/2019 at 18:41 point

Or should the diodes be Zehner diodes like in the sample diagram at https://sigrok.org/wiki/Circuits_for_barebone_boards?

  Are you sure? yes | no

davedarko wrote 05/29/2019 at 19:30 point

Hi! Those are actual Zener diodes :) they come in a glas package like the 1N4148 does, I might have used the wrong footprint / label - sorry! 

[edit] actually I am now unsure what I have soldered on that shield and what's in the bag that says SMD N4148 diodes :D Go with Zener diodes :)

  Are you sure? yes | no

Reiner Buehl wrote 05/30/2019 at 04:20 point

Okay, thanks for clearing that up :-) Then I will go with 3.3V Zehner diodes in SOD80 packaging. They are the glass type two pin format and should fit on the pads.

  Are you sure? yes | no

Arya wrote 03/06/2017 at 02:32 point

Hmm, that's going to be interesting - I have one of those boards, ordered it for the laptop battery chip unbricking, if I ever get to it, heard that it could be used as an analyzer, too, but never had the need =)

  Are you sure? yes | no

davedarko wrote 03/06/2017 at 08:16 point

Seems like it's still a bit unstable when it comes to sigrok recognizing and starting it - hopefully I can fix that soon.

  Are you sure? yes | no