I snooped the registers, and noticed that the CHSEL bits in DMA_SxCR register were set to the incorrect channel 4. This is the channel used for SDMMC1.
It is because in the sdc_lld_start( SDCDriver* ) function, dmamode is always being set to SDMMC1_DMA_CHANNEL.
If I temporarily change that to be SDMMC2, the DMA works, card initializes, and I can successfully mount it.
I'm guessing the logic that sets the SDMMC1_DMA_CHANNEL and SDMMC1_DMA_PRIORITY bits will need to be broken out per-device?
SDMMC2 on STM32F7 Discovery Topic is solved
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: SDMMC2 on STM32F7 Discovery
I think you are correct, moving this topic in the bug reports forum. I will try to address both the clock settings and this issue before next release.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: SDMMC2 on STM32F7 Discovery
Hi,
I fixed the SDMMC-related problems in both 17.6 and trunk (bug #912). The clock settings have only been added to trunk (bug #913) because the changes are a bit invasive, 17.6 defaults SDMMC2 clock to HSI48.
Could you give a try to trunk version?
Giovanni
I fixed the SDMMC-related problems in both 17.6 and trunk (bug #912). The clock settings have only been added to trunk (bug #913) because the changes are a bit invasive, 17.6 defaults SDMMC2 clock to HSI48.
Could you give a try to trunk version?
Giovanni
Re: SDMMC2 on STM32F7 Discovery
Absolutely, but before I do, could you also please fix SDMMCx_DMA_PRIORITY the same way you split up SDMMCx_DMA_CHANNEL in os/hal/ports/STM32/LLD/SDMMCv1/hal_sdc_lld.c?
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: SDMMC2 on STM32F7 Discovery
My pleasure, other than normal migration, my code to mount and write a file to SDCard on SDMMC2 works as advertised on the trunk with no changes to ChibiOS itself.
I tried both DMA channels supported for SDMMC2.
I tried both DMA channels supported for SDMMC2.
ch> info
Kernel: 5.0.0
Compiler: GCC 5.4.0
Architecture: ARMv7E-M
Core Variant: Cortex-M7
Port Info: Advanced kernel mode
Platform: STM32F769 Very High Performance with DSP and DP FPU
Board: STMicroelectronics STM32F769I-Discovery
Build time: Jan 19 2018 - 09:22:36
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: SDMMC2 on STM32F7 Discovery
Tested overriding with #define FATFS_HAL_DEVICE SDCD2 in my halconf.h and works as expected.
Would it be possible to change GPIOG_SD_D0 and GPIOG_SD_D1 from PULLUP to FLOATING in the STM32F769-DISCOVERY board files for trunk and branch, then I promise I'll leave you alone
Thanks as always
Would it be possible to change GPIOG_SD_D0 and GPIOG_SD_D1 from PULLUP to FLOATING in the STM32F769-DISCOVERY board files for trunk and branch, then I promise I'll leave you alone
Thanks as always
Who is online
Users browsing this forum: No registered users and 62 guests