2016-11-11 05:40 PM
ciao ..!!
I use STM32F103C8Tx, my IDE is Atollic and configure the project with STM32CubeMX I wanted to try to use the virtual serial present in Cube but I have some problem. I enabled the USB Device and added the class Virtual Com Port first of all in the Main.c I include:#include ''usbd_cdc_if.h''
in ''While (1)'' i use the function of the class for send every second a ''hello''uint8_t msg[] =
''hello'';
while(1)
{ CDC_Transmit_FS(msg,5); HAL_Delay(1000);} Ok ... This code seems really simple but the debugger always stops in the function:
void
HardFault_Handler(
void)
{while (1)
{ }}
I also tried to make some modifications to the ''usbd_cdc_if.c'' file but without any solution I hope someone can help me and explain a solution to this problem Thank you and good day, Marco #cube-stm32f4-usb-virtual-com2016-11-22 03:58 AM
Hello,
Refer to user manual on how to use the STM32Cube USb device library,You can find under the STM32CubeF1 package a set of applications about USB device which can help you as an implementation example:
STM32Cube_FW_F1_V1.3.0\Projects\STM3210C_EVAL\Applications\USB_Device
Hope this helps you.Regards