Yes, I want to receive data when the interrupt is triggered, but when sending data does not trigger the interrupt.
I tried to add NVIC_DisableIRQ(CAN0_ORed_0_15_MB_IRQn) and NVIC_EnableIRQ(CAN0_ORed_0_15_MB_IRQn) at the beginning and end of the send function, but did not succeed.
#define TX_MAILBOX (8UL)
#define RX_MAILBOX (0UL)
void SendCANData(uint32_t mailbox, uint32_t messageId, uint8_t * data, uint32_t len)
{
//NVIC_DisableIRQ(CAN0_ORed_0_15_MB_IRQn);
flexcan_data_info_t dataInfo =
{
.data_length = len,
.msg_id_type = FLEXCAN_MSG_ID_EXT,
.enable_brs = false,
.fd_enable = false,
.fd_padding = 0U
};
FLEXCAN_DRV_ConfigTxMb(INST_CANCOM1, mailbox, &dataInfo, messageId);
FLEXCAN_DRV_Send(INST_CANCOM1, mailbox, &dataInfo, messageId, data);
//NVIC_EnableIRQ(CAN0_ORed_0_15_MB_IRQn);
}
/*Interrupt callback function*/
void HAL_CAN0_Callback(void)
{
if( (recvBuff.msgId == 1)
{
InsertCanQueue(recvBuff);
}
}