cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429I-DISC1: CAN2 pins PB12/PB13 conflict with USB_OTG_HS - no other pins left to use

Mike11
Associate

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.

Mike11_0-1748982524230.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Yes there is no way.. and even in the loopback mode you need the CAN pins to be free.

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.

View solution in original post

6 REPLIES 6
mƎALLEm
ST Employee

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

STM32 in dual CAN configuration: bxCAN Filter bank explanation and relation with CAN2 Start Bank parameter

But the constraint here is the USB... the CAN GPIOs needs to be dedicated only for CAN. 

 

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.
Karl Yamashita
Principal

The only option is to remove components so they don't interfere with the CAN transceiver.

R67, U7, R65, C53, U8. 

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

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 

 

test.png

 When I only changed the pins for CAN 2 it worked fine 

 

2.png

 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.

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

 

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.

So without desoldering these components there is no way to make it work outside of internal loopback mode?

Yes there is no way.. and even in the loopback mode you need the CAN pins to be free.

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.