2025-09-02 6:24 AM
When using PLL3Q as input with a frequency of 32MHz for USBPHY I have a RCC_CCIPR1 register initialized at value 0x2a00 when entreing USB_CoreReset function that is not correct (should be 0x2b00).
Solved! Go to Solution.
2025-10-31 9:25 AM
Hi @PHT
An internal ticket is submitted to dedicated team for a fix in driver! (220943) It seems LL_RCC_USBREF_CLKSOURCE is not implemented in current HAL/LL driver.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-09-05 12:52 AM
Hello @PHT
Could you please share your IOC file? Having access to it will help me investigate the issue more thoroughly and gain a better understanding of your configuration.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-10-31 9:25 AM
Hi @PHT
An internal ticket is submitted to dedicated team for a fix in driver! (220943) It seems LL_RCC_USBREF_CLKSOURCE is not implemented in current HAL/LL driver.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-11-18 1:57 AM
Hi @PHT
Here is the updates to avoid blocking your progress while waiting for the official fix in the next release:
uint32_t UsbRefClockSelection; /*!< Specifies USBREF clock frequency.
This parameter can be a value of @ref RCCEx_USBREF_Clock_Source */Here, define RCCEx_USBREF_Clock_Sources to be selected as follows:
/** @defgroup RCCEx_USBREF_Clock_Source Peripheral USBREF clock frequency selection
* @{
*/
#define RCC_USBREFCLKSOURCE_16M ((uint32_t)(RCC_CCIPR1_USBREFCKSEL_1 | RCC_CCIPR1_USBREFCKSEL_0))
#define RCC_USBREFCLKSOURCE_19_2M ((uint32_t)RCC_CCIPR1_USBREFCKSEL_3)
#define RCC_USBREFCLKSOURCE_20M ((uint32_t)(RCC_CCIPR1_USBREFCKSEL_3 | RCC_CCIPR1_USBREFCKSEL_0))
#define RCC_USBREFCLKSOURCE_24M ((uint32_t)(RCC_CCIPR1_USBREFCKSEL_3 | RCC_CCIPR1_USBREFCKSEL_1))
#define RCC_USBREFCLKSOURCE_26M ((uint32_t)(RCC_CCIPR1_USBREFCKSEL_3 |\
RCC_CCIPR1_USBREFCKSEL_2 | RCC_CCIPR1_USBREFCKSEL_1))
#define RCC_USBREFCLKSOURCE_32M ((uint32_t)(RCC_CCIPR1_USBREFCKSEL_3 |\
RCC_CCIPR1_USBREFCKSEL_1 | RCC_CCIPR1_USBREFCKSEL_0))
/**
* @}
*/
/** @brief Macro to configure the USBREF clock frequency
* @param __USBREF_CLKSOURCE__ specifies the USBREF clock frequency.
* This parameter can be one of the following values:
* @arg RCC_USBREFCLKSOURCE_16M 16 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_19_2M 19.2 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_20M 20 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_24M 24 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_26M 26 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_32M 32 MHz clock selected as USBPHYC clock
*/
#define __HAL_RCC_USBREF_CONFIG(__USBREF_CLKSOURCE__) \
MODIFY_REG(RCC->CCIPR1, RCC_CCIPR1_USBREFCKSEL, (uint32_t)(__USBREF_CLKSOURCE__))
/** @brief Macro to get the USBREF clock frequency.
* @retval The clock source can be one of the following values:
* @arg RCC_USBREFCLKSOURCE_16M 16 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_19_2M 19.2 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_20M 20 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_24M 24 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_26M 26 MHz clock selected as USBPHYC clock
* @arg RCC_USBREFCLKSOURCE_32M 32 MHz clock selected as USBPHYC clock
*/
#define __HAL_RCC_GET_USBREF_SOURCE() ((uint32_t)(READ_BIT(RCC->CCIPR1, RCC_CCIPR1_USBREFCKSEL)))
#define IS_RCC_USBREFCLKSOURCE(__SOURCE__) \
(((__SOURCE__) == RCC_USBREFCLKSOURCE_16M) || \
((__SOURCE__) == RCC_USBREFCLKSOURCE_19_2M) || \
((__SOURCE__) == RCC_USBREFCLKSOURCE_20M) || \
((__SOURCE__) == RCC_USBREFCLKSOURCE_24M) || \
((__SOURCE__) == RCC_USBREFCLKSOURCE_26M) || \
((__SOURCE__) == RCC_USBREFCLKSOURCE_32M))
assert_param(IS_RCC_USBREFCLKSOURCE(PeriphClkInit->UsbRefClockSelection));then set it here. /* Set USBPHYC reference clock frequency*/
__HAL_RCC_USBREF_CONFIG(PeriphClkInit->UsbRefClockSelection); /** Initializes the peripherals clock
*/
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USBPHYC;
PeriphClkInit.UsbPhycClockSelection = RCC_USBPHYCCLKSOURCE_HSE;
PeriphClkInit.UsbRefClockSelection = RCC_USBREFCLKSOURCE_32M;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.