-
Notifications
You must be signed in to change notification settings - Fork 1k
Reliability issue when using SDMMC & USB Serial together with STM32H750VBT6 #1390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Additional Info: I've performed the same test on a STM32H743VIT6 board and it worked perfectly. The described problem only occurs on STM32H750VBT6. |
Hi @pacman1945 One other test you can perform is to disable the ICACHE and DCACHE using build_opt.h: |
I checked the Errata sheet for STM32H750xB vs STM32H743xI/G. They’re basically the same. I’ve also tried to disable ICACHE & DCACHE, but problem still persisted. However, I noticed that the marking on my STM32H750VBT6 says “VBT6 Y” on the 2nd line, while my other STM32H743VIT6 has marking of “VIT6 V”. I would guess the Y & V are the silicon revisions. If so, my H750VBT6 is an older silicon of revision Y, and my H743VIT6 is a newer silicon of revision V. I’ve checked another document “AN5312 Application note” on Migration from RevY to RevV for STM32H743/753 and STM32H750. There is a section discussing the update on USB controller, but I’m unable to fully understand the technical details and its effect. Maybe the problem that I encountered is related to the silicon revisions. |
I've noticed there are some changes in RCC registers from Rev Y to Rev V (AN5312, p8). The HSITRIM bits have been moved from RCC_ICSCR to RCC_HSICFGR & RCC_CSICFGR registers. It seems to me the STM32duino Core code is catered only for Rev V silicon. The file "stm32/2.0.0/system/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_rcc.c" assumes the HSITRIM bits in RCC_HSICFGR register, which isn't true on the old Rev Y silicon. Could this cause problems? |
Yes I guess it is possible. |
Just thinking that the system clock config configure the board to run at 480 MhHz but only the rev V can obtained this. |
I've already tested using HSE clock running at 400MHz, but the reliability issue still existed. |
OK I thought it wad set at higher speed. Made too much variant last months...😉 |
Just to clarify, the default is using Internal Crystal (HSI) with SYSCLK set at 480MHz. I've modified the HSI SYSCLK to 400MHz, same issue. I've also tried to use External Crystal (HSE) and SYSCLK set at 400MHz, same problem. |
So I'm not so mad 😉 |
The Cardinfo Example sketch is already doing retry indefinitely. BY THE WAY, when it fails, the card.init() call would block for around 1 minute before returning. Subsequent retry would always fail, but returned immediately without blocking.
|
Hi @pacman1945 |
I've re-tested the Cardinfo Example with your new patch. With the default generic_clock.c, the Cardinfo Example failed every single time. First, I thought maybe 'cos the sysclock was at 480MHz. Then, I modified it to 400MHz and it still didn't work, not even once. Afterwards, I copied the generic_clock.c from previous version (that is, from the official 2.0.0 release) and it worked intermittently, just like before. I've also tried change the sysclock to 400MHz, and it also worked intermittently, exactly as before. Conclusion:
|
Okay, I can now get the patch from #1393 and the new generic_clock.c that came with it to work intermittently by modifying the clock config as follows:
Previously, I only modified the sysclock to 400MHz by changing RCC_OscInitStruct.PLL.PLLN to 50. This will result in SDMMC clock running at 160MHz. This time, I also modified RCC_OscInitStruct.PLL.PLLQ to 4, so as to set the SDMMC clock to 200MHz. When sysclock running at 400MHz and SDMMC clock running at 200MHz, I can use the new generic_clock.c and everything behave exactly like before. That is, it works intermittently. However, this new patch still didn't fix the original reliability issue. BY THE WAY, are you able to get a STM32H750VBT6 for testing? |
Unfortunately, I don't have one. As you mentioned
My guess is it is linked to the HW, probably one issue listed in the errata sheet. |
Hi @pacman1945 I close this issue as I could not reproduce. |
Describe the bug
With STM32H750VBT6 running STM32duino_STM32SD Cardinfo Example, there is a reliability problem if the serial output is set to USB Serial. That is, by enabling USB Support "CDC (generic Serial supersede U(S)ART)". If USB Serial is enabled, there is over 50% chance card.init() fails.
If I disabled USB Serial and use the Generic Serial (PA10 & PA9), the CardInfo Examples worked perfectly every time. The reliability problem only occurs when running the Cardinfo with USB Serial.
To Reproduce
Install the latest version of STM32duino_STM32SD (v1.2.3) and FatFs (v2.0.3) via Arduino Library Manager.
Choose example STM32duino STM32SD->Cardinfo
Modify the baud rate to 115200
Enable: USB Support "CDC (generic Serial supersede U(S)ART)"
Run the Cardinfo example
Open the "Serial Monitor"
Screenshots
When it fails, the following message will be displayed.
Desktop (please complete the following information):
USB Support "CDC (generic Serial supersede U(S)ART)
Default for other items
Board (please complete the following information):
STM32H750VBT6 from the below URL
https://www.aliexpress.com/item/1005001683272407.html?spm=a2g0o.productlist.0.0.637d1d300fFQ5d&algo_pvid=b237e656-d04b-422e-84af-8be8ed4042d9&algo_expid=b237e656-d04b-422e-84af-8be8ed4042d9-0&btsid=0bb0624116200479098028721ef47f&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603
The text was updated successfully, but these errors were encountered: