Skip to main content
Associate II
Sep 9, 2024 8:36 AM UTC
Solved

Cannot add USART2 initialization through CubeMX to the main program when using TouchGFX

I'm using RVT101HVSNWC00-B.I use TouchGFX 4.24.0 to generate initial code.

There's no MX_USART2_UART_Init(); , even though I generate code again through CubeMX.

I have to add it by myself to initial USART2.

ChungEN_0-1725870683752.png

 

This topic has been closed for replies.
STTwo-32
STTwo-32Best answer
ST Technical Moderator
Sep 10, 2024 6:45 AM UTC

To generate the "MX_USART2_UART_Init();" function, you have to go to your .ioc file->Project Manager->Advanced Settings and unselect the "Do Not Generate Function Call" For the Peripheral Instance Name "USART2".

STTwo32_1-1725950692203.png

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

3 replies

STTwo-32
ST Technical Moderator
Sep 9, 2024 10:06 AM UTC

Hello @ChungEN 

If possible, can you add you .ioc file?

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
ChungENAuthor
Associate II
Sep 10, 2024 12:24 AM UTC

Here's the .ioc file.

Best Regards,

ChungEn

STTwo-32
STTwo-32Best answer
ST Technical Moderator
Sep 10, 2024 6:45 AM UTC

To generate the "MX_USART2_UART_Init();" function, you have to go to your .ioc file->Project Manager->Advanced Settings and unselect the "Do Not Generate Function Call" For the Peripheral Instance Name "USART2".

STTwo32_1-1725950692203.png

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.