cancel
Showing results for 
Search instead for 
Did you mean: 

UART/USART - enable HDSEL and SWAP at the same time?

evan2
Associate II

Hi All,

Could anyone tell me what happens on an STM32H750 (or other STM32) UART if you enable both the HDSEL bit (half-duplex mode using only the TX pin) and the SWAP bit (switch TX and RX pins) at the same time? Will this get me a half-duplex UART using on the RX pin, or is the hardware not flexible enough to do that?

The specific goal here is to get two bidirectional UARTs on pins 92 and 93 on an LQFP100 STM32H750. If this works, then I can make pin 92 LPUART1 TX/RX by enabling HDSEL, and I can make pin 93 USART1 TX/RX by enabling both HDSEL and SWAP.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

> I could get a Nucleo-H743, I guess.

I'd say, it's a good idea, for various reasons.

> More fundamentally, I'm concerned about whether this is officially supported or not

This is a user-driven forum, with casual ST presence. You may want to contact ST directly, through FAE or through the web support form.

JW

View solution in original post

10 REPLIES 10

The RM does not appear to exclude this combination so this should work as expected.

Why don't you simply try?

JW

evan2
Associate II

Thanks very much for the reply. The reason I haven't tried is that I don't have an STM32H750 board yet - I'm still in the initial stages of designing one. The only STM32 board I've got is an older STM32F1 that doesn't have the SWAP register. I could get a Nucleo-H743, I guess.

More fundamentally, I'm concerned about whether this is officially supported or not. If not, there's a chance that it'll work fine in this silicon revision and then stop working in the next, just because ST didn't see any need to ensure that the functionality was retained.

Cheers,

Evan

> I could get a Nucleo-H743, I guess.

I'd say, it's a good idea, for various reasons.

> More fundamentally, I'm concerned about whether this is officially supported or not

This is a user-driven forum, with casual ST presence. You may want to contact ST directly, through FAE or through the web support form.

JW

evan2
Associate II

OK, sounds like I need to go shopping. I'll get in touch with ST as well - I need to ask about when the LQFP144 STM32H750 will actually be available too, since so far nobody seems to have any stock.

Thanks very much for your help.

Cheers,

Evan

OK, got a Nucleo-H743ZI and tested it. The answer is ... it works perfectly. If you set HDSEL then you get a bidirectional UART on the TX pin, and if you also set SWAP then you get a bidirectional UART on the RX pin.

If anyone is interested - I got in touch with a couple of distributors regarding the LQFP144 STM32H750, and all of them basically said "we're never planning to stock that, you'll have to order thousands of them from ST directly". So I guess I'm designing my board for the LQFP100 version.

Thanks for reporting! It's good to know, as it widens the choice of pins. 🙂

I've also tried this, but my results weren't successful. I can do half duplexing, I can do swapping, but not both.

With a transmitting app working on USART6 on PC6 (USART6_TX) and PC7 (USART6_RX), I see outputs on PC6 for normal and HDSEL. However, if I add SWAP flag, then output is not seen on either of the pins.

@evan2​ Can you share CR2 and CR3 values when HDSEL + SWAP is working?

Self solved. I was dropping the RX pin from initialization for half duplexing case and this caused output to go nowhere lol

Good to hear! I had initial problems too - I had left the input pins floating which meant that some data was getting through even when I had the connections deliberately wrong. Touching the board would stop the data flow, and that was really confusing me. Adding pull-downs on all pins made it work properly.