2026-04-08 8:13 AM - edited 2026-04-08 9:10 AM
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.
2026-04-08 8:21 AM
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"
2026-04-08 8:30 AM
@HL_Efeng wrote:PB8-BOOT0 for Rx
Do you need to take special measures to disable the BOOT0 function on that pin?
2026-04-08 8:34 AM
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.
2026-04-08 8:38 AM
I used CubeProg to set Boot1bit by software.
2026-04-08 8:40 AM
I used CubeProg to set Boot0 bit by software.
The option bit nSWBOOT0 decides how to decide Boot1 bit: by BOOT0 pin or by software.
2026-04-08 8:42 AM
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.
2026-04-08 9:03 AM
yes. I connected another node(both an F407 board and a DJI motor) to the bus. but still not works. the F407 and motor works good.
Only after I changed pins to PB9 PB8, it works in Normal Mode(even none another node connected, it can send message out continuiosly). It never works in Normal mode when I use PA12&PB8.
before I change the pins, ifever I connected an F407 board for ACK or not, but it never works in Normal mode. I edited TimeSeg,Baudrate,clock division,and even replaced tranceiver,it not works however.
2026-04-08 9:11 AM
edited my post description.Sorry for my unclear des.
2026-04-08 9:54 AM - edited 2026-04-08 10:18 AM
@HL_Efeng wrote:
Only after I changed pins to PB9 PB8, it works in Normal Mode(even none another node connected, it can send message out continuiosly). It never works in Normal mode when I use PA12&PB8.
Ok so the common pins in both scenarios is PB8. So the issue is not on PB8 but rather on PA12.
Are you sure there is nothing connected to PA12 apart from the CAN tranceiver?
Is the External loopback working when PA12 and PB8 are used?