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

[bsp/stm32f407-rt-spark/stm32l496zg-st-nucleo] add cherryusb support #9929

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

supperthomas
Copy link
Member

@supperthomas supperthomas commented Jan 17, 2025

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

添加cherryusb相关的文件,方便后面人参考使用,
image

你的解决方案是什么 (what is your solution)

请提供验证的bsp和config (provide the config and bsp)

  • BSP:
  • .config:
  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

@supperthomas supperthomas requested a review from Rbb666 as a code owner January 17, 2025 13:34
@github-actions github-actions bot added BSP: STM32 BSP related with ST/STM32 BSP labels Jan 17, 2025
@Rbb666
Copy link
Member

Rbb666 commented Jan 18, 2025

@sakumisu 能麻烦review下吗,谢谢

@sakumisu
Copy link
Contributor

初始化那边我是想用 HAL_PCD_MspInit,不知道大佬啥想法?

@supperthomas
Copy link
Member Author

初始化那边我是想用 HAL_PCD_MspInit,不知道大佬啥想法?

好想法要不stm32加个公用的driver 放hal_driver?

@sakumisu
Copy link
Contributor

Member

做不了,第一个,因为中断主从共用,不是那种注册的形式,不确定用户是用主还是从,所以没法直接调用 handle。HAL_PCD_MspInit 的话,由于不同的 stm32系列他的regbase可能不一样,所以还是只能按照board来。不然的话我早就加到 glue里面了。

@supperthomas
Copy link
Member Author

HAL_PCD_MspInit

看了一下代码,这边cherryUSB没有依赖HAL库,如果要加HAL_PCD_MspInit,需要加PCD_HandleTypeDef hpcd_USB_OTG_FS; 结构体,这个结构体主要中断中需要使用,这个就要依赖HAL库了。看上去不是很耦合。

@sakumisu
Copy link
Contributor

HAL_PCD_MspInit

看了一下代码,这边cherryUSB没有依赖HAL库,如果要加HAL_PCD_MspInit,需要加PCD_HandleTypeDef hpcd_USB_OTG_FS; 结构体,这个结构体主要中断中需要使用,这个就要依赖HAL库了。看上去不是很耦合。

这个倒是不需要,定义一个局部变量,我们主要是使用 instance

@supperthomas
Copy link
Member Author

HAL_PCD_MspInit

看了一下代码,这边cherryUSB没有依赖HAL库,如果要加HAL_PCD_MspInit,需要加PCD_HandleTypeDef hpcd_USB_OTG_FS; 结构体,这个结构体主要中断中需要使用,这个就要依赖HAL库了。看上去不是很耦合。

这个倒是不需要,定义一个局部变量,我们主要是使用 instance

finish

@dongly
Copy link
Contributor

dongly commented Jan 20, 2025

能否支持一下 Host 模式 🤝

@supperthomas
Copy link
Member Author

能否支持一下 Host 模式 🤝

先合并这个吧,后面有感兴趣的可以PR一下。目前host我用的还不是很多

@supperthomas
Copy link
Member Author

@Rbb666 其他代码先看下吧。

@sakumisu
Copy link
Contributor

+1

@supperthomas supperthomas added the +1 Agree +1 label Jan 21, 2025
@BernardXiong
Copy link
Member

这里有stm32f407的,也有stm32l496的,这部分在标题,message上是否也多体现出来些?

另外,两边的目录结构也不相同,统一下更好:

  • stm32f407: stm32f407-rt-spark/board/ports/cherryusb
  • stm32l496: stm32l496-st-nucleo/board/cherryusb

@sakumisu
Copy link
Contributor

统一改成 board/cherryusb_port.c 把,与其他的保持一致。

@supperthomas supperthomas changed the title [bsp/stm32f407-rt-spark] add cherryusb support [bsp/stm32f407-rt-spark/stm32l496zg-st-nucleo] add cherryusb support Jan 22, 2025
@supperthomas
Copy link
Member Author

  • stm32f407-rt-spark/board/ports/cherryusb

已经统一到stm32f407-rt-spark/board/ports/cherryusb。

@dongly
Copy link
Contributor

dongly commented Jan 22, 2025

bsp/stm32/stm32l496-st-nucleo/board/port/cherryusb/cherryusb.c.orig 不需要

@supperthomas
Copy link
Member Author

bsp/stm32/stm32l496-st-nucleo/board/port/cherryusb/cherryusb.c.orig 不需要

感谢提醒

@supperthomas
Copy link
Member Author

+1

@BernardXiong BernardXiong merged commit d9947e5 into RT-Thread:master Jan 23, 2025
46 checks passed
1078249029 pushed a commit to 1078249029/rt-thread that referenced this pull request Jan 23, 2025
1078249029 pushed a commit to 1078249029/rt-thread that referenced this pull request Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BSP: STM32 BSP related with ST/STM32 BSP +1 Agree +1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants