STM32 cdc_receive_fs回调从未调用

发布于 2025-02-04 04:26:37 字数 802 浏览 4 评论 0原文

我正在尝试在STM32Cube上使用USB设备库,但是当我使用调试器执行执行或尝试在CDC_RECEIVE_FS中打开LED时,它永远不会达到这一点。

这是我设置每个设置的方式:

  • 我的板是一个nucleo-f746zg,
  • 我启用了device_only模式,激活的_vbus _SOF 。默认情况下,启用了GO FS Global Intrupt上的所有其他所有内容,并且USB已启用!
  • 我设置USB_DEVICE:fs ip 的类类设置为虚拟端口com,默认情况下将所有内容留在默认的
  • 主循环中,左空
  • cdc_receive_fs:将brekaspoint放在其中和/或hal_gpio_writepin(ld1_gpio_port,ld1_pin,gpio_pin_set);
  • 我已经设置了TIM2为我想做的事情设置了我想做的

事情串行以921600的福音,但一无所获。然后将腻子与9600的波特奶酪一起使用,仍然什么都没有...

如果有人有任何线索,我整天一直在挣扎。
这是整个项目: https://ecloud.global/s/cjgyqk6z9g58lm4

I am trying to use the USB Device library on STM32Cube but when I execute using the debugger or that I try to turn an LED on in CDC_Receive_FS, it never reaches that point.

Here is how I set up everyting:

  • My board is a NUCLEO-F746ZG
  • I enabled USB_OTG_FS in Device_Only mode, activated _VBUS and _SOF. Left everything else by default and USB On The Go FS global interrupt is enabled!
  • I set up USB_DEVICE: Class For FS IP set to Virtual Port Com, left everything by default
  • Main loop left empty
  • CDC_Receive_FS: put breakpoint in it and/or HAL_GPIO_WritePin(LD1_GPIO_Port, LD1_Pin, GPIO_PIN_SET);
  • I have TIM2 set up for the things I would like to do when it will work

Then I tried to send data to the board, first using Python using serial with a baudrate of 921600 but got nothing. Then using PuTTY with a baudrate of 9600, still nothing...

If anyone has a clue, I have been struggling with it the whole day.
Here is the whole project: https://ecloud.global/s/cjGYqK6z9g58Lm4

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文