The problem is pretty simple. This demo is intended to exercise the LCD and DMA2D graphics support on the STM32F429 Discovery board. However if you compile and run it, the graphics display doesn't work. It flashes slightly and sometimes fades to an odd pattern or just stays white.
The problem is that the clock for the LCD controller is derived from the SAI PLL, but this PLL is not being enabled. The RT-STM32F429-DISCOVERY-DMA2D doesn't actually use the SAI blocks, so it doesn't enable SAI support explicitly, but because of this the LCD controller also doesn't function correctly either.
I suspect that at one point ChibiOS did enable the SAI PLL as a side effect of some other configuration setting (maybe the STM32_SAISRC macro?), but it doesn't seem to work the same way anymore, and now the demo is stale with respect to the latest ChibiOS CPU support code.
Note that this was observed with ChibiOS release 19.1.3, but I think the problem is still evident with the latest repo code too.
I fixed this by adding the following one-line patch to the mcuconf.h file:
Code: Select all
--- a/software/firmware/ChibiOS/community/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf.h
+++ b/software/firmware/ChibiOS/community/demos/STM32/RT-STM32F429-DISCOVERY-DMA2D/mcuconf.h
@@ -64,6 +64,7 @@
#define STM32_PLS STM32_PLS_LEV0
#define STM32_BKPRAM_ENABLE FALSE
#define STM32_SAISRC STM32_SAISRC_PLL
+#define STM32_SAI2SEL STM32_SAI2SEL_PLLSAI
#define STM32_PLLSAIN_VALUE 192
#define STM32_PLLSAIQ_VALUE 7
#define STM32_PLLSAIR_VALUE 4
With this change the demo works as expected.
-Bill