Skip to main content
Associate
February 28, 2025
Solved

FDCAN1 not working on PA11 and PA12

  • February 28, 2025
  • 4 replies
  • 1777 views

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.

Best answer by Meiko_Ju

Hello everyone,
we could not find any hardware errors. we will now simply use pb 8-9 for fd can. it works there.

4 replies

mƎALLEm
ST Technical Moderator
February 28, 2025

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 "Best answer" on the reply which solved your issue or answered your question.
Meiko_JuAuthor
Associate
February 28, 2025

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.

mƎALLEm
ST Technical Moderator
February 28, 2025

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 "Best answer" on the reply which solved your issue or answered your question.
Meiko_JuAuthor
Associate
February 28, 2025

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

mƎALLEm
ST Technical Moderator
February 28, 2025

Hello,

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

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
mƎALLEm
ST Technical Moderator
February 28, 2025

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 "Best answer" on the reply which solved your issue or answered your question.
mƎALLEm
ST Technical Moderator
March 3, 2025

Also, please use the Crystal you have on the board for the CAN communication:

mALLEm_0-1741000949940.png

instead of the internal HSI (not recommended for CAN).

This is the new config:

mALLEm_1-1741001028569.png

 

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
Meiko_JuAuthor
Associate
March 5, 2025

Hello,

sorry for the late reply.
The assembled controller is the correct one, this is only a deviation in the circuit diagram. The 2 projects were quickly nailed together by us, but I have checked your findings. No change.
We still do not run into the FDCan1 interrupt in the project error.

Thanks again for the support.

Meiko_JuAuthorBest answer
Associate
March 26, 2025

Hello everyone,
we could not find any hardware errors. we will now simply use pb 8-9 for fd can. it works there.