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

drivers/usbdev_synopsys_dwc2: add EFM32 support #18756

Merged
merged 10 commits into from
Dec 19, 2022

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Oct 17, 2022

Contribution description

This PR provides the changes for the Synopsys USB OTG IP core DWC2 driver for EFM32 MCUs. It also provides the changes of the board definition for stk3600 and stk3700 for testing.

Testing procedure

tests/usbus_hid should work on the EFM32 boards stk3600 (EFM32LG family) and stk3700 (EFM32GG family).

It is already tested for a sltb009a board (EFM32GG12 family).

Issues/PRs references

@github-actions github-actions bot added Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Platform: ARM Platform: This PR/issue effects ARM-based platforms Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Oct 17, 2022
@gschorcht gschorcht force-pushed the drivers/usbdev_synopsys_dwc2_efm32 branch from 339f4a1 to 00c9a44 Compare October 17, 2022 06:22
@gschorcht gschorcht added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Oct 17, 2022
@riot-ci
Copy link

riot-ci commented Oct 17, 2022

Murdock results

✔️ PASSED

c6bae0b cpu/efm32: increase RIOTBOOT_LEN for riotboot_dfu

Success Failures Total Runtime
118144 0 118144 01h:52m:19s

Artifacts

@gschorcht gschorcht force-pushed the drivers/usbdev_synopsys_dwc2_efm32 branch from 00c9a44 to 34a0082 Compare October 17, 2022 06:33
@gschorcht gschorcht added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 17, 2022
@benpicco benpicco requested review from jue89 and chrysn October 17, 2022 08:41
cpu/efm32/Makefile.dep Outdated Show resolved Hide resolved
@chrysn
Copy link
Member

chrysn commented Oct 17, 2022 via email

@gschorcht gschorcht added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 17, 2022
@gschorcht
Copy link
Contributor Author

I still have some work to do. I had to realize that the EFM32GG family does not have the USHFRCO clock that is used as USB_CLK on EFM32GG12B. That means we have to use different clock sources for different families 😟

cpu/esp32/Kconfig.esp32s2 Outdated Show resolved Hide resolved
@gschorcht gschorcht added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 24, 2022
@benpicco
Copy link
Contributor

benpicco commented Dec 7, 2022

Please squash this one

@gschorcht gschorcht force-pushed the drivers/usbdev_synopsys_dwc2_efm32 branch from 540e6a9 to c6bae0b Compare December 7, 2022 15:39
@gschorcht
Copy link
Contributor Author

Squashed and compiled successfully.

@gschorcht gschorcht requested a review from jue89 December 8, 2022 09:55
@gschorcht
Copy link
Contributor Author

gschorcht commented Dec 16, 2022

Not much time for reviewing, but testing I can fit in, on stk3700 and a custom board.

@chrysn Is there a chance you could test it on your stk3700 board? It's already reviewed and tested on EFM32GG12, just to know whether it also works for EFM32GG.

@chrysn
Copy link
Member

chrysn commented Dec 19, 2022

Tested with stk3700:

$ make -C tests/usbus_hid BOARD=stk3700 PROGRAMMER=openocd all flash term
2022-12-19 09:50:36,417 # main(): This is RIOT! (Version: 2023.01-devel-470-gc6bae-drivers/usbdev_synopsys_dwc2_efm32)
2022-12-19 09:50:39,166 # RIOT USB HID echo test
2022-12-19 09:50:39,169 # Write input to the hidraw device under /dev/hidrawX, and see if it gets echoed here

$ echo foo | sudo tee /dev/hidraw0
foo

2022-12-19 09:54:37,783 # USB_HID rx_cb: Test argument 
2022-12-19 09:54:37,784 # Msg received via USB HID: 
2022-12-19 09:54:37,785 # foo
2022-12-19 09:54:37,785 # 

Confirming that this works on stk3700. Thanks a lot!

@chrysn chrysn added the Reviewed: 3-testing The PR was tested according to the maintainer guidelines label Dec 19, 2022
@gschorcht
Copy link
Contributor Author

Tested with stk3700

@chrysn Many thanks for testing.

@gschorcht
Copy link
Contributor Author

What's missing to get all lights green? "bors merge" or "bors try" or anything else?

@chrysn
Copy link
Member

chrysn commented Dec 19, 2022

bors merge

@chrysn
Copy link
Member

chrysn commented Dec 19, 2022

Ah, and @jue89 has not cleared his review position. (Weird, I'd like to click "re-request review" but don't find the button).

Juergen, are you happy with the responses to your earlier review? Please update it.

Copy link
Contributor

@jue89 jue89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK from my side. Everything has been addressed.

@benpicco
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Dec 19, 2022

Already running a review

@bors
Copy link
Contributor

bors bot commented Dec 19, 2022

Build succeeded:

@bors bors bot merged commit f539035 into RIOT-OS:master Dec 19, 2022
@gschorcht
Copy link
Contributor Author

Thanks for reviewing and testing.

@gschorcht gschorcht deleted the drivers/usbdev_synopsys_dwc2_efm32 branch December 19, 2022 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Reviewed: 3-testing The PR was tested according to the maintainer guidelines Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants