2025-07-17 1:38 AM
Hi
i working on stm32u083rctx with U0 fw package v1.3.0 and CubeMX 6.15. On CubeMX i initialized lpuart3 in half-duplex mode on PC4 pin. I notice that PC4 is only possible to set as open-drain. I want to select PC4 as push-pull. In function:
void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
if i change PC4 init line form:
GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
to:
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
my code is working. I don't known if it is correct configure push-pull when lpuart3 is in half-duplex mode. So i ask if it's safe to do that. Thank you.
Best regards.
Enrico
Solved! Go to Solution.
2025-07-21 12:56 AM
@Ozone wrote:While it might be possible to get Cube project working in Segger ES, .
Sure it's possible: what is generated is just standard C source code - there is nothing magic or special about it.
2025-07-21 2:00 AM
> Sure it's possible: what is generated is just standard C source code - there is nothing magic or special about it.
The "downside" from a Cube user's pespective is no direct import of Cube projects, an thus the CubeMX tool.
Segger ES can import EWARM projects, Keil MDK projects and generic Eclipse projects, amongst more general options.
And of course this would require a Cube user (which is another term for a beginner) to create new projects in Cube including the graphical pin setup tool (*.ioc).
And to re-create reasonable project settings in Segger ES itself.
Which is not a problem for a more experienced developer, but many Cube users.
2025-07-21 2:26 AM
@enmarke wrote:I don't known if it is correct configure push-pull when lpuart3 is in half-duplex mode.
"Half-duplex" means that a single line is used for comms in both directions (one at a time).
Therefore the same pin gets used as both an input and an output.
This needs to be managed carefully so that you don't end up with two outputs both trying to drive the line at the same time!
Configuring the output as Open-Drain provides a safe way to do that - as @Ozone described.
Another option would be to make the default state input - so it's up to the user to only change it to output when safe to do so.
@enmarke wrote:So i ask if it's safe to do that. Thank you.
Your design has to ensure that it's safe.
2025-07-21 4:39 AM