2016-06-21 05:01 AM
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)2016-06-21 05:34 AM
CAN2 has a different IRQ Handler and NVIC configuration, don't see that in the code presented.