2020-09-29 01:40 AM
hi i'm trying to use the stm32H750 uart with Interrupt i managed to get it working but the message is a bit off ( alot ) here is a bit of the code
uint8_t tx_buff[]=" ";
uint8_t rx_buff[20];
HAL_UART_Receive_IT(&huart1, &rx_buff[0], 20);
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart){
n3=n3+5;
HAL_UART_Receive_IT(huart, &rx_buff[0], 20);
check = rx_buff[0];
if (check==67){
n1=n1+100;
};
HAL_UART_Transmit_IT(&huart1, rx_buff, 21);
}
what i'm doing to try it , is that i'm monitoring via stmstudio and whenever a message arrive i'll rederect to the the host and read it again
here are the results
rx is coming back from mcu
2020-09-29 07:19 AM
Seems like the clock is off. Check your clock settings including HSITRIM which CubeMX has a history of getting incorrect. Could also be that you're using incompatible UART settings.
2020-09-29 07:26 AM
Baud rates probably off, get a scope, check the timings and settings you're pushing in.
Does a simple one-at-a-time polling method work? How about sending?
Why does the transmit send 21 characters?
I'd probably copy the rx_buff to tx_buff before recommitting the rx_buff
H7 doesn't output at RS232 levels
2020-09-29 08:42 AM
-baudrate is set on 9600 on both the emitter(pc) receiver(stm32)
-reading one time is not working either
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_UART_Receive(&huart1, rx_buff, sizeof(rx_buff), HAL_MAX_DELAY);
HAL_Delay(500);
HAL_UART_Transmit(&huart1, rx_buff, sizeof(rx_buff), HAL_MAX_DELAY);
HAL_Delay(500);
}
-just for testing i had a problem where the receive function didn't start from the 0
2020-09-29 09:25 AM
where does one find that
2020-09-29 10:13 AM
2020-09-30 06:29 AM
Prove that the output works, if that doesn't function there is no hope for reception.
while (1)
{
char str[] = "UUUUU testing *****\r\n";
HAL_UART_Transmit(&huart1, str, sizeof(str)-1, HAL_MAX_DELAY);
HAL_Delay(500);
}
I suspect the UART connectivity is broken, but would need to understand schematic/connectivity you have wired.
2020-10-01 02:29 AM
2020-10-01 04:01 AM
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
what should i change it to
2020-10-01 04:31 AM
works too with arduino serial