DTR signal needs to be activated from terminal program

Open
#32 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
embedded-iot

Research direction

Start with cdc_uart.c and inspect where tud_cdc_connected() controls host transmission; compare it with the TinyUSB cdc_device.h and cdc_device.c references in the issue. Done means terminal output is available when TinyUSB is ready without requiring DTR, while preserving the existing CDC behavior.

Written by the indexing model from the issue text.

Description

Problem:

tud_cdc_connected is using DTR bit which is used in cdc_uart.c If DTR is not set by host (PC terminal or other device), we can't send anything to host.

same issue with #906, #921, #932

I don't think its necessary to check DTR as discussed in here -> hathach/tinyusb

Until user open the serial port, data buffer will be overridden.

src/class/cdc/cdc_device.h

static inline bool tud_cdc_connected (void)
{
  return tud_cdc_n_connected(0);
}

src/class/cdc/cdc_device.h

bool tud_cdc_n_connected(uint8_t itf)
{
  // DTR (bit 0) active  is considered as connected
  return tud_ready() && tu_bit_test(_cdcd_itf[itf].line_state, 0);
}
how to fix

change tud_cdc_connected() with tud_ready()

Dominant language
C
Stars
1.2k
Forks
363
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/debugprobe

All issues in raspberrypi/debugprobe

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.