Closed supcik closed 7 months ago
ST Internal Reference: 132859
Hello @supcik,
The issue you reported has been fixed in the frame of version v1.28.0 of the STM32CubeF4 published recently on GitHub. Thank you again for having reported.
With regards,
Setup
Describe the bug
The BSP for the STM32F412G-DISCO (
Drivers/BSP/STM32412G-Discovery/stm32412g_discovery.c
) has a method to initialize the serial communication :According to the documentation,
COM
can beCOM1
orCOM2
:But actually, only
COM1
(which is used for USART2) can be used. Indeed, the number ofCOM
is set to 1:and the arrays
COM_USART[COMn]
,COM_TX_PORT[COMn]
,COM_RX_PORT[COMn]
,COM_TX_PIN[COMn]
,COM_RX_PIN[COMn]
,COM_TX_AF[COMn]
,COM_RX_AF[COMn]
are only defined for a single entry :COM1
.So when
BSP_COM_Init
is called withCOM2
for theCOM
argument, the result is undefined.How To Reproduce
BSP_COM_Init
withCOM2
as first argumentAdditional context
BSP_COM_Init
currently returnsvoid
, so it can't return an error if called withCOM2
. Perhaps it would be good to return aHAL_StatusTypeDef
instead ofvoid
. This could also be used to detect other problems during the initialization of the USART.COM1
was actually used forUSART2
.Screenshots
n/a