CircuitPython version
Adafruit CircuitPython commit 9b32d549, Custom board with STM32F412CG
Code/REPL
Behavior
I am adding a board to CircuitPython with a STM32F412CG micro on the board. I ran into an error while building CircuitPython about USART3 functions:
common-hal/busio/UART.c: In function 'uart_clock_enable':
common-hal/busio/UART.c:484:9: error: implicit declaration of function '__HAL_RCC_USART3_FORCE_RESET' [-Werror=implicit-function-declaration]
484 | __HAL_RCC_USART3_FORCE_RESET();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/busio/UART.c:484:9: error: nested extern declaration of '__HAL_RCC_USART3_FORCE_RESET' [-Werror=nested-externs]
common-hal/busio/UART.c:485:9: error: implicit declaration of function '__HAL_RCC_USART3_RELEASE_RESET' [-Werror=implicit-function-declaration]
485 | __HAL_RCC_USART3_RELEASE_RESET();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/busio/UART.c:485:9: error: nested extern declaration of '__HAL_RCC_USART3_RELEASE_RESET' [-Werror=nested-externs]
common-hal/busio/UART.c:486:9: error: implicit declaration of function '__HAL_RCC_USART3_CLK_ENABLE' [-Werror=implicit-function-declaration]
486 | __HAL_RCC_USART3_CLK_ENABLE();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/busio/UART.c:486:9: error: nested extern declaration of '__HAL_RCC_USART3_CLK_ENABLE' [-Werror=nested-extern
]
common-hal/busio/UART.c: In function 'uart_clock_disable':
common-hal/busio/UART.c:559:9: error: implicit declaration of function '__HAL_RCC_USART3_CLK_DISABLE' [-Werror=implicit-function-declaration]
559 | __HAL_RCC_USART3_CLK_DISABLE();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/busio/UART.c:559:9: error: nested extern declaration of '__HAL_RCC_USART3_CLK_DISABLE' [-Werror=nested-externs]
Description
See STMicroelectronics/STM32CubeF4#42
In CMSIS/Device/ST/STM32F4xx/Include/stm32f412cx USART3_BASE is defined.
In STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h, USART3 functions are not defined for STM32F412Cx.
https://github.com/hathach/st_driver/blob/1900834751fd6754457874b8c971690bab33e0a7/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h#L4972-L4973
So that causes issues when common-hal/busio/UART.c sees USART3 as defined but can't find the functions for USART3.
The fix ST applied to their repo was to remove all of the #ifdef's for all USART3 define's in stm32f4xx_hal_rcc_ex.h. USART3 is available on the STM32F412CG, but only as half-duplex. See Table 2 note 2 in the STM32F412CG datasheet.
Additional information
No response
CircuitPython version
Code/REPL
NoneBehavior
I am adding a board to CircuitPython with a STM32F412CG micro on the board. I ran into an error while building CircuitPython about USART3 functions:
common-hal/busio/UART.c: In function 'uart_clock_enable':
common-hal/busio/UART.c:484:9: error: implicit declaration of function '__HAL_RCC_USART3_FORCE_RESET' [-Werror=implicit-function-declaration]
484 | __HAL_RCC_USART3_FORCE_RESET();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/busio/UART.c:484:9: error: nested extern declaration of '__HAL_RCC_USART3_FORCE_RESET' [-Werror=nested-externs]
common-hal/busio/UART.c:485:9: error: implicit declaration of function '__HAL_RCC_USART3_RELEASE_RESET' [-Werror=implicit-function-declaration]
485 | __HAL_RCC_USART3_RELEASE_RESET();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/busio/UART.c:485:9: error: nested extern declaration of '__HAL_RCC_USART3_RELEASE_RESET' [-Werror=nested-externs]
common-hal/busio/UART.c:486:9: error: implicit declaration of function '__HAL_RCC_USART3_CLK_ENABLE' [-Werror=implicit-function-declaration]
486 | __HAL_RCC_USART3_CLK_ENABLE();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/busio/UART.c:486:9: error: nested extern declaration of '__HAL_RCC_USART3_CLK_ENABLE' [-Werror=nested-extern
]
common-hal/busio/UART.c: In function 'uart_clock_disable':
common-hal/busio/UART.c:559:9: error: implicit declaration of function '__HAL_RCC_USART3_CLK_DISABLE' [-Werror=implicit-function-declaration]
559 | __HAL_RCC_USART3_CLK_DISABLE();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
common-hal/busio/UART.c:559:9: error: nested extern declaration of '__HAL_RCC_USART3_CLK_DISABLE' [-Werror=nested-externs]
Description
See STMicroelectronics/STM32CubeF4#42
In CMSIS/Device/ST/STM32F4xx/Include/stm32f412cx
USART3_BASEis defined.In STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h, USART3 functions are not defined for STM32F412Cx.
https://github.com/hathach/st_driver/blob/1900834751fd6754457874b8c971690bab33e0a7/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rcc_ex.h#L4972-L4973
So that causes issues when common-hal/busio/UART.c sees USART3 as defined but can't find the functions for USART3.
The fix ST applied to their repo was to remove all of the #ifdef's for all USART3 define's in stm32f4xx_hal_rcc_ex.h. USART3 is available on the STM32F412CG, but only as half-duplex. See Table 2 note 2 in the STM32F412CG datasheet.
Additional information
No response