SD on STM32H7

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SD on STM32H7

Post by Giovanni »

Hi,

How do you verify the reported capacity?

Giovanni
joaquin
Posts: 49
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

Re: SD on STM32H7

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SD on STM32H7

Post by Giovanni »

Could you try another card? is the capacity still wrong? if so then there could be a bug there.

Giovanni
joaquin
Posts: 49
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

Re: SD on STM32H7

Post 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
joaquin
Posts: 49
Joined: Sat Jan 22, 2011 8:44 pm
Has thanked: 1 time
Been thanked: 3 times

Re: SD on STM32H7

Post 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
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: SD on STM32H7

Post by Giovanni »

Ah OK, it is the number of available blocks :-)

Giovanni
Post Reply