Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SETUP EP0 intermittently overwrites CDC data EP #4

Open
majbthrd opened this issue Jul 9, 2019 · 0 comments
Open

SETUP EP0 intermittently overwrites CDC data EP #4

majbthrd opened this issue Jul 9, 2019 · 0 comments

Comments

@majbthrd
Copy link
Owner

majbthrd commented Jul 9, 2019

This issue may afflict users who implement multiple serial ports AND open and close one of those ports whilst one or more others are open.

Intermittently (seemingly during heavy traffic), an outgoing (PC to device) EP0 USB SETUP message somehow corrupts some of the data in an IN (device to PC) endpoint associated with CDC data.

The test setup is a STM32F072 DISCOVERY running the stock firmware. PA9 is jumper-ed to PA10 (first UART) and PC4 is jumper-ed to PC5 (second UART).

Attached is C source code for a command-line test utility. Two instances are run, such as:

./cdcloop /dev/ttyACM0
./cdcloop /dev/ttyACM1

On one of the instances (nominally the second), the user uses Ctrl-C to terminate the program and then runs it again. The user then repeats this until there is a "mismatch error" on the first instance.

Per the USB sniffer screenshot, the contents of the SETUP message at 0:54.246.463 previously appear earlier in time at 0:54:245.652 in the CDC data associated with first UART (EP1).

cdc3

It is not apparent how the message seemingly travels back in time, and user options (such as PMA memory mapping) have been exhausted. What is left is the domain of the ST stack. In addition to v1.2.1, I've tried the v1.5 stack, and this has the same behavior.

cdcloop.c.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant