2018-01-31 08:48 AM
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 #stm32f103ret62018-01-31 09:20 AM
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.
2018-01-31 09:41 AM
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.