Brian:
You need to learn to speak "marketing" and "binary".
A 32 k EEPROM (named by marketing) is a 32k BIT EEPROM.
32k BITs divided by 8 bits-per-byte is 4k BYTES.
4k BYTES is 0x1000 BYTES.
So, your address space wraps around every 0x1000 BYTES.
The data is not repeated every 0x1000 bytes, it is the SAME data.
Sounds like your EEPROM is working just fine.
--- Graham
==
On Friday, July 15, 2016 at 10:47:54 AM UTC-5, Bryan Wilcutt wrote:
>
> I've been playing with the BBB 32k eeprom by reading and writing data to
> it. I use fseek(), fopen(), fread() and fwrite(). The device I am
> reading/writing/opening is:
> /sys/bus/i2c/devices/0-0050/at24-0/nvmem
>
> This does seem to work however not well. I noticed that the same data is
> repeated every 0x1000 bytes. Why is that? Am I not addressing the part
> correctly? Since I'm ultimately using the at24.c driver, I inspected it
> and it does seem to attempt to translate addresses for the part. Are there
> specific limitations with at24 that I should be aware of, nothing seems to
> be documented that I've seen.
>
> #define e2FILE "/sys/bus/i2c/devices/0-0050/at24-0/nvmem"
>
> int readEEPROMAt(unsigned char *p, unsigned int startAddr, unsigned
> int len)
> {
> int retVal = 0;
> FILE *fp = NULL;
>
> if ((fp = fopen(e2FILE, "r")) != NULL)
> {
> if (fseek(fp, startAddr, 0) == 0)
> {
> if (fread(p, 1, len, fp) != len)
> printf("Error: Cannot read EEPROM\n");
> else
> retVal = 1;
> } else {
> printf("Error: Could not index EEPROM, no data read.");
> }
> } else {
> printf("Error: Cannot open EEPROM\n");
> }
>
> if (fp)
> fclose(fp);
>
> return retVal;
> }
>
> Bryan
>
>
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/c3398c22-fcc3-4ac6-961e-84dc3775f992%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.