Skip to main content
Associate
April 8, 2026
Question

G431pin-multiplexing-in-fdcan1: in Different GPIO Port

  • April 8, 2026
  • 5 replies
  • 478 views

As addicated in DataSheet and CubeMX, there are two FDCAN1_Tx and two FDCAN1_RX in STM32G431CBT6. In my Prj, I used PA12 for Tx and PB8-BOOT0 for Rx, and my chip can only work in FDCAN_MODE_Ext._Loopback, and without any receive func be implemented. After I changed the FDCAN pin from PA12&PB8 to PB9&PB8 and adjusted my wire routing, the problem has be handled. so If the STM32G4 can use FDCAN pin from different port in some case? If not. I think it should be fixed in CubeMX, because CubeMX allows users to select CAN pin from different ports without any warning.​

5 replies

mƎALLEm
Technical Moderator
April 8, 2026

Hello @HL_Efeng and welcome to the ST community,

The problem is not clear. You need to elaborate more..

In which case is not working: Normal mode? Loopback mode? etc .. are you using a CAN tranceiver..

Not possible to help you with the description you've provided.

My preliminary answer: you can use any combination of alternate functions of CAN_Tx/CAN_Rx.

PS: I didn't understand this statements:

"and my chip can only work in FDCAN_MODE_Ext._Loopback, and without any receive func be implemented."

"After I changed the FDCAN pin from PA12&PB8 to PB9&PB8 and adjusted my wire routing, the problem has be handled"

 

 

"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."
HL_EfengAuthor
Associate
April 8, 2026

Sorry for my unclear description.

My design uses PA12 and PB8 as CAN_Tx and CAN_Rx, and I used a tranceiver correctly. the CAN only work in ExtLoopbackMode(Data can be send out correctly, but can not receive).

in Normal Mode, It works like this performance:When I first call the Func AddTxFifo in my program, the CAN tranceiver will send out an "000" and nothing later, and this 000 is consindered as CAN_ID by my CAN analyser. When I Second or more call it, it will send an "01F" and nothing later, also consindered as CAN_ID.

FDCAN will enter bus_off after 16th call, and no more data be sendout anymore, until I reinit FDCAN or reset my board.

After I edited my design, and uses PB9&PB8 as CAN_Tx and CAN_Rx, It works correctly both in Normal and Loopback mode.

Thankyou for timely reply.

 

mƎALLEm
Technical Moderator
April 8, 2026

Still not clear.

In Normal mode, did you connect another CAN node to the CAN bus? if not, that couldn't work. You need to establish a complete CAN node where at least two CAN nodes are present on the CAN bus.

Do you have a condition where the Normal mode is working? if yes please describe the environment.

 

"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."
Andrew Neil
Super User
April 8, 2026

@HL_Efeng wrote:

 PB8-BOOT0 for Rx


Do you need to take special measures to disable the BOOT0 function on that pin?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
HL_EfengAuthor
Associate
April 8, 2026

I used CubeProg to set Boot1bit by software.

HL_EfengAuthor
Associate
April 8, 2026

edited my post description.Sorry for my unclear des.

mƎALLEm
Technical Moderator
April 13, 2026
 In fact, in Ext.LoopbackMode, it can send msg correctly. this has already inferred that the PA12 is correctly connected.

As PA12 is toggling as expected and the loopback mode works correctly but not in normal mode, that's either a hardware issue: broken transceiver, bad wiring or wrong/bad connections.. VIO pin of the transceiver connected to VDD of STM32? You need to inspect all the CAN bus you have.

Or bit timing issue: (but this is not the case since it works with PB9.

So double check again your hardware ... Probe PA12, probe PB9 with a logic analyzer or an oscilloscope and check the differences.

"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
Technical Moderator
April 13, 2026
 In fact, in Ext.LoopbackMode, it can send msg correctly. this has already inferred that the PA12 is correctly connected.

As PA12 is toggling as expected and the loopback mode works correctly but not in normal mode, that's either a hardware issue: broken transceiver, bad wiring or wrong/bad connections.. VIO pin of the transceiver connected to VDD of STM32? You need to inspect all the CAN bus you have.

Or bit timing issue: (but this is not the case since it works with PB9.

So double check again your hardware ... Probe PA12, probe PB9 with a logic analyzer or an oscilloscope and check the differences.

"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."
HL_EfengAuthor
Associate
April 13, 2026

At this point, it seems it can only be attributed to the bad PCB wiring. maybe the signal integrity has bad enough that STM32 cannot read a bit.

Wait. Maybe PB8 has broken? Maybe PA12 has transmitted a bit, but PB8 had not received. Let me check it by GPIO_Input. I will reply here in some days.

Thankyou for your patience.