STMH7 UART interrupt does not trigger on serial Rx from a STM32F103CB (OpenCM9.04)
I am testing Rx handler logic on a STM32H7 based board. Pins PD0/PD1 are set as Rx/Tx (huart4) with Global Interrupt set.
The uart is setup to interrupt on Idle...
HAL_UARTEx_ReceiveToIdle_DMA(_uart, _JoyRxData, BROADCAST_CMD_SIZE);
and the interrupt is reset inside callback
HAL_UARTEx_RxEventCallback(UART_HandleTypeDef * huart, uint16_t Size)
I tested the serial connection and handler logic with the STM32H7 board connected to a PC (via USB-TTL converter), and separately with it connected to a OpenCM9.04 development board.
When the STM32H7's Rx/Tx pins are connected to an OpenCM9.04 development board's Tx/Rx pins, the callback fails to trigger, even though uart->RxState changes...
- When uart is initialized, and HAL_UARTEx_ReceiveToIdle_DMA is set, uart->RxState changes from HAL_UART_STATE_READY to HAL_UART_STATE_BUSY_RX. (the UART is now waiting for data Rx)
- When a connected OpenCM transmits data to STM32H7, uart->RxState changes from HAL_UART_STATE_BUSY_RX to HAL_UART_STATE_READY. But HAL_UARTEx_RxEventCallback is not called! (Don't know what causes its state to change!). So, the interrupt is never reset by calling HAL_UARTEx_ReceiveToIdle_DMA. And any subsequent transmission of data packet from OpenCM is ignored!
On the other hand, when the STM32H7's Rx/Tx pins are connected to a PC via TTL-USB converter, any text typed on a connected Terminal on the PC are reliably received and handled repeatedly.
- With the STM32H7 board connected to a PC, and the PC sends data, then also the uart->RxState changes from HAL_UART_STATE_BUSY_RX to HAL_UART_STATE_READY. However, this time the callback is triggered. This causes the received data to be handled and the interrupt is reset to receive to Idle, for another packet of data (by calling HAL_UARTEx_ReceiveToIdle_DMA).
Questions are....
1) Why does the callback not get called when receiving data from the OpenCM board?
2) When connected to the OpenCM board, the uart->RxState on STM32H7 does change state as expected - how, if the callback is not getting triggered?
3) Could there be a voltage level incompatibility between the OpenCM board (which runs an STM32G103CM) and the STM32H7 on my board?
