2020-12-16 10:39 PM
Hello! I trying to use usart1 in main cycle, and VCP USB in usb interrupts. USB works fine, until i not using usart.
When i try continiosely send data in main cycle, usb stack not working(enumeration fails):
while (1)
{
HAL_UART_Transmit(&huart1, (uint8_t*)"Hello World\n", 12, 10);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
When i change USART1 to USART3, usb works normally... I can't understand - whats happens?
STM32CubeMX version : 5.2.1
Mcu: STM32F105RC
Optimizaion O0 and O1, behavior is the same.
Solved! Go to Solution.
2020-12-17 07:18 PM
For the OTG_FS_VBUS pin (PA9) to be used by another shared peripheral or as a general-purpose IO, the
PHY Power-down mode has to be active (clear bit 16 in the OTG_FS_GCCFG register)
On page 169 of RM0008.
Thanks for you help..
But in STM32Cube this pin not locked when usb enabled.. It is a very unpleasant surprise. If you fix this, you may safe a lot of time of developers.
2020-12-17 02:42 AM
Hi Skole.17,
Please refer to the STM32CubeF1, you can find ready developed CDC_Standalone USB device applications.
Else, if you are using CubeMX, can you please share your .ioc file.
Best Regards,
Ons.
2020-12-17 03:44 AM
2020-12-17 07:28 AM
Hi Skole.17,
Are you using an ST board or your custom board ?
If you are using an ST board, which is ?
Best Regards,
Ons.
2020-12-17 06:40 PM
I am using custom board.
Problem not in usart1. Usart1 TX pin and usb vbus has same gpio. In progect settings VBUS not selected... but usb not working, if VBUS pin(PA9) in LOW state.
2020-12-17 07:18 PM
For the OTG_FS_VBUS pin (PA9) to be used by another shared peripheral or as a general-purpose IO, the
PHY Power-down mode has to be active (clear bit 16 in the OTG_FS_GCCFG register)
On page 169 of RM0008.
Thanks for you help..
But in STM32Cube this pin not locked when usb enabled.. It is a very unpleasant surprise. If you fix this, you may safe a lot of time of developers.
2020-12-18 06:50 AM
Hi Skole.17,
Thank you for your feedback.
We will take this into consideration.
Please select the best answer, even if it is yours :smiling_face_with_smiling_eyes: . This helps other people who have same problem as yours.
Best Regards,
Ons.