When I am running the I2C-Tools of eeprog makefile for read and write data from EEPROM I2C(CAT24C256) through linux.
astra@astra-OptiPlex-3020:~/niraj_workspace/eeprog-0.7.6(1)/eeprog-0.7.6$ make clean
rm -f eeprog 24cXX.o
astra@astra-OptiPlex-3020:~/niraj_workspace/eeprog-0.7.6(1)/eeprog-0.7.6$ make all
cc -g -I. -Wall -O2 -c -o 24cXX.o 24cXX.c
cc eeprog.o 24cXX.o -o eeprog
And After that when I am trying to read or write,I am getting like this.
astra@astra-OptiPlex-3020:~/niraj_workspace/eeprog-0.7.6(1)/eeprog-0.7.6$ ./eeprog -f -16 -w 0 -t 5 /dev/i2c-0 0x50
./eeprog: invalid option -- 't'
Error at line 196: Both read and write requested
astra@astra-OptiPlex-3020:~/niraj_workspace/eeprog-0.7.6(1)/eeprog-0.7.6$ ./eeprog -xf /dev/i2cv-0 0x50 -16 -r 0x10:0x20
eeprog 0.7.6, a 24Cxx EEPROM reader/writer
Copyright (c) 2003-2004 by Stefano Barbato - All rights reserved.
Bus: /dev/i2cv-0, Address: 0x50, Mode: 16bit
Error eeprom_open: No such file or directory
Error at line 244: unable to open eeprom device file (check that the file exists and that it's readable)
I am doing right or wrong for this. And I am running this makefile.
CFLAGS=-g -I. -Wall -O2
all: eeprog
clean:
rm -f eeprog 24cXX.o
eeprog: eeprog.o 24cXX.o
eeprog-static: eeprog.o 24cXX.o
$(CC) -static -o $@ $?