[Fx2lib-devel] Upgrades to fx2lib and new eeprom example firmware.
Status: Beta
Brought to you by:
mulicheng
|
From: Dennis M. <de...@ub...> - 2009-03-03 19:08:12
|
I just pushed a number of changes to fx2lib.
Of note, Eric just spent a while getting udev rules to automatically
load the firmware. An alternative approach would be to use the Hex2Bix
program provided by Cypress to convert the ihx file into an iic file and
load the iic file onto the eeprom of the device. You can use the eeprom
example firmware directly or you can copy the functionality in to your
own firmware.
Here is how you'd use hex2bix and the example eeprom firmware.
1) build your ihx file.
2) Hex2Bix -I -M 10000 -F 0xc2 yourfirmware.ihx yourfirmware.iic
# (-M isn't too important as long as it is the memory size specified is
big enough for your firmware)
3) I provided a python client in the examples/eeprom.
functions:
get_eeprom(addr,length) -> returns length iic bits at addr.
fetch_eeprom() -> dynamically reads iic file until entire iic from prom
is fetched
set_eeprom(bits) -> load an iic file onto the eeprom.
You can use get/set eeprom to verify that you loaded the file correctly.
You'll want to be familiar with the reset example firmware if you play
around with the eeprom data ;)
Additional NOTE: I ported hex2bix to Unix/Linux (Cypress provides the
code), but I haven't added it to the library because they have a Cypress
copyright notice and I haven't taken the time to recreate the
functionality from scratch. Send me an email if you'd like the file though.
Here is the git log since the 0.1 tag:
commit f625bb39eec6251cd154f742c9b53d0c5e5f1093
Author: Dennis Muhlestein <de...@ub...>
Date: Tue Mar 3 11:55:41 2009 -0700
Additional macro in setupdat.h (SETUP_TYPE).
Ignore iic files.
commit d317bb16ad3cabc73aa3c93483c2e3f45897d20c
Author: Dennis Muhlestein <de...@ub...>
Date: Tue Mar 3 11:53:30 2009 -0700
bix output in Makefile
commit 7eccd3c4b07c2c3161e0156d8ed8f9483a188914
Author: Dennis Muhlestein <de...@ub...>
Date: Tue Mar 3 11:51:12 2009 -0700
Modified the eeprom read/write routines to return FALSE if the i2c
read/write commands didn't work.
Also modified i2c_write to try again (similar to first implementation)
if no ACK received after writing the address. I found the eeprom on the
development board sometimes does not ack the first time. TRM says to
try again in this case. A side effect of this is you need to make sure
you are writing to an address that exists or the command will block.
commit 8c975fa8241a82182fa0e357e0b6839821a96363
Author: Dennis Muhlestein <de...@ub...>
Date: Tue Mar 3 11:46:58 2009 -0700
Improvements to python bindings. (Allow vendor command variable
timeout.)
Added script fx2load to python package for convenience.
Added eeprom loading example that can read/write iic files from the
eeprom.
commit 6bca9c94dee103e153569ed1fc9f3da66ba3bb10
Author: Dennis Muhlestein <de...@ub...>
Date: Tue Mar 3 09:01:10 2009 -0700
Fixed forgotten import on python example.
|