cancel
Showing results for 
Search instead for 
Did you mean: 

CAN BUS RECEIVE INTERRUPT

Ramazan Gülcan
Associate III

Hi;

Can not interrupt CAN BUS application?

I'm using the following code

void HAL_CAN_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan)

{

HAL_CAN_GetRxMessage(&hcan1, CAN_RX_FIFO0, &RxMessage, RxData);

}

1 ACCEPTED SOLUTION

Accepted Solutions
Ramazan Gülcan
Associate III

Hi;

I solved the problem. the following function must be used,

HAL_CAN_ActivateNotification(&hcan1, CAN_IT_RX_FIFO0_MSG_PENDING);

thanks for your answers @Community member​ 

View solution in original post

6 REPLIES 6
Ramazan Gülcan
Associate III

:waving_hand:

Make sure you have the IRQ Handler plumbed

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Ramazan Gülcan
Associate III

@Community member​ 

Ok, so is there traffic on the bus at 164062.5 baud for it to actually receive?

Your exact set up is poorly explained. You have an STM32 F4 running at 168 MHz? How is the bus connected? And to what?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Ramazan Gülcan
Associate III

@Community member​  It works properly without interruption. The connections are solid. interrupt is not working while only receiving data. callback function in new hal driver library has changed. which new function should be used?

Ramazan Gülcan
Associate III

Hi;

I solved the problem. the following function must be used,

HAL_CAN_ActivateNotification(&hcan1, CAN_IT_RX_FIFO0_MSG_PENDING);

thanks for your answers @Community member​