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

feature(esp_tinyusb): Added config option to select USB OTG1.1 periph on P4 #91

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

roma-jam
Copy link
Collaborator

@roma-jam roma-jam commented Nov 22, 2024

Description

Added possibility to select the USB OTG1.1 Peripheral (FS) on ESP32P4 via menuconfig.

Related

N/A

Testing

Could be tested only on correct P4 board.

Limitation

  • This changes are available only after removing usb_phy_p4.c in esp-idf. Removing the specific P4-related file additionally unlocks the possibility to initialize PHY for USB OTG1.1, which it necessary for USB OTG1.1 Peripheral.

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@roma-jam roma-jam self-assigned this Nov 28, 2024
@roma-jam roma-jam force-pushed the feature/esp32p4_fs_phy_config branch 3 times, most recently from 33e32d5 to 55e82a5 Compare December 4, 2024 11:06
@roma-jam roma-jam added this to the esp_tinyusb v1.6.0 milestone Dec 5, 2024
@roma-jam roma-jam mentioned this pull request Dec 13, 2024
6 tasks
@roma-jam roma-jam force-pushed the feature/esp32p4_fs_phy_config branch from 55e82a5 to ff842b6 Compare December 13, 2024 13:16
@roma-jam roma-jam marked this pull request as ready for review December 13, 2024 13:16
@roma-jam roma-jam marked this pull request as draft December 17, 2024 10:08
@roma-jam roma-jam force-pushed the feature/esp32p4_fs_phy_config branch from ff842b6 to c9736e0 Compare January 2, 2025 16:00
@roma-jam roma-jam force-pushed the feature/esp32p4_fs_phy_config branch from c9736e0 to d9c5e8b Compare January 10, 2025 11:40
Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

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

@roma-jam Please add a note to changelog.md and make sure to emphasize that the users need specific commit from esp-idf for this to work. Rest LGTM

@roma-jam
Copy link
Collaborator Author

@tore-espressif I just revisit the configuration again, and I think that it might need some refactoring.
Before it was:

            Allows set the USB PHY Controller for TinyUSB:
            - HS (USB OTG2.0 PHY for HighSpeed)
            - FS (USB OTG1.1 PHY for FullSpeed)

Which are .... wrong. That is USB Peripheral, not PHY. So I changed it.

Also, we are not allowed to select PHY, it is done automatically, that is why I don't think there should a any mentions of "PHY"-word in the TinyUSB config. So I removed all of them and changed them with "Peripheral".

Also, I have added the option to enable-disable run-time peripheral port selection to proceed with dynamic configuration and keep the possibility to use the legacy way of port selection (just in case, to verify the hardware, because it is working).

@roma-jam roma-jam changed the title feature(esp_tinyusb): Added config option to select FS PHY on P4 feature(esp_tinyusb): Added static config option to select FS PHY on P4 Jan 14, 2025
@roma-jam roma-jam force-pushed the feature/esp32p4_fs_phy_config branch from b0c796c to 28e9591 Compare January 15, 2025 19:40
@roma-jam roma-jam changed the title feature(esp_tinyusb): Added static config option to select FS PHY on P4 feature(esp_tinyusb): Added static config option to select FS periph on P4 Jan 15, 2025
@roma-jam roma-jam changed the title feature(esp_tinyusb): Added static config option to select FS periph on P4 feature(esp_tinyusb): Added static config option to select USB OTG1.1 periph on P4 Jan 15, 2025
@roma-jam roma-jam force-pushed the feature/esp32p4_fs_phy_config branch 3 times, most recently from 807268c to 7086e79 Compare January 17, 2025 11:15
@roma-jam roma-jam marked this pull request as ready for review January 17, 2025 11:23
@roma-jam roma-jam changed the title feature(esp_tinyusb): Added static config option to select USB OTG1.1 periph on P4 feature(esp_tinyusb): Added config option to select USB OTG1.1 periph on P4 Jan 17, 2025
Copy link
Collaborator

@peter-marcisovsky peter-marcisovsky left a comment

Choose a reason for hiding this comment

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

Just one thought, otherwise LGTM.

device/esp_tinyusb/tinyusb.c Outdated Show resolved Hide resolved
@roma-jam roma-jam force-pushed the feature/esp32p4_fs_phy_config branch from 7086e79 to cf47ab0 Compare January 17, 2025 13:15
@roma-jam
Copy link
Collaborator Author

@tore-espressif

Please add a note to changelog.md and make sure to emphasize that the users need specific commit from esp-idf for this to work. Rest LGTM

Added a specific point to dep: USB_PHY_SUPPORTS_P4_OTG11 in esp-idf is required

@roma-jam roma-jam force-pushed the feature/esp32p4_fs_phy_config branch from cf47ab0 to c219d0c Compare January 17, 2025 13:18
@roma-jam roma-jam mentioned this pull request Jan 17, 2025
6 tasks
@roma-jam roma-jam merged commit ab7db80 into master Jan 17, 2025
31 checks passed
@roma-jam roma-jam deleted the feature/esp32p4_fs_phy_config branch January 17, 2025 15:04
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

Successfully merging this pull request may close these issues.

3 participants