2017-04-28 10:40 PM
Hi , all:
I use STM32CubeMx to generate MDK V5 project for my stm32f746g-discovery board.
I found I can't use the SD with FATFS after add STemwin Lib to my project , but it works fine only if i just use SD and LTDC without STemwin.
I've already set my stack size to 0x2000,and it still dont work!!
Does anyone have the same problem? or can someone help me to build a project ?
#stemwin-stm32f746discovery2017-04-30 01:44 PM
The stack size is not the answer to most problems, review the IRQ and DMA utilization, that the appropriate vectors are correctly named and bound, that the priority/preempt levels are suitable, and HAL doesn't block unnecessarily.
2017-05-01 11:48 PM
HI Clive One :
Thank you for your reply!! i'll try SD DMA approach later.
2018-05-04 07:19 PM
Hi Pinxian wu, do you found what is the problem? I also faced the same problem at the moment and i couldnt figure out what could be the cause?
I use STemWin with the USB FATFS (demofile as template) then I change the FATFS to use SDMMC as storage. But, it does not work out. It either the FATFS working STemWin failed to works or SD FATFS failed and STemWin failed. I was so curious why ST example library file nvr includes the SDMMC and STemWin under single project? Could it be resource constrain in order to combine SDMMC with STemWin together?
2018-10-29 06:58 AM
I encountered a similar problem on the STM32F746G-Discovery. CubeMX 4.27.0 / 1.12.0. FatFs started working only if the GRAPHICS_Init () function was removed.
The problem disappeared when I turned off the data cache
SCB_DisableDCache ();
at the beginning. It is not clear how this is related, but everything works now.
2018-10-29 08:55 AM
FATFS/SDMMC will work well if the buffers are held in the DTCMRAM, otherwise you'd need to manage cache coherency is actively, or via MPU configuration.
Turning off the cache for everything seems like a good way to limit system performance.
See ENABLE_SD_DMA_CACHE_MAINTENANCE in sd_disk_io_dma_template.c
2018-11-06 02:40 AM
Thank you! With this option everything works well.
Data and instructions caches and MPU are enabled.
STemwin and FatFs tasks stack size are 1024 words both, heap_4.