An Open Source Library for Writing Firmware on the Cypress FX2 with SDCC

After playing around with the Cypress FX2 and SDCC for the past while, I've developed a library of utilities that make some of the common tasks for writing firmware and performing certain functions a little easier. I'm lucky to work for a company that approves of the open source initiative and believes that it is beneficial to give back as well as receive from a wider audience of developers. That being said, I've created a git repository with my library:

Here is fx2lib on github: http://github.com/mulicheng/fx2lib/

You can clone it with git like this:

  1.  
  2. > git clone git://github.com/mulicheng/fx2lib.git fx2lib
  3.  

Here is a short list of some of the things you can do with this library:

  1. Read/Write data on the i2c bus
  2. Handle USB and GPIF interrupts
  3. Read/Write data on to a serial console
  4. Handle the common USB vendor commands
  5. Implement your own vendor commands
  6. Program the GPIF

Hope you enjoy!

Update 12/15/08: Added project home page at Sourceforge: fx2lib home.

4 Responses to “An Open Source Library for Writing Firmware on the Cypress FX2 with SDCC”


  1. Vikas

    I am not able to make GPIF working in SDCC. Can you post a simple GPIF example in this lib.

  2. groz

    This was a great starter for the fx2. I’ve got a bunch of fx2 based devices here, was able to get the ‘hello’ program to compile, and run on all of them. My next challenge is read/write the eeprom, have not successfully accomplished the read yet, so dare not yet try the write.

    I suspect i may be missing some steps in actually setting up the i2c, still digging. Do you have a functional example that just reads the eeprom via i2c, start to finish ?

  3. Dennis

    As a matter of fact, I do. I’m using it to read real eeprom data off a device with an fx2 on the board. I can read and write the data. I have a reset program that will take the fx2 devel board and put it back into it’s factory state if you bork the eeprom data too. Why don’t you sign up on the mailing list (link on the fx2 sf wiki page) and I’ll post more details on there.

  4. bvwelch

    Very nice library, thank you! I was able to dump the original eeprom of my board. Now I can experiment without worrying if I ever need to restore it.



css.php