hcan1 not working while hcan2 does work with same settings
I'm working with a custom STM32F105 board with two similar CAN circuits but CAN1 is not working.
I use STM32 HAL with this custom CAN lib which handles configuration and buffering.
It was working before with the same hardware but I can't get it woking anymore.
// create CAN instance
tSTM32_CAN &CANbus1 = *( new tSTM32_CAN(&hcan1, tSTM32_CAN::CAN250kbit) );
// enale CAN
CANbus1.InitCANFrameBuffers();
CANbus1.CANOpen();
CANbus1.SetCANFilter( true, 0, 0x00000000, 0x00000000 );
// Send message
void sendCANRequest() {
if (CANRequestScheduler.IsTime()) {
tSTM32_CAN::CAN_message_t message;
message.id = BMS_Messages[BMS_Message_i];
message.len = 0;
message.flags.extended = true;
CANbus1.CANSendFrame( &message );
}
}If I replace &hcan1 with &hcan2 and connect to CAN2 it works fine.
CANSendFrame in the end calls HAL_CAN_AddTxMessage which returns HAL_OK.
The 3 TX mailboxes fill up but the message just never gets sent out.
I also checked the filter function which should not matter for sending but it works fine.
