diff --git a/components/esp_phy/Kconfig b/components/esp_phy/Kconfig index 49a51eec33..45de916319 100644 --- a/components/esp_phy/Kconfig +++ b/components/esp_phy/Kconfig @@ -104,4 +104,12 @@ menu "PHY" help When brownout reset occurs, reduce PHY TX power to keep the code running. + config ESP_PHY_ENABLE_USB + bool "Enable USB when phy init" + depends on ESP_CONSOLE_USB_SERIAL_JTAG + default y + help + When using USB Serial/JTAG controller, PHY should enable USB, otherwise log will + not be displayed. But working with USB, the RF performance may be affected. + endmenu # PHY diff --git a/components/esp_phy/include/phy.h b/components/esp_phy/include/phy.h index c2a49ed203..1d0690f356 100644 --- a/components/esp_phy/include/phy.h +++ b/components/esp_phy/include/phy.h @@ -85,6 +85,13 @@ uint8_t phy_dig_reg_backup(bool backup_en, uint32_t *mem_addr); void phy_freq_mem_backup(bool backup_en, uint32_t *mem); #endif +#if CONFIG_ESP_PHY_ENABLE_USB +/** + * @brief Enable or disable USB when phy init. + */ +void phy_bbpll_en_usb(bool en); +#endif + #ifdef __cplusplus } #endif diff --git a/components/esp_phy/lib b/components/esp_phy/lib index 74658eb4fe..7586abbf59 160000 --- a/components/esp_phy/lib +++ b/components/esp_phy/lib @@ -1 +1 @@ -Subproject commit 74658eb4fe30e42599a459ef89294010e26d57b6 +Subproject commit 7586abbf591ab63d609d7afeb377559deabec808 diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index 041ed18155..7fd5b2c124 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -651,6 +651,10 @@ void esp_phy_load_cal_and_init(void) } #endif +#if CONFIG_ESP_PHY_ENABLE_USB + phy_bbpll_en_usb(true); +#endif + #ifdef CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE esp_phy_calibration_mode_t calibration_mode = PHY_RF_CAL_PARTIAL; uint8_t sta_mac[6];