Disabling flowcontrol on cdc-acm-uart for nrf52840 in zephyr

I am trying to use the UART over the onboard USB without flow-control.

I'm currently using a Seeed XIAO_BLE whose bootloader initializes the USB port.

I have a simple example:

int main(void)
{
        console_init();
        uint64_t count = 0; 
        char str[256];
        while(1) {
                sprintf(str, "Uptime: %lld %lld\r\n", k_uptime_get(), count);
                //printk("%s", str);
                console_write(NULL, str, strlen(str));
                count++;
        }
        return 0;
}

when I run this, the code stalls until I connect a terminal program to the TTY.  If I disconnect the TTY, it stalls again.

I've tried disabling flow-control in the overlay:

&usb_cdc_acm_uart {
  /delete-property/ hw-flow-control;
};

When I use GDB, and query the flow_ctrl value in cdc_acm_dev_data_t, I see it is set.

If I set CONFIG_UART_USE_RUNTIME_CONFIGURE=y, then when I query thr flow_ctrl value it is 0, but the behavior of stalling doesn't change.

printk() can print to the TTY without blocking, so I know it is possible to achieve, but my efforts so far have failed.

I'd rather not use printk() directly, as ideally I'l redirect printk() over the segger RTT interface, so my app can exclusively use the CDC ACM UART.

Related