Загрузка данных


root@imx95-19x19-lpddr5-evk:~# gcc i2c_fpga_flash_debug.c -o i2c_fpga_flash_debug   
i2c_fpga_flash_debug.c: In function 'main':
i2c_fpga_flash_debug.c:70:32: error: passing argument 1 of 'fread' makes pointer from integer without a cast [8;;https://gcc.gnu.org/onlinedocs/gcc-14.
3.0/gcc/Warning-Options.html#index-Wint-conversion-Wint-conversion8;;]
   70 |     while ((read_bytes = fread(block, 1, sizeof(block), f_bit)) > 0) {
      |                                ^~~~~
      |                                |
      |                                unsigned char
In file included from i2c_fpga_flash_debug.c:1:
/usr/include/stdio.h:728:39: note: expected 'void * restrict' but argument is of type 'unsigned char'
  728 | extern size_t fread (void *__restrict __ptr, size_t __size,
      |                      ~~~~~~~~~~~~~~~~~^~~~~
i2c_fpga_flash_debug.c:72:18: error: subscripted value is neither array nor pointer nor vector
   72 |             block[i] = mirror_byte(block[i]);
      |                  ^
i2c_fpga_flash_debug.c:72:41: error: subscripted value is neither array nor pointer nor vector
   72 |             block[i] = mirror_byte(block[i]);
      |                                         ^
i2c_fpga_flash_debug.c:74:19: error: passing argument 2 of 'write' makes pointer from integer without a cast [8;;https://gcc.gnu.org/onlinedocs/gcc-14.
3.0/gcc/Warning-Options.html#index-Wint-conversion-Wint-conversion8;;]
   74 |         write(fd, block, read_bytes);
      |                   ^~~~~
      |                   |
      |                   unsigned char
In file included from i2c_fpga_flash_debug.c:4:
/usr/include/unistd.h:378:45: note: expected 'const void *' but argument is of type 'unsigned char'
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                                 ~~~~~~~~~~~~^~~~~