Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-30 Thread 'Johan Lind' via BeagleBoard
I have now been able to write to the eeprom. First I wrote a file with 30 bytes of data, then I calculated the crc16 (pol 8005) and inverted the result bit wise. int main(void) { uint8_t buf[32]; uint16_t crc; std::ofstream out_file; crc = 0; for (int idx = 0; idx < 30; idx++)

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-30 Thread 'Johan Lind' via BeagleBoard
I think we're getting closer to the truth now. Reading the source code and especially this section is interesting: #ifdef CONFIG_W1_SLAVE_DS2433_CRC /* can only write full blocks in cached mode */ if ((off

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-30 Thread Sven Norinder
Maybe kernel must have crc enabled for 2433 writes? Last line implies something about writes. config W1_SLAVE_DS2433 tristate "4kb EEPROM family support (DS2433)" help Say Y here if you want to use a 1-wire 4kb EEPROM family device (DS2433). config W1_SLAVE_DS2433_CRC

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-30 Thread 'Johan Lind' via BeagleBoard
Well, I have an i2c memory on the same board and to read and write to that I can use the following commands: write cat data.eeprom > /sys/bus/i2c/devices/2-0057/eeprom read cat /sys/bus/i2c/devices/2-0057/eeprom | hexdump I did try your suggestion of using dd but I could not get it to work.

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread Sven Norinder
The eeprom probably is a device, not a filesystem. Use dd instead. /Sven tisdag 29 september 2020 kl. 17:59:14 UTC+2 skrev Johan Lind: > I tried with only a short (6 bytes) string but still the same behaviour. > > > tisdag 29 september 2020 kl. 17:45:47 UTC+2 skrev robert.sty...@gmail.com: > >>

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread 'Johan Lind' via BeagleBoard
I tried with only a short (6 bytes) string but still the same behaviour. tisdag 29 september 2020 kl. 17:45:47 UTC+2 skrev robert.sty...@gmail.com: > I suggest trying to write less than 32 bytes (the dmesg implies something > wrong with offset or count) -- create a file of less than 32 bytes

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread robert.sty...@gmail.com
I suggest trying to write less than 32 bytes (the dmesg implies something wrong with offset or count) -- create a file of less than 32 bytes and copy to eeprom cd ~ echo "1234567890" > file10 cp -T file10 /sys/bus/w1/devices/23-02eddd9b/eeprom In the data sheet you need a much smaller R[PU]

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread Robert Nelson
On Tue, Sep 29, 2020 at 9:55 AM 'Johan Lind' via BeagleBoard wrote: > > Yes, it does still show eeprom > > debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b > driver eeprom id name power subsystem uevent > debian@beaglebone:~$ ls /sys/bus/w1/devices/ > 23-02eddd9b

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread 'Johan Lind' via BeagleBoard
Yes, it does still show eeprom debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b driver eeprom id name power subsystem uevent debian@beaglebone:~$ ls /sys/bus/w1/devices/ 23-02eddd9b w1_bus_master1 debian@beaglebone:~$ debian@beaglebone:~$ ls -al

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread robert.sty...@gmail.com
Does ls /sys/bus/w1/devices/23-02eddd9b still show eeprom ? If not, what does ls /sys/bus/w1/devices show you? I prefer to run commands from my home director, you can change to your home with 'cd ~' On Tuesday, 29 September 2020 at 15:15:27 UTC+1 Johan Lind wrote: > Thank you (and sorry

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread 'Johan Lind' via BeagleBoard
Thank you (and sorry for the double post) ! However, I still have no luck writing to the eeprom. I have tried a couple of variations of the commands but I get error even if logged in as root. debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo sh -c "echo 'cat /home/debian/file' >

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-25 Thread robert.sty...@gmail.com
Also the copy command cp -T *source* *destination* so... sudo cp -T /home/debian/file eeprom On Friday, 25 September 2020 at 16:48:24 UTC+1 robert.sty...@gmail.com wrote: > Wasn't the problem that the redirection of output by ">" was outside the > sudo *command* > The "echo" is not needed,

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-25 Thread robert.sty...@gmail.com
Wasn't the problem that the redirection of output by ">" was outside the sudo *command* The "echo" is not needed, only sudo sh -c "cat /home/debian/file > eeprom" On Friday, 25 September 2020 at 15:59:06 UTC+1 RobertCNelson wrote: > On Fri, Sep 25, 2020 at 9:48 AM johan.lind via BeagleBoard >

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-25 Thread Robert Nelson
On Fri, Sep 25, 2020 at 9:48 AM johan.lind via BeagleBoard wrote: > > I would need some help to understand why I can't write to an DS2433 eeprom. > > System information: > BBB Industrial board > Debian 10 (Buster IoT Image 2020-04-06) > Hardware attached are DS2482 i2c to w1 interface and DS2433

[beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-25 Thread johan.lind via BeagleBoard
I would need some help to understand why I can't write to an DS2433 eeprom. System information: BBB Industrial board Debian 10 (Buster IoT Image 2020-04-06) Hardware attached are DS2482 i2c to w1 interface and DS2433 eeprom. Commands executed to set-up system: $ modprobe ds2482 $ echo ds2482