Skip to content

pico_stdio_usb silently drops data being sentΒ #995

@AlexApps99

Description

@AlexApps99

I'm using fwrite() to stdout to implement a protobuf message protocol for a project over USB CDC.
When I send enough data at once, some bytes are silently lost.

Either:

  • there needs to be a way to properly check when data is being dropped rather than sent (the fwrite API already returns the number of bytes written, but it's improperly returned by the SDK)
  • there needs to be a blocking API created, that guarantees all data is sent
  • the current API needs to be made blocking until all data is sent

The obvious solution is to return the correct number of bytes to _write, and by extension fread.

Simply dropping data is not acceptable in nearly all applications, and there is no documentation on this, which led me to spend a frustrating amount of time debugging the issue. Nobody would reasonably expect this behavior for all but the simplest of text logging.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions