1. How are you checking that you are transmitting? CAN bus analyzer, oscilloscope? Is you hardware connected to another CAN node, with terminating resistor?
2. What baud rate are you running at? You need to supply the code that shows MX_CAN_Init() and relevant code so we can see if the bit timing is correct
If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
i believe you should call HAL_CAN_Start(&hcan); after you set up the CAN filter.
hcan is already defined in can.c and MX_CAN_Init() is called. So you should be only referring to hcan variable.
You have only 1 can controller and yet i see you defined hcan2. So hcan1 and hcan2 are not valid.
If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source