Where to start STM32H7 support

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

Moderators: barthess, RoccoMarco

geebee
Posts: 17
Joined: Thu Dec 06, 2018 10:22 pm
Has thanked: 3 times
Been thanked: 13 times

Re: Where to start STM32H7 support

Postby geebee » Thu Aug 06, 2020 6:09 pm

Giovanni,

I have a system which uses the SDMMC driver with a STM32H743, and I'm bumping into a weird issue.

sdcConnect() fails in sdc_detect_bus_clk(). If I simply add a return early and force to run at 25 MHz, everything seems to work fine:

Code: Select all

@@ -323,6 +323,7 @@ static bool sdc_detect_bus_clk(SDCDriver *sdcp, sdcbusclk_t *clk) {
 
   /* Safe default.*/
   *clk = SDC_CLK_25MHz;
+  return HAL_SUCCESS; // TEMP^M
 
   /* Looks like only "high capacity" cards produce meaningful results during
      this clock detection procedure.*/


but the method as is fails in sdc_lld_read_special(). The exact place where it fails is in sdc_lld_wait_transaction_end(),

Code: Select all

  if ((sdcp->sdmmc->STA & SDMMC_STA_DATAEND) == 0) {
    osalSysUnlock();
    return HAL_FAILED;
  }


but really all that happens is that the transaction fails so that function gets woken up by the interrupt to process the completion (or error in this case). I can't figure out why the error happens or a workaround other than forcing to 25 MHz, but the registers indicate that it's an RX fifo overrun/IDMA transfer error. STA is 0x8001020.

Also, it seems that the default for STM32_SDMMC_MAXCLK is set to 50MHz, but it could be upped substantially for the H7. From Table 59/page 352 of the manual it seems that 100 MHz is safe for all voltage scaling settings, and can go up to 250. I have tested below 50 MHz, but also tried to increase to almost 100 to see if it changed anything, unsuccessfully.

GB

User avatar
Giovanni
Site Admin
Posts: 13074
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 758 times
Been thanked: 637 times
Contact:

Re: Where to start STM32H7 support

Postby Giovanni » Thu Aug 06, 2020 6:15 pm

Which H7 revision? what kind of card? board?

It is hard to debug this kind of things without being able to reproduce the problem.

Giovanni

geebee
Posts: 17
Joined: Thu Dec 06, 2018 10:22 pm
Has thanked: 3 times
Been thanked: 13 times

Re: Where to start STM32H7 support

Postby geebee » Thu Aug 06, 2020 6:33 pm

It's revision V. The card is an 8 GB Sandisk Industrial micro SD HC I.

As for the board, unfortunately I don't have an available standard board from ST, but the relevant part should be the same, as the SD card is just connected to the MCU directly at a very short distance, and the VDD pin is bypassed.

From the way this thread ended I wasn't sure the driver got tested on H7 so I added to here. But if it has been seen working at 50 MHz on one of the ST boards I'll try to get my hands on one and see what's different.

The same SD card (and board setup) has worked fine on a number of F7 and L4 designs as far as coming up, but I have never verified if in those firmwares it was being picked up as 25 or 50 MHz. I can try to look into that if it's helpful.

GB

User avatar
Giovanni
Site Admin
Posts: 13074
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 758 times
Been thanked: 637 times
Contact:

Re: Where to start STM32H7 support

Postby Giovanni » Thu Aug 06, 2020 7:47 pm

OK, it could be a wiring issue, it happened already in the past with SD cards connected using wires.

If cost is not an issue then you could get a discovery board and see if it makes a difference.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 6 guests