cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN1 not working on PA11 and PA12

Meiko_Ju
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

14 REPLIES 14
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
Associate II

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.

Hello @Meiko_Ju ,

I have received your schematics in private (as you can't share it in public).

What I suggest for now is to test:

1 - Try to toggle PA12 gpio pin and check with an oscilloscope what happens on it.

2 - Probe also ADUM1286 VOA pin 2. Do you have the toggling signal on VIA (pin 7) in 5V ? If possible to share the oscilloscope screenshots with the voltage level.

3 - If PA11 and PA12 are OK, use these pins for CAN and probe what happens on VOA and VIB of ADUM1286 i.e. the connection between the isolator and the transceiver.

Question: How you can change the CAN pins in your HAW from PA11/PA12 to PB8/PB9?  are you sing the same chain (used by PA11/PA12): ADUM1286 + TJA1040?

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.

Hey,

1. pin toggling works without any problems.
2. also works
3. can does not work PA12 always high PA11 always low -> when debugging we do not run into the CAN interrupt as in the original post. 

To your Question: Bridged to ADUM with enamelled copper wire from PB8 and PB9. Code adapted using STM32Cube IDE, no changes were made to the user code -> CAN worked on PB8/9 -> we now ran into the CAN-Interrupt.

For info: We use CANopenNode STM32

Thanks for your support.


Do you have any other ideas?

 

For the moment I'm out of ideas and I don't have idea what happens as I don't have your board.

Could you please share two ioc files?:

1- One for the non working project where PA11 and PA12 are configured.

2- One for the working project where PB8 and PB9 are configured.

 

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.