STM32L073RZ: HAL_UART_Receive inverse order of data when printing on terminal.
HAL_UART_Receive(&huart2, (uint8_t*)msgToTransmit, MESSAGE_SIZE, HAL_MAX_DELAY);
int index = 0;
for (index = 0; index < MESSAGE_SIZE; index++) {
PRINTF("\n\rmsg to transmit is hex: %x", msgToTransmit[index]);
PRINTF("\n\rmsg to transmit is char: %c", msgToTransmit[index]);
}I am developing an application to send data using LoRa. I use an STM32 L073RZ (with LoRa shield) connected to a Raspberry Pi via USB. Everything works fine: there is a Python script that every 10 minutes sends data to the STM32 board, and then the board sends the LoRa message.
I would like now to "analyze" the message before sending. I tried to print on terminal the message that I send and:
if I send: abcdefgh
the result of PRINTF() with hex is:
index = 0 --> 64636261
index = 1 --> 68676665
the result of PRINTF() with char is:
index = 0 --> a
index = 1 --> e
Any suggestion/idea?