Using fpgalink to read byte addressible EEPROM contents?

41 views
Skip to first unread message

Tim Ansell

unread,
Sep 20, 2015, 9:30:32 AM9/20/15
to fpgalin...@googlegroups.com
Hi,

It appears that the fpgalink fx2 firmware doesn't support single byte addressable EEPROMs?

The FX2 boot loader supports two I²C-compatible EEPROM types:
 * EEPROMs with slave address 1010 that use an 8-bit internal address (e.g., 24LC00, 24LC01/B, 24LC02/B).
 * EEPROMs with slave address 1010 that use a 16-bit internal address (e.g., 24AA64,24LC128, 24AA256).

As we are only storing the VID:PID in the EEPROM plus a serial number, we have gone with the small byte addressable device and then been struggling with getting weird results from fpgalink. After looking at it for a while, I think these types of EEPROMs don't currently work with fpgalink. What isn't clear to me is why we aren't getting some type of bus/slave error when we try and write double width addresses.

It seems like the fix is to modify the prom.c in the fx2 firmware to only write two byte addresses when using such EEPROMs.

Any further advice?

Tim 'mithro' Ansell

Chris McClelland

unread,
Sep 20, 2015, 11:44:50 AM9/20/15
to fpgalin...@googlegroups.com
I think you're right, the code to change is in firmware/fx2/prom.c. The address is sent to the EEPROM once[1] in promRead() and again[2] in promWrite(). I suspect removing the MSB write will make it work, but I can't test it because I don't have any small EEPROMs. It's probably not worth making it tweakable at runtime - a compile-time option will do.


--
You received this message because you are subscribed to the "FPGALink Users" mailgroup (see https://github.com/makestuff/libfpgalink/wiki/FPGALink).
 
To post to this group, send email to fpgalin...@googlegroups.com
To unsubscribe from this group, send email to
fpgalink-user...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/fpgalink-users?hl=en
---
You received this message because you are subscribed to the Google Groups "FPGALink Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fpgalink-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tim Ansell

unread,
Sep 27, 2015, 9:11:07 AM9/27/15
to fpgalin...@googlegroups.com
Is there a good reason you aren't using the eeprom_read/eeprom_write commands from fx2lib/lib/i2c.c (see https://github.com/mithro/fx2lib/blob/master/lib/i2c.c#L279)? They already handle the two byte verses single byte addressing (turns out the Cypress automagically detects the mode puts it in a register you can query).

I ended up being able to read/write my eeprom using the example firmware at https://github.com/mithro/fx2lib/tree/master/examples/eeprom which worked pretty well.

Tim 'mithro' Ansell

Chris McClelland

unread,
Sep 27, 2015, 11:38:48 AM9/27/15
to fpgalin...@googlegroups.com

The code in prom.c dates back to late 2008 or so, well before FPGALink existed. So, I don't remember my reasons for not using the fxlib EEPROM code, but it was probably because I wasn't aware of its existence.

Anyway, glad you got it fixed.

Reply all
Reply to author
Forward
0 new messages