cancel
Showing results for 
Search instead for 
Did you mean: 

Adding UART to STM32H7 based TouchGFX project creates multiple build errors.

JSchi.3
Associate

I've created a TouchGFX (TouchGFX Designer v 4.21.1) project using the STM32H7B3I-DK board. The project has a couple of gauges where I'm able to manipulate their setting based on a load cell being read through an ADC. Everything is working fine. Now I need to add a UART, so I modified the TouchGFX generated CubeMX (ver 6.7.0) IOC file to add UART4, using pins PH13, PH14 (goes to header on the discovery board). NO DMA, NO INTERRUPTS. FreeRTOS is being used. After re opening the newly generated code in CUBEIDE (ver 1.7.0), I simply build to make sure all is still ok. I get multiple instances of the following error (about 34 of them)

C:/TouchGFXProjects/TrailerTest/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c:659:8: error: 'UART_HandleTypeDef' {aka 'struct __UART_HandleTypeDef'} has no member named 'RxEventType'

Other errors are generated as well such as:

C:/TouchGFXProjects/TrailerTest/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_uart.c:3734:24: error: 'HAL_UART_RXEVENT_TC' undeclared (first use in this function)

 3734 |  huart->RxEventType = HAL_UART_RXEVENT_TC;

It seems RxEventType is not recognized as a member. I find reference to multiple uart functions utilizing this but it appears to be broken? I've done no modifications to the code...if I remove the uart by generating new init code in cubemx, the errors go away and project compiles without any issues. Adding the uart back in re creates the errors. Any help/guidance here is greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
JSchi.3
Associate

Update: Resolved issue. Created a new CubeMX project using the STM32H7B3I-DK as a template, added UART4 and nothing else. Copied newly generated uart*.c and uart*.h files into my touch GFX directory structure under the appropriate subfolders and project builds and works without issues.

View solution in original post

1 REPLY 1
JSchi.3
Associate

Update: Resolved issue. Created a new CubeMX project using the STM32H7B3I-DK as a template, added UART4 and nothing else. Copied newly generated uart*.c and uart*.h files into my touch GFX directory structure under the appropriate subfolders and project builds and works without issues.