cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411 switching between USB Host & Device and Middleware issues

Romder
Associate II

Hi all!

On an STM32 project I'm working on, I want my USB port (USB C in that case) to work either in Host Mode or in Device Mode, depending on a menu change from the user. For added context, this is for a MIDI project in which the MC will either use USB Host or USB Device as a means of communication.

It appears the mode is determined by the state of Pin PA13 (SYS_JTMS_SWDIO), but I would rather do everything in software, as the USB connection will be the same (the implementation will differ between the two).

Also, when I set the USB mode to OTH/Dual_Role_Device, all of the USB files are being deleted. Should I just save the files used in Host_Only and in Device_Only in another folder, or is there a cleaner way to have both implementations at the same time? If I need to code everything from scratch, I would love to have some pointers on where to begin.

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Gyessine
ST Employee

Hello @Romder ,

Here is a link to an article that explains how to enable the NUCLEO H723 to switch between host and device modes. You can use it as a reference to assist with your F4 board project.

BR,

Gyessine

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

2 REPLIES 2
Gyessine
ST Employee

Hello @Romder ,

Here is a link to an article that explains how to enable the NUCLEO H723 to switch between host and device modes. You can use it as a reference to assist with your F4 board project.

BR,

Gyessine

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.

This is a great resource!

Thank you very much!