STM32H7 U(S)ART Low Level RS485-DE Pin not switching
Hi Folks,
I have an issue with the RS485 Driver Enable Pin with the USART6 on an H7A3 (Nucleo).
The Perhiperal is set up in CubeMX with "Hardware Flow Control (RS485) enabled.
I have developed a driver using the Low Level functions.
The Peripheral is setup by Cube MX, in "uart.c" the "DE Mode" is enabled:
LL_USART_EnableDEMode(USART6);
LL_USART_SetDESignalPolarity(USART6, LL_USART_DE_POLARITY_HIGH);
LL_USART_SetDEAssertionTime(USART6, 0);
LL_USART_SetDEDeassertionTime(USART6, 0);
When I start a transmission with
LL_DMA_SetMemoryAddress(hrUA->txDMA.hDMA, hrUA->txDMA.dmaCh, txAddr); // set TxBuffer Address
LL_DMA_SetDataLength(hrUA->txDMA.hDMA, hrUA->txDMA.dmaCh, dataSz); // set Tx Size
LL_DMA_EnableIT_TC(hrUA->txDMA.hDMA, hrUA->txDMA.dmaCh); // enable Tx Transfer Complete IRQ
LL_DMA_EnableIT_TE(hrUA->txDMA.hDMA, hrUA->txDMA.dmaCh); // enable Tx Transfer Error IRQ
LL_USART_ClearFlag_TC(hrUA->hUA); // clear Tx complete IRQ
// NOTE: Transfer Complete IRQ will be enabled by DMA TC Interrupt handler
LL_USART_EnableDMAReq_TX(hrUA->hUA);
LL_USART_EnableDirectionTx(hrUA->hUA); // enable U(S)ART Tx
I can see the Bits beeing clocked out on the Tx Pin in my Oscilloskope. The DMA Interrupt and the USART Transfer complete Interrupt are fired, so generally I'd say: the peripheral is working and is sending data. But the Scope shows clearly that the Driver Enable Pin is not toggling during TX.
My assumption was: when the "DE-Mode" is enabled (LL_USART_EnableDEMode(USART6);) an I enable the Transmission (LL_USART_EnableDirectionTx(hrUA->hUA);) the Peripheral would set the DE-Pin automatically - otherwise settings like DE Asserting-Time and DE Deassertion Time would not make much sense.
Am I missing something? Do I have to take an extra step to tell the Peripheral to enable the DE Pin? I was looking for something like that, but could not find anything ...
thank you for any input!
