I gave this a try, it didn’t make any difference. Interestingly however setting halfduplex to true, did change my readings, however the register values appeared to be just as erroneous as before - suggesting that perhaps I was using full-duplex all along…
I’m really at a loss now for where to go next.
This is the code that ST provided to setup the peripheral:
huart.Instance = USART_STPM;
huart.Init.BaudRate = in_baudrate;
huart.Init.WordLength = UART_WORDLENGTH_8B;
huart.Init.StopBits = UART_STOPBITS_1;
huart.Init.Parity = UART_PARITY_NONE;
huart.Init.Mode = UART_MODE_TX_RX;
huart.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart.Init.OverSampling = UART_OVERSAMPLING_16;
and to send and receive in full duplex:
static uint8_t UARTWrp_SendAndReceiveByte(uint8_t data)
HAL_UART_Transmit( &data, 1, 0);
HAL_UART_Receive( &data, 1, USART_TIMEOUT);
Partly what threw me off for a start, I don’t quite understand how in full duplex mode, the firmware is meant to simultaneously write to, and read from ‘data’?
This is a sample of the TX/RX data as measured between the master and slave. I believe the slave is working correctly as it is meant to send back the configuration data written to it during initialisation, and I am seeing these packets coming back. However they don’t seem to successfully make it into the ST micro.