cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect DSIHOST / LTDC Initialization sequence by Cube MX...?? Is there a workaround?

Ricko
Senior III

Hi,

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 :)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

In Project Manager -> Advanced settings you can change the order of initialization.

TDK_0-1742163063347.png

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
TDK
Guru

In Project Manager -> Advanced settings you can change the order of initialization.

TDK_0-1742163063347.png

 

If you feel a post has answered your question, please click "Accept as Solution".
Ricko
Senior III

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

MX_DMA_Init needs called before other initializers which use DMA. That's the only one I know about.

If you feel a post has answered your question, please click "Accept as Solution".

Thank you @TDK