2020-02-26 11:40 AM
Hello,
which points of SDIO (DMA) settings i have to look for if my f_read reads only half but counts full.
Example:
uint16_t buffer1[1024];
f_read(&file,&buffer1[0],1024,&cnt);
buffer1 is filled with values to buffer1[511] but variable cnt gives me 1024
f_read(&file,&wavbuffer1[0],512,&cnt);
buffer1 is filled with values to buffer1[255] but variable cnt gives me 512
Thanks for ideas :)
2020-02-26 11:47 AM
uint16_t buffer1[1024]; contains 2048 bytes
2020-03-04 11:11 AM
Thank you very much. Is this because of the 32bit arch?
2020-03-04 12:10 PM
It is because one byte contains 8 bits, so uint16_t a.k.a 16 bit unsigned integer type is 2 bytes.
2020-03-04 12:33 PM
No
uint32_t buffer2[1024]; would have a sizeof() 4096 bytes, you have 1024 elements in the array and each is 4-bytes in size