Nucleo-L4R5ZI USB CDC
Dear All,
I would like to ask how to manage USB CDC on the nucleo-l4r5zi board. I would like to send data from a uC to the PC via USB.
The main function looks like that:
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_USB_DEVICE_Init();
uint8_t myBuf[] = "Hello World \r\n";
uint8_t stat;
while (1)
{
stat = CDC_Transmit_FS(myBuf, 12);
if(stat!=USBD_OK)
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_7);
HAL_Delay(500);
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_14);
}
}
The main problem is inside the function CDC_Transmit_FS(...), in line:
if (hcdc->TxState != 0)
{
return USBD_BUSY;
}
I do not know how to make the TxState 0.
I also removed SB193 and 195 from the board as it states in the ref manual of the board.
