我使用 CubeMX for USB VCP 为“stm32f103c8t6”生成了一个代码,当我添加“CDC_Transmit_FS”命令来发送数据时,windows10 无法识别该端口!我该怎么办?这是编译没有错误的代码:
#include "stm32f1xx_hal.h"
#include "usb_device.h"
#include "usbd_cdc_if.h"
int main(void)
{
uint8_t Text[] = "Hello\r\n";
while (1)
{
CDC_Transmit_FS(Text,6); /*when commented the port is recognized*/
HAL_Delay(1000);
}
}
Run Code Online (Sandbox Code Playgroud)