cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX - STM32F411 code generation CDC ACM bug ?

ziz
Associate II
Posted on December 23, 2015 at 00:00

Hi,

not sure it's a bug because it's my first time with CDC ACM. But After a fresh CubeMX generation with USB_OTG_FS in device mode. I just add this :

uint8_t buf[] = 
''Hello\r\n''
;
// delay to allow time to pc to load driver (I think so)
HAL_Delay(1000);
while
(1)
{
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
HAL_Delay(50);
CDC_Transmit_FS(buf, 8);
}
}

If usb is connected to host during startup it's works. Even if i disconnect usb cable. My led blinking. But if usb cable is disconected the program freeze at line : CDC_Transmit_FS(buf, 8); have you any idea of what is the cause and how to fix it ? Thanks Attached is a zip of project with a Makefile for gcc. #stm32f4-cdc-acm-usb-cubemx
1 REPLY 1
ziz
Associate II
Posted on January 02, 2016 at 01:32

Hi,

finally

I use

libopencm3,

it works

perfectly

out of the box with gcc.