cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F303CCT - UART in Single Wire mode not working. Im using current stm32cubeide with HAL

McClean
Associate II

I made a simple test program, transmitting a string using stm32cubeide. If i switch to async mode it works. In Single Wire mode the output is not correct (invalid random chars). Testing LL does not help

1 ACCEPTED SOLUTION

Accepted Solutions
McClean
Associate II

Wow, im really surprised. Your completely right. I used my logic analyzer with uart protocol analysis and it showes the data right - but on putty the input was wrong. So it was clear. I added a 10k resistor and all was right. Stange, it definitly works with without this additional resistor (one is in the usb interface) with f1, l0 and g0 series.

Thank you very much!

View solution in original post

8 REPLIES 8

Try without Cube first. UART is simple enough to write register-based initialization and polled transmit.

JW

McClean
Associate II

Im a windows developer, im able to write efficient microcontroller code, but i dont have experience in writing lowlevel code. Im need to use cube to do this

Steffen

KnarfB
Principal III

The reference manual says

"The TX pin is always released when no data is transmitted. Thus, it acts as a standard

I/O in idle or in reception. It means that the I/O must be configured so that TX is

configured as alternate function open-drain with an external pull-up."

I don't see that in your .ioc. Maybe thats the issue.

McClean
Associate II

In th ioc the uart port is defined as Alternate Function Open Drain

But the pull-up part is missing. If you stop sending, the TX line is floating unless you have external components. Are you really using single-wire half-duplex or would asynchronous transmit-only do?

Are both, USART1 and USART2 affected?

The pullup is implemented in the pc uart interface. I need half duplex, im sending and receiving data. Generally this is working fine, im using half duplex uart since years with stm32f103 and stm32l041 stm32g031.

I wanted to exchange stm32f103 with stm32f303 in an existing design to boost performance because its pin compatible. All is working fine, execpt of the uarts.

At the moment uart on a2 outputs random chars, a9 is outputting noting

Hmm. It basically works on my STM32F302R8 NUCLEO. Can you check with a scope? Maybe the pull-ups need adjustment.

McClean
Associate II

Wow, im really surprised. Your completely right. I used my logic analyzer with uart protocol analysis and it showes the data right - but on putty the input was wrong. So it was clear. I added a 10k resistor and all was right. Stange, it definitly works with without this additional resistor (one is in the usb interface) with f1, l0 and g0 series.

Thank you very much!