2024-07-21 11:18 AM
I'm using an STM32 H7 and CubeIDE,
As the title states, When placing a breakpoint at HAL_UART_TxHalfCpltCallback, it is triggered.
But when placing it at HAL_UART_TxCpltCallback it is never triggered, it used to work, but I don't know where it went wrong. Is there a setting for this in Cube IDE?
I don't use the halfcplt function, but it was now just added to search for the error.
I'm using normal DMA at highest priority. (I'm running multiple uart's and SAI with DMA)
void sendGPSdata(){
if(1){//gps_out[gpsoutpointer-gps_data_size+15] =='A'){
uart_tx_state = 1;
set_header(gps_data_size,gps);
set_payload(gps);
set_footer(gps);
HAL_UART_Transmit_DMA(&huart4,&uart_out[0],GPS_packet_size);
}
gps_data_behind--;
}
void HAL_UART_TxHalfCpltCallback(UART_HandleTypeDef *uart){
if(uart == &huart4){
//4g
}
}
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *uart){
if(uart == &huart4){
//4g
uart_tx_state = 0;
if(audio_to_uart_data_behind>=1){
send_audio();
}
else if(gps_data_behind >=1) sendGPSdata();
else if(can_data_behind >=1) sendCANdata();
}
else if(uart == &huart3){
//BLE1
}
else if(uart == &huart7){
//BLE2
}
}
Solved! Go to Solution.
2024-07-21 12:05 PM
It turned out I forgot to check the UART global interrupt checkbox.
2024-07-21 12:05 PM
It turned out I forgot to check the UART global interrupt checkbox.