Skip to main content
GIkar
Associate III
February 26, 2020
Question

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

  • February 26, 2020
  • 4 replies
  • 1001 views

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

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
February 26, 2020

uint16_t buffer1[1024]; contains 2048 bytes

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
GIkar
GIkarAuthor
Associate III
March 4, 2020

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

berendi
Principal
March 4, 2020

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