I was using ADSP-21489 EZ-Board with CCES 2.7.0 and trying to do some simple file reading with stdio, but I found the data returned by fread() was always garbage, but after I changed the open mode from "rb" to "r", the data was correct.
The code was like this:
char *buf = malloc(1024);
FILE *f = fopen("file.txt", "rb");
size_t count = fread(buf, 1, 1024, f);
buf[count] = 0;
I also found that no matter how big the file was, the count returned by fread() was always 280. Is there something wrong with my code or my configuration?
Thank you for your help.