How to auto open usb port after restart?

Hi

I am testing <InstallFolder>\examples\peripheral\usbd_cdc_acm project,   when I use serial tool of pc to open port, it can send or receive data.

but if I don't want to use serial tool of pc,   I  use app_usbd_cdc_acm_write() to send data out directly after restart,  and it runs here 

if (!dtr_state)
{
/*Port is not opened*/
return NRF_ERROR_INVALID_STATE;
}

, it shows port not opened.   Could somebody help me , please?

Parents Reply Children
No Data
Related