Skip to main content
Jakub Augustyn
Associate II
Jan 31, 2018 4:48 PM UTC
Question

STM32F103RET6 CAN Remap

Posted on January 31, 2018 at 17:48

Hi i have a problem with STM32F103RET6. When i leave default pinout for CAN (PA11 & PA12) everythig is working. But because in future i also want to use USB i wanted to change CAN pins to PB9 & PB8. And it is a problem because debug hangs when i change it and go to debug mode. It hangs on MX_CAN_Init --> HAL_CAN_MspInit(hcan) --> __HAL_RCC_CAN1_CLK_ENABLE(). I can see an error and from this moment you can't upload new code to uC (bassicaly you can but i have to put reset pin to gnd before uploading and is isn't normal). In practice i can see that despite the error in debug and faulty connection main loop is working because LED is blinking. 

Please help me. Thanks. 

#pinout #can #stm32f103ret6
This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
Jan 31, 2018 5:20 PM UTC
Posted on January 31, 2018 at 18:20

Most F1 parts can't support CAN and USB operations together (need F105/107 as I recall), as the share a common FIFO buffer.

Check also errata for remap issues. The F1 remap pins in blocks.

For new designs please consider newer generations of parts.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Jakub Augustyn
Associate II
Jan 31, 2018 5:41 PM UTC
Posted on January 31, 2018 at 18:41

I don't use USB and CAN together yet. Now i have testing code with CAN only and blinking LED. Witch default pinout it works ok (debug, loading etc). When i remap CAN pins it hangs in debug when inicjalizing CAN and from that moment you can't load code to uC and open debug.