I have to send data using the usart2 in my nucleo64 stm32f446re board. The type of data I have to send is float but until now I always send uint8_t using this code;
char msg[1]; for(int i = 0 ; i < Nbit*Sb ; i++) { sprintf(msg, "%d ", sigTX[i]); HAL_UART_Transmit(&huart2, (uint8_t *)msg, strlen(msg), HAL_MAX_DELAY); } Because sigTX is a pointer to float data in an array, I try to change the code using msg[4], in order to have 32 bit, and in HAL_UART_transmit I put (int32 *)msg, in order to send data with sign. This doesn't work, so can someone say to me where is the mistake? Sorry, but I'm new in embedded world.