STM32H723 Nucleo: UART4 not working
I am stumped and frustrated. I wrote some test code to test UART4. It worked fine. Then I moved the test code over to my main project and now I get no UART interrupts. Both code sets run on the same hardware. I have checked to make sure the UART RX was on the right pin, checked the NVIC settings, even went into the UART registers looking for a difference. Any ideas?
main code:
HAL_UART_Receive_IT(&huart4, rx_buff, 1);
IRQ handler:
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
static uint8_t MeasState=0; //0=meas, 1=calc
static uint32_t OldSample;
uint32_t NewSample;
//static uint32_t OldTimerValue;
uint32_t NewTimerValue;
if(rx_buff[0]==0xF8)
{
if(MeasState==0)
{
OldSample=__HAL_TIM_GET_COUNTER(&htim23);
MeasState=1;
} else
{
NewSample=__HAL_TIM_GET_COUNTER(&htim23);
MeasState=0;
NewTimerValue = (NewSample-OldSample)/2560;
//TIM2->ARR = NewTimerValue;
__HAL_TIM_SET_AUTORELOAD(&htim2,NewTimerValue);
}
}
HAL_UART_Receive_IT(&huart4, rx_buff, 1);
}
