cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105RBT6 -> No interrupt from CAN2

hittive
Associate
Posted on June 21, 2016 at 14:01

Hi, I have a problem. I can transmit data with Can2 but input data isnt generate any interrupt. I use a HAL libraries.  I can see a correct input data in CAN_RDL0R and CAN_RDH0R register. CAN1 work properly. 

CAN1 and CAN2 configuration code:

if

(_hCANx == &hcan1

)

{

CAN_FilterConfTypeDef filter;

filter.FilterNumber =

0

;

filter.FilterMode = CAN_FILTERMODE_IDMASK;

filter.FilterScale = CAN_FILTERSCALE_32BIT;

filter.FilterIdHigh =

0x0000

;

filter.FilterIdLow =

0x0000

;

filter.FilterMaskIdHigh =

0x0000

;

filter.FilterMaskIdLow =

0x0000

;

filter.FilterFIFOAssignment = CAN_FILTER_FIFO0;

filter.FilterActivation = ENABLE;

filter.BankNumber =

0

;

HAL_CAN_ConfigFilter(&hcan1, &filter

)

;

HAL_CAN_Receive_IT(&hcan1, CAN_FIFO0

)

;

_Status |= CAN_INITIATED;

return

0

;

}

else

if

(_hCANx == &hcan2

)

{

CAN_FilterConfTypeDef filter;

filter.FilterNumber =

14

;

filter.FilterMode = CAN_FILTERMODE_IDMASK;

filter.FilterScale = CAN_FILTERSCALE_32BIT;

filter.FilterIdHigh =

0x0000

;

filter.FilterIdLow =

0x0000

;

filter.FilterMaskIdHigh =

0x0000

;

filter.FilterMaskIdLow =

0x0000

;

filter.FilterFIFOAssignment = CAN_FILTER_FIFO1;

filter.BankNumber =

14

;

filter.FilterActivation = ENABLE;

HAL_CAN_ConfigFilter(&hcan2, &filter

)

;

HAL_CAN_Receive_IT(&hcan2, CAN_FIFO1

)

;

_Status |= CAN_INITIATED;

return

0

;

}

and rest configuration od CAN2 is the same like CAN1 (without GPIO of course) 
1 REPLY 1
Posted on June 21, 2016 at 14:34

CAN2 has a different IRQ Handler and NVIC configuration, don't see that in the code presented.

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