2021-07-06 07:38 AM
Hello, I want to use STM32-MAT/TARGET to generate code for STM32F779NI CAN peripheral in interrupt mode to receive message over CAN bus. CAN IT block is having option only for TX, Rx and ESR interrupt. There is no option on CAN IT block to configure Rx Interrupt for FIFO FULL, FIFO MESSAGE PENDING and FIFO OVERRUN event. I want to call a function only when FIFO is Full.
Can anybody help me over this?
2021-07-07 12:18 AM
First of all i have no idea of how to use simulink blocks to program stm32
Maybe you can modify the "Automatic "C" code generation for STM32 is based on STM32Cube HAL libraries." to your needs before compiling
with regular handtyped code i would check every RX interrupt for the FIFO state with functions like :
Or take a look at the callback functions! in your Drivers/STM32xxxHAL_Driver/ folder
/** @addtogroup CAN_Exported_Functions_Group5 Callback functions
* @brief Callback functions
* @{
*/
/* Callbacks functions ********************************************************/
void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox1CompleteCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox2CompleteCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox0AbortCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox1AbortCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_TxMailbox2AbortCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo0FullCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo1MsgPendingCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_RxFifo1FullCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_SleepCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_WakeUpFromRxMsgCallback(CAN_HandleTypeDef *hcan);
void HAL_CAN_ErrorCallback(CAN_HandleTypeDef *hcan);
/**
* @}
*/