ARMmbed / ARMmbed/DAPLink

Config option to disable target reset on serial break

Open
#738 11 comments 0 reactions 0 assignees View on GitHub
discussion enhancement
Dominant language
C
Stars
2.8k
Forks
1.1k
Avg merge
3d 12h
Merged PRs (30d)
1

Description

Hi DAPLINK developers:

I am Alex from NXP.

In file: https://github.com/ARMmbed/DAPLink/blob/master/source/daplink/usb2uart/usbd_user_cdc_acm.c

I noticed that USB_CDC_ACM_SendBreak Implementation may not correct, it should not be reset target MCU:

```c
static U32 start_break_time = 0;
int32_t USBD_CDC_ACM_SendBreak(uint16_t dur)
{
uint32_t end_break_time;

// reset and send the unique id over CDC
if (dur != 0) {
start_break_time = os_time_get();
target_set_state(RESET_HOLD);
} else {
end_break_time = os_time_get();

// long reset -> send uID over serial (300 -> break > 3s)
if ((end_break_time - start_break_time) >= (300)) {
main_reset_target(1);
} else {
main_reset_target(0);
}
}

return (1);
}
```

see: https://man7.org/linux/man-pages/man3/tcsendbreak.3p.html

Contributor guide

Open the contributing guide

Research direction

Read source/daplink/usb2uart/usbd_user_cdc_acm.c, especially USBD_CDC_ACM_SendBreak, and trace how target reset is configured. Define the configuration path for disabling target reset on serial break, then verify that the setting preserves reset behavior when enabled and prevents it when disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.