cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN1 not working on PA11 and PA12

Meiko_Ju
Visitor

Hello everyone,

I tried to put Canopen node for stm32 into operation.

I used the standard pinning from STMCubeIde, i.e. pa 11 and 12.

But this does not seem to work.

void FDCAN1_IT1_IRQHandler(void)
{
/* USER CODE BEGIN FDCAN1_IT1_IRQn 0 */

/* USER CODE END FDCAN1_IT1_IRQn 0 */
HAL_FDCAN_IRQHandler(&hfdcan1);

is not called.

Is something known here?

Solution was to change the pins to PB9 and PB8. Now the function was called and the stack ran.

Is there a workaround to use pa11 and 12 anyway ?

Thanks for your support.

6 REPLIES 6
mƎALLEm
ST Employee

Hello @Meiko_Ju and welcome to the community.

That depends on the pins connected to the CAN transceiver pins. It's working on PB9 and PB8 so the transceiver is using these pins and not pA11 and PA12.

Need to check your board schematic.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello, the PCB is a custom one. The can transmitter was originally on PA11-12 and was then re-soldered to PB8-9. So this is not the problem.

When I generate code for PA11-12, the interupt is not called.
With the same settings and same code and new generation for PB8-9 it is called.

Thanks for the quick feedback.

Do you mean when you connect back PA11 and PA12 to the CAN transceiver you can not transmit CAN messages?

If yes please share your schematics mainly the CAN transceiver + PA11 and PA12 pins of the MCU (Please share a photo with a good resolution). Or share the PDF.

Are you sure there is nothing else connected to PA11 and PA12?

PS: please use </> button to paste your code. See this link.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Meiko_Ju
Visitor

Originally we had fdcan1_tx on pa12 and fdcan1_rx on PA11 on the Can-Transiver. It did not work.
We then changed fdcan1_tx to pb9 and fdcan1_rx to pb8 using the StmCubeIDE. At the same time, we also re-soldered the corresponding channels of the transiver. The newly generated code now worked.
So I don't see a problem with our HW layout here.

The only difference I have noticed is that when debugging the first case, i.e. PA11 PA12, the fdcan interrupt is not called. When debugging the generated code with fdcan1 on Pb8 and Pb9, this is now called.

i hope the drawing helps to understand my problem.

Thanks again for your support

Hello,

Unfortunately the sketch you attached doesn't help. Need the electrical schamatics.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
mƎALLEm
ST Employee

To me most probably it's a hardware issue.

You need to check:

- You PA11 and PA12 are correctly connected to the CAN transceiver pins. PA12 connected to the CAN_Tx of the transceiver and PA11 connected to the CAN_Rx.

- Check that PA11 and PA12 are not connected to any other device or hardware except the CAN transceiver.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.