2025-03-16 2:58 PM
in this touchGFX documentation page ( MIPI-DSI Video Mode | TouchGFX Documentation ) under the "DSIHOST / LTDC Initialization sequence" section it says:
"The call to MX_DSIHOST_DSI_Init() must be done before MX_LTDC_Init(). This should be handled by STM32CubeMX. If this is not correct, take care to fix the order in a user code section."
But this is the CubeMX generated code where it calls MX_LTDC_Init() before MX_DSIHOST_DSI_Init():
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_LTDC_Init();
MX_RTC_Init();
MX_OCTOSPI1_Init();
MX_ADC1_Init();
MX_TIM1_Init();
MX_TIM8_Init();
MX_UART5_Init();
MX_ICACHE_Init();
MX_DSIHOST_DSI_Init();
MX_CRC_Init();
MX_I2C4_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
It looks like MX is generating it incorrectly... And swapping those lines every single time you change something in MX would be an insanely annoying thing to have to do (not to mention all sorts of other potential issues).
Is there a workaround or solution (other than to manually swapping the two functions every time)?
Thank you :)
Solved! Go to Solution.
2025-03-16 3:11 PM
In Project Manager -> Advanced settings you can change the order of initialization.
2025-03-16 3:11 PM
In Project Manager -> Advanced settings you can change the order of initialization.
2025-03-16 3:28 PM
Thank you @TDK
Are there any other Initialisation functions that need to be in a specific order?
If so, how or where can I find which ones?
Thank you
2025-03-16 4:31 PM
MX_DMA_Init needs called before other initializers which use DMA. That's the only one I know about.
2025-03-16 5:28 PM
Thank you @TDK