Skip to content
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

TinyUSB usb cable plugged and unlugged #32

Open
1 task done
apinggithub opened this issue Jul 29, 2023 · 0 comments
Open
1 task done

TinyUSB usb cable plugged and unlugged #32

apinggithub opened this issue Jul 29, 2023 · 0 comments

Comments

@apinggithub
Copy link

Operating System

Windows 11

Board

STM32F407

Firmware

当我在STM32F407开发板上rt-thread 4.1.1软件平台下,rt-thread studio开发环境中,加入tinyUSB 软件包,如下
image
软件版本V0.13.0。使用板载SPI Flash 作为存储,挂载到USB上作为U盘,配置后运行,插上USB线缆,效果挺好,显示如下
image
但是这样做是我在没有将SPI flash分区挂载到嵌入式系统的前提下操作的。在实际工作中,当嵌入式系统检测到USB线插上时会自动卸载掉当前分区,然后让USB挂载,当USB线拔掉时,嵌入式系统再次自动挂载分区。从而时序SPI Flash分区在USB和嵌入式系统之间自动切换。

What happened ?

当我这样尝试做时,想利用DCD_EVENT_UNPLUGGED和DCD_EVENT_PLUGGED事件来解决此问题,在tud_task函数内代码如下:
image

但跟踪调试发现,程序根本就跳不进这两个分支下。然后又尝试到tud_msc_start_stop_cb函数下,代码如下:
image

发现程序也不会到达到这里

How to reproduce ?

阅读程序代码,根据理解,在插拔USB线后,程序应该会执行到这里的,请问是程序哪里设置的不对,还是其它什么原因?

Debug Log as txt file

No response

Screenshots

No response

I have checked existing issues, dicussion and documentation

  • I confirm I have checked existing issues, dicussion and documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant