2022-10-14 01:24 PM
Hello,
I am using an STM32H7B3I-EVAL board to test some FDCAN and ADC code that I have written.
The goal of the code is to do the following:
When I attempt to do this, the display freezes when I click the Tamper Button. I put a live expression on the ADC voltage and that continues to update, even after the display freezes. When I click the reset button, the screen unfreezes until I click the tamper button again.
I created a separate code where it ONLY has the ADC display and no FDCAN. This problem does not occur with this code and the display properly shows the ADC voltage.
I've attached a copy of my main.c as a reference. I've also put a snippet of the three callbacks I have
Callback 1: When the interrupt for the ADC occurs (Timer using TIM2, Channel 2)
Callback 2: When the FDCAN receives a message on FIFO0
Callback 3: When the tamper button is pressed
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc){
uhADCxConvertedData = HAL_ADC_GetValue(hadc);
}
void HAL_FDCAN_RxFifo0Callback(FDCAN_HandleTypeDef *hfdcan, uint32_t RxFifo0ITs){
BSP_LED_Toggle(LED2);
HAL_FDCAN_GetRxMessage(hfdcan, FDCAN_RX_FIFO0, &RxHeader, RxData);
uhCANxData = RxData[0];
}
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
BSP_LED_Toggle(LED3);
if (GPIO_Pin == BUTTON_TAMPER_PIN)
{
HAL_FDCAN_AddMessageToTxFifoQ(&hfdcan1, &TxHeader, &TxData0[0]);
TxData0[0]++;
}
}
Does anyone has any suggestions on where to look to diagnose a problem like this?