0

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 $@ $?
Gerhardh
  • 11,688
  • 4
  • 17
  • 39
  • 1
    eeprog has no `-t` option. Why `v` in `/dev/i2cv-0`? – dimich Jun 19 '23 at 13:35
  • And with eeprog ,I tried but I am getting core dumped and eeprog not found.astra@astra-OptiPlex-3020:~/niraj_workspace/eeprog-0.7.6(1)/eeprog-0.7.6$ ./eeprog /dev/i2c-0 0x50 -x -r 0x10:0x20 eeprog 0.7.6, a 24Cxx EEPROM reader/writer Copyright (c) 2003-2004 by Stefano Barbato - All rights reserved. Bus: /dev/i2c-0, Address: 0x50, Mode: 8bit *** stack smashing detected ***: terminated Aborted (core dumped) astra@astra-OptiPlex-3020:~/niraj_workspace/eeprog-0.7.6(1)/eeprog-0.7.6$ date | eeprog /dev/i2c-0 0x50 -w 0x200 eeprog: command not found – Niraj Kumar Jun 20 '23 at 05:50
  • The "command not found" error is because you used used the command `eeprog` instead of `./eeprog`. – Ian Abbott Jun 21 '23 at 11:37
  • I am using eeporg instead of ./eeprog then I am getting "command not found". astra@astra-OptiPlex-3020:~/gajanan_eclipse/EEPROG$ eeprog /dev/i2c-0 0x50 -x -r 0x22:0x20 eeprog: command not found – Niraj Kumar Jun 22 '23 at 05:56
  • with ./eeprog,getting like this -astra@astra-OptiPlex-3020:~/gajanan_eclipse/EEPROG$ date | ./eeprog /dev/i2c-0 0x50 -w 0x0 eeprog 0.7.6, a 24Cxx EEPROM reader/writer Copyright (c) 2003-2004 by Stefano Barbato - All rights reserved. Usage: eeprog [-fqxdh] [-16|-8] [ -r addr[:count] | -w addr ] /dev/i2c-N i2c-address Address modes: -8 Use 8bit address mode for 24c0x...24C16 [default] -16 Use 16bit address mode for 24c32...24C256 Actions: -r addr[:count] Read [count] (1 if omitted) bytes from [addr] and print them to the standard output – Niraj Kumar Jun 22 '23 at 09:42

0 Answers0