Page 2 of 2

Re: SD on STM32H7

Posted: Thu Apr 10, 2025 4:21 am
by Giovanni
Hi,

How do you verify the reported capacity?

Giovanni

Re: SD on STM32H7

Posted: Thu Apr 10, 2025 10:09 am
by joaquin
Giovanni wrote:Hi,
How do you verify the reported capacity?
Giovanni

At hal_sdc.c :

Code: Select all

  else {
    /* The card is an SDC, capacity from the normal CSD.*/
    sdcp->capacity = _mmcsd_get_capacity(sdcp->csd);
  }

I'm illiterate at SD Card code, so may be it's not the way to check it

Re: SD on STM32H7

Posted: Thu Apr 10, 2025 12:31 pm
by Giovanni
Could you try another card? is the capacity still wrong? if so then there could be a bug there.

Giovanni

Re: SD on STM32H7

Posted: Thu Apr 10, 2025 3:04 pm
by joaquin
Giovanni wrote:Could you try another card? is the capacity still wrong? if so then there could be a bug there.

Giovanni

With a 8GB card, it reports 15.130.624, with a 64GB, it reports 122.138.624 and with a 256MB, 491.520

Re: SD on STM32H7

Posted: Fri Apr 11, 2025 11:11 am
by joaquin
joaquin wrote:
Giovanni wrote:Could you try another card? is the capacity still wrong? if so then there could be a bug there.

Giovanni

With a 8GB card, it reports 15.130.624, with a 64GB, it reports 122.138.624 and with a 256MB, 491.520

I have checked on a PC, and the reported capacity by Chibios is correct, although it's in number of sectors of 512 bytes; that's the reason I saw half the capacity

Re: SD on STM32H7

Posted: Fri Apr 11, 2025 2:25 pm
by Giovanni
Ah OK, it is the number of available blocks :-)

Giovanni