cancel
Showing results for 
Search instead for 
Did you mean: 

USB Communication doesn't work between STM32F4 and MacOS Sonoma

adriankTranspose
Associate

Problem:

The USB communication between STM32F401RC and MacOS v14.3.1 (Sonoma) doesn't work when the MCU is running on a bare metal, but it works when the MCU runs on FreeRTOS. It does "connect" on bare metal, but sending any USB MIDI messages from the app on MacOS to MCU doesn't have any expected effect on the MCU.

 

We are using:

- STM32F4xx HAL Driver v1.8.0

- usb_device, usb_desc v1.0_Cube

 

What have we tried:

1. The same problem occurs with STM32F401RB.

2. The USB communication works fine between STM32F103 (bare metal) and MacOS v14.3.1

3. The USB communication works fine between STM32F401 (bare metal) and MacOS v12.7 (Monterey).

4. The USB communication works fine between STM32F401 running on Free RTOS (doesn't work when on bare metal) and MacOS v14.3.1.

5. We are aware that from MacOS Ventura a permission has to be given for USB accessory connection, but this is not applicable to Mac Studio that we are using.

6. We use "Pocket MIDI" app on MacOS and we can see that the input port and output port for our device is available and we can "connect" to it. I am not sure whether it really connects, but the UI suggests that. However sending any SysEx messages via MIDI USB protocol has no expected effect.

7. We tried different USB cables, it makes no difference.

 

Brief Summary:

USB communication doesn't work between STM32F4 running on a bare metal and MacOS v14.3.1, but it works when the MCU runs on FreeRTOS. There is no issue between STM32F1 (bare metal) and MacOS v14.3.1, and there is no issue between STM32F4 (bare metal) and MacOS v12.7.

 

We have tried searching this problem on both MacOS side and STM32F4 side, but we have not found anything that could help us to resolve this issue.

 

Questions:

1. Could you please advise us what can we do to trace this problem?

2. Is there a known USB issue with STM32F4 running on a bare metal?

3. Are there any known issues with communication between STM32F4 and MacOS v14.3.1 (Sonoma)?

 

Any information could be valuable, so please share if you know anything!

 

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hi @adriankTranspose 

On bare metal, timing and interrupts are critical. Since it's working using Free RTOS, ensure that your systick configuration, interrupt priorities and USB interrupt are handled properly. You need to debug further. You can determine if the communication is being established correctly and where it might be failing using USB protocol analyzer to capture USB traffic.

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
FBL
ST Employee

Hi @adriankTranspose 

On bare metal, timing and interrupts are critical. Since it's working using Free RTOS, ensure that your systick configuration, interrupt priorities and USB interrupt are handled properly. You need to debug further. You can determine if the communication is being established correctly and where it might be failing using USB protocol analyzer to capture USB traffic.

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.

Hi @FBL , Thank you for your response and suggestions. Unfortunately after testing for 6h and being able to reproduce the issue, we can no longer reproduce it. Once the issue occurs again we will come back to it and try to debug it with the USB analyzer.