Skip to main content
TSchn.4
Visitor II
Nov 9, 2021 9:16 AM UTC
Question

STM32F103: How to switch between CAN and USB?

I know that they can not be used at the same time. But how can you switch between CAN and USB at runtime in the same application?

This topic has been closed for replies.

4 replies

Uwe Bonnes
Chief
Nov 9, 2021 9:58 AM UTC

With sufficient de-and re-initialization it can be done.

ST Technical Moderator
Nov 9, 2021 10:33 AM UTC

Hello @Community member​ ,

Have a look at this FAQ: Concurrent use of USB and CAN with STM32F103.

When your question is answered, please close this topic by choosing Select as Best.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
LCE
Principal III
Sep 7, 2023 11:32 AM UTC

@Imen.D wrote:

Hello @Community member​ ,

 

Have a look at this FAQ: Concurrent use of USB and CAN with STM32F103.

 

When your question is answered, please close this topic by choosing Select as Best.

 

Imen


This link is ridiculously helpful - not at all... :D

@klas I guess it's possible with complete init / deinit (probably including turning off the peripheral clock)

Visitor II
Sep 7, 2023 11:22 AM UTC

Hi! I know it is old topic but I didn't find any answer how to switch between CAN and USB at runtime.

Does anyone have suggestion or working solution how to do this?

Thanks in advance.