@veye_xumm For anyone else. This works perfectly. Note that when recompiling on 64-bit Pi, the following warning is produced. It still builds. Just copy the outputs to bin and the scripts work fine.
./make.sh
i2c_read.c: In function ‘main’:
i2c_read.c:112:35: warning: passing argument 4 of ‘i2c_rd’ from incompatible pointer type [-Wincompatible-pointer-types]
112 | i2c_rd(fd, device_addr,reg_addr, &value, num);
| ^~~~~~
| |
| unsigned char (*)[512]
i2c_read.c:20:68: note: expected ‘unsigned char *’ but argument is of type ‘unsigned char (*)[512]’
20 | static int i2c_rd(int fd, uint8_t i2c_addr, uint16_t reg, uint8_t *values, uint32_t n)