STM32F303CCT - UART in Single Wire mode not working. Im using current stm32cubeide with HAL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-24 6:12 AM
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
Solved! Go to Solution.
- Labels:
-
STM32CubeIDE
-
STM32F3 Series
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-28 6:14 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-24 12:01 PM
Try without Cube first. UART is simple enough to write register-based initialization and polled transmit.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-26 6:34 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-26 7:48 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-27 10:38 AM
In th ioc the uart port is defined as Alternate Function Open Drain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-27 11:20 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-27 7:09 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-27 11:38 PM
Hmm. It basically works on my STM32F302R8 NUCLEO. Can you check with a scope? Maybe the pull-ups need adjustment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-28 6:14 AM
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!
