Skip to content
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

Changes SDIO clock speed to 20MHz for Matek H743 Slim board #19177

Merged
merged 1 commit into from
Feb 15, 2022

Conversation

spiderkeys
Copy link
Contributor

Addresses the reliability issues seen on the Matek H743 Slim board when using a Sandisk 4, 16, and 32GB Class-10 U1 A1 SD cards, as described in: #19155

The main approach here is to drop the max SDIO clock speed from 25MHz to 20MHz, which appears to have generally solved the problem, at least on the Matek H743 Slim (monitored over a few days of heavy SD card testing with sd_stress, sd_bench, and general parameter-based operations).

This may not be strictly necessary on all boards, and may be a function of things like temperature, the onboard oscillator components used on each physical board, or other factors. That said, a similar PR was introduced in Ardupilot which drops the clock speed to an even more conservative speed of 12.5MHz:
https://github.com/PX4/PX4-Autopilot/blob/master/boards/matek/h743-slim/nuttx-config/include/board.h#L292-L297

It would be good to have some feedback/review from those more familiar with the H7's clock tree and SDIO interface.

@davids5
Copy link
Member

davids5 commented Feb 12, 2022

SDIO is rock solid on the H7 platforms. Issues like this are usually related the PCB missing pullups or really bad routing .
This PR should not change any working HW.

Do you have the schematic for the board? If not can you look with a DVM for 50-100K pullup in the SD lines. The SD clock line should not have one. I will bet they are all missing and will need to be added to the GPIO lines config. See the ModalAI F7 board for how that was done. It may have to be incorporated into the H7 Driver

@davids5 davids5 marked this pull request as draft February 12, 2022 14:56
@spiderkeys
Copy link
Contributor Author

@davids5 thanks for the feedback; these do sound like plausible sources of issues. We don't have a schematic, but from inspecting the board and checking the resistor values as you described, I have the following info:

  • The clock line has no resistor
  • The data lines have 50k resistors
  • The cmd line has a 50K resistor

On that note, since this might come down to issues around layout and passives, I think that it also starts to make sense to take an additional step which is to create a separate board for the Matek H743 Wing, which we are using as well and also see these same issues on (and shares these values). The two boards are nearly functionally identical, differing mainly in respect to a few aspects around the power circuitry and form factor, and so far Ardupilot has treated the slim, mini, and wing variants equivalently as well. That said there have been a few revs of both boards due to supply chain issues, and due to there not being any published schematics, it is hard to know if any of these passives or aspects relating to layout/routing have remained consistent.

I'll go ahead and start by rolling back this change on the other H743 boards, and can open up a separate PR for the Wing once we sort out the issue properly with the Slim.

Can you advise as to next steps, given the data and command lines appear to have the desired pullups? Could it be that the GPIO lines are not properly configured?

Looking at the config for the Modal fc-v1 (the F7 board), the speed appears to be configured to 12MHz if DMA is not used and 16MHz when used. I'm not seeing any changes in GPIO config relating to this, though.

Signed-off-by: Charles Cross <charles@missionrobotics.us>
@spiderkeys spiderkeys changed the title Changes SDIO clock speed to 20MHz for STM32H7 boards Changes SDIO clock speed to 20MHz for Matek H743 Slim board Feb 13, 2022
@spiderkeys
Copy link
Contributor Author

The scope has now been reduced to just the Matek slim, with the other board changes removed.

@dagar dagar marked this pull request as ready for review February 14, 2022 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants