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
stm32h7:sdmmc: prevent SRAM123 and SRAM4 from using by SDMMC1 IDMA #3958
Conversation
@a-lunev - Why is this needed when stm32_dmapreflight already excludes it? |
Hi David,
Please let me know what do you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@a-lunev stm32_dmapreflight is used by the high level SDMMC driver https://github.com/apache/incubator-nuttx/blob/master/drivers/mmcsd/mmcsd_sdio.c#L1392 . The debug assert is in addition to that just for debugging.
@a-lunev - the stm32_dmapreflight does the right thing. The lame FIFO requires IDMA. But to a buffer that is not from the heap.
I think the exclusion from the heap for this drive is not the correct solution. The solution is in place. Did not work or is this just a misunderstanding or configuration issue on your part? You may want to add the Exclusion as an option in a separate PR but it can not come in here |
@a-lunev what are you trying to achieve? Is this similar to the BDMA/SRAM4 heap clobbering issue fixed in 4716fc929d7 / PR-3198? |
@davids5 concerning the high level SDMMC driver (drivers/mmcsd/mmcsd_sdio.c) there is e.g. mmcsd_read_csd() function that has a local buffer ( |
Hi @hartmannathan, |
On the buffer. It is not dache-aligned either. Using the granular allocator, is the best approach to get DMA & aligned buffers. We use SDMMMC2 So I would have to look at this again to see what happens on SDMMC1 on mmcsd_read_csd() call. |
@a-lunev I am looking into this on HW that supports SDMMC1. The code path where mmcsd_read_csd is for CONFIG_MMCSD_MMCSUPPORT. I have CONFIG_MMCSD_MMCSUPPORT disabled since there was a commit that broke the detection (while still in bitbucket). Have you a config you can test this code path? As I see it way to solve this are to a) use CONFIG_GRAN or b) statically define the buffer using locate_data. The latter is more wasteful. My suggestion is to add CONFIG_GRAN and a dma allocattor. (see https://github.com/PX4/PX4-Autopilot/blob/master/platforms/nuttx/src/px4/common/board_dma_alloc.c) Then in mmcsd_read_csd add compile time code to call |
Hi David, One more possible option could be to solder wires to SD or MMC connector, insert MMC card and connect the wires to some stm32h7 board (e.g. NUCLEO-H743ZI) to its SDMMC1 interface. |
This PR is still actual. I am going to return to it later. |
38fdd93
to
dc69b10
Compare
Summary
Preventing SRAM123 and SRAM4 from using by SDMMC1 IDMA.
Impact
STM32H7 SDMMC