2025-06-03 1:30 PM
Hello, I'm working on a project using the STM32F429I-DISC1 board and need to implement CAN communication. I'm using TouchGFX for the GUI, and when I generate the code, only CAN2 is available as an option.
CAN2 is mapped to pins PB12 (CAN2_RX) and PB13 (CAN2_TX), but according to the board schematic, these pins are already connected to USB_OTG_HS_ID and USB_OTG_HS_VBUS.
Is there any way that I can use CAN with this type of project? I see no other alternate pins. FMC and LTDC are taking up all the other options. Thank you.
Solved! Go to Solution.
2025-06-03 2:10 PM - edited 2025-06-03 2:11 PM
Yes there is no way.. and even in the loopback mode you need the CAN pins to be free.
2025-06-03 1:46 PM - edited 2025-06-03 1:56 PM
Hello,
Forget about TouchGFX and USB and try to configure only CAN2 on PB13 and PB12 and try the loopback mode
I invite you to read these articles:
Guide to CAN (bxCAN/CAN2.0) configuration in Loop back mode on STM32 MCUs
But the constraint here is the USB... the CAN GPIOs needs to be dedicated only for CAN.
2025-06-03 1:46 PM
The only option is to remove components so they don't interfere with the CAN transceiver.
R67, U7, R65, C53, U8.
2025-06-03 1:52 PM
Hello @mƎALLEm , I did a test in loopback mode with only CAN2 enabled. I looked over it with the debugger and the logic analyzer and when configured to PB12 and PB13 I get an error frame
When I only changed the pins for CAN 2 it worked fine
And when the pins were configured for PB12 and PB13, the loopback was working fine inside the debugger, only the readings from PB13 were wrong. Please let me know if the screenshots are blurry.
2025-06-03 2:07 PM
Indeed you need a dedicated pins for the CAN even in loopback mode.
You need to remove the compoment that overlap with CAN function mainly the
STMPS2141STR, C53 and EMIF02-USB03F2
2025-06-03 2:08 PM
So without desoldering these components there is no way to make it work outside of internal loopback mode?
2025-06-03 2:10 PM - edited 2025-06-03 2:11 PM
Yes there is no way.. and even in the loopback mode you need the CAN pins to be free.