Hi
I checked the SDK reference that you are using.
In
USB_DeviceCdcVcomCallback()
in fsl_component_serial_port_usb.c there is a case that handles the line state:
case kUSB_DeviceCdcEventSetControlLineState:
It handles the state with (I think it calls it DTE with reference as an input since it is DTR):
if (0U != (acmInfo->dteStatus & (uint8_t)USB_DEVICE_CDC_CONTROL_SIG_BITMAP_DTE_PRESENCE))
{
/* DTE_ACTIVATED */
if (1U == serialUsbCdc->attach)
{
serialUsbCdc->startTransactions = 1U; <---- allows the code to operate
}
}
else
{
/* DTE_DEACTIVATED */
if (1U == serialUsbCdc->attach)
{
serialUsbCdc->startTransactions = 0U; <---- causes the code to spin forever on a semaphore
}
}
and if it is set to 0 serialUsbCdc->startTransactions is set to 0 and the result is that the code spins in a wait loop on a semaphore called _debugConsoleReadWaitSemaphore in GetChar() so nothing is done (apart from handling USB interrupts).
If you set
serialUsbCdc->startTransactions = 1U;
in both cases it is then insensitive to the DTR state and so will always operate.
Regards
Mark