I've been attempting to develop a USB HID device using the STM32F3DISCOVERY board as my basis, generating my project with STM32CubeMX and the HAL library.
I've soldered my external crystal as per the User Manual UM1570, Section 6.10.1, using a 12MHz external crystal oscillator.
When my system clock is configured, STM32CubeMX generates the following lines for the oscillator initialization:
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}
My project is built in Atollic TrueStudio, uploaded, and debugged using the ST-LINK interface. I have not changed any of the default configuration settings for either project nor debug. When debugging, the error handler is called.
My assumption at this stage is that due to the HSE bypass required to clock the STM32F3VC device on board, the clock configuration cannot be achieved, for reasons unapparent to me. After flashing, the device is unrecognized by my computer when connecting to USB User, as opposed to the USB ST-LINK interface, so my further assumption is that the clock configuration error, and the lack of USB User interface are linked to one another.
Does anyone know where my error in thinking may lie?
RCC_OscInitStruct.HSIState = RCC_HSI_OFF
. Not sure that will solve your problem however. – CliffordHSIState
is ignored whenOscillatorType ==RCC_OSCILLATORTYPE_HSE
, so not your problem. – Clifford