cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong SDIO settings? f_read fil only half array counts full array

GIkar
Associate III

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 :)

4 REPLIES 4

uint16_t buffer1[1024]; contains 2048 bytes

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
GIkar
Associate III

Thank you very much. Is this because of the 32bit arch?

It is because one byte contains 8 bits, so uint16_t a.k.a 16 bit unsigned integer type is 2 bytes.

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..