New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STM32F7: DIEPINT_TOC with ARM (Apple silicon) Mac #2374
Comments
I confirmed that this issue occurs on the stock STM32F723E-DISCO board running the stock stm32f723disco example. It looks like the STLINK-V3MINIE boards have a STM32F723 too, so do all STLink V3 devices have flaky USB when connected to ARM Macs? I'd expect lots of complaints if that were the case, but I haven't seen any. I have a STLINK-V3MINIE arriving tomorrow so I'll test and provide an update. |
Also, this issue disappears when the device is attached to the ARM Mac through a USB-C hub (instead of attached directly to the ARM Mac.) |
I don't have mac Mx machine to test with, for the record, are you using OTG HS or FS on F723 ? also which stock exampmle specifcialy e.g cdc_msc ? |
This issue occurs when using the OTG HS peripheral on the STM32F7. Interestingly the issue disappears when configuring the OTG HS peripheral to operate in full-speed mode with this change:
This issue applies to all the TinyUSB examples; since basic control transfers are flaky, the device struggles to enumerate, and when it does successfully enumerate, a control transfer will fail before long. FWIW though I verified that claim with these TinyUSB examples: dfu, cdc_msc, hid_generic_inout, hid_composite, midi_test. |
Here's the program I'm using to reproduce the issue on an ARM Mac: https://github.com/davekeck/ST-USB-Issue-Repro/blob/master/ST-USB-Issue-Repro.mm It simply issues On an Intel Mac, this program works as expected: the control transfers never fail and the loop continues indefinitely. On an ARM Mac, a control transfer will fail with |
I confirmed that the stock STLINK-V3MINIE (which has the STM32F723 and uses the OTG HS peripheral) also has this issue. If you plug a STLINK-V3MINIE into an ARM Mac and run the ST-USB-Issue-Repro program (which simply issues Here's an example ST-USB-Issue-Repro invocation:
I also confirmed that this failure disappears when connecting the STLINK-V3MINIE to an ARM Mac through a hub, or when the host is an Intel Mac. |
Good news: setting
But what's an appropriate value to use? My scope only goes up to 200MHz, so I'm not equipped to analyze the analog D+/D- signals... |
The root cause appears to be that we're or'ing the
This capacitor is presumably messing up our analog signals, which makes sense because it appears to be intended for low/full-speed mode, but we're in high-speed mode. |
Upon further testing, the assign-to-0xF13-instead-of-oring-with-0xF13 solution (which has the effect of clearing the Presumably the signal integrity of the D+/D- signals still isn't great with the |
thank you for your detail feedback, it is indeed confusing with these phy analog magic timing. I don't have anything to add or test, though please keep update the information. Maybe other could help. |
Additional info: this issue doesn't appear to occur on M1 Macs. So as of now:
I filed FB13481335 with Apple regarding this issue, but it's still unclear whether the problem is on the host side or device side (or both). |
A report of a similar issue (USB-C device works with M1 Mac, broken with M3 Mac): https://forums.macrumors.com/threads/usb-c-problems-on-new-m3-max-macbook-pros.2410302/ |
Operating System
MacOS
Board
custom
Firmware
stm32f723disco
What happened ?
I'm running the stm32f723disco example on a custom board. (Actual chip: STM32F730I8K6.)
USB comms work reliably when connected to an Intel Mac.
USB comms are flaky when connected to an ARM Mac, in which case the
USB_OTG_DIEPINT_TOC
/DIEPINT_TOC
interrupt is occurring on EP0. This causes TinyUSB to loop inhandle_epin_irq()
(because it never clears theDIEPINT_TOC
interrupt). However it's my understanding that theDIEPINT_TOC
interrupt shouldn't occur in the first place.Here's a screenshot of my debugging session that shows that
epin[0].diepint
hasDIEPINT_TOC
set (bit 3). See debug console at the bottom:This issue also occurs with stock STM32 firmware generated by STM32CubeIDE, which I posted about here:
https://community.st.com/t5/stm32-mcus-embedded-software/usb-comms-failure-with-apple-silicon-arm-mac/m-p/618571#M43842
I've ordered the official STM32F723E-DISCO hardware to verify that this isn't an issue with my custom board, as well as a USB protocol analyzer. I'll update this issue in a few days with my findings. I hope opening this issue isn't premature...
Issues related to DIEPINT_TOC interrupt: #139, #171
How to reproduce ?
Plug device into ARM Mac, and repeatedly issue
GET_STATUS
device requests. Eventually theDIEPINT_TOC
interrupt will occur.Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
I can't access the logging on my custom board. I'll provide the logging once I test on the official STM32F723E-DISCO hardware.
Screenshots
No response
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: