Skip to content

getchar() hangs in RELEASE compiling mod, not in DEBUG compiling mode #363

@martinkooij

Description

@martinkooij

In my repo https://github.com/martinkooij/pi-pico-getchar there is a short bit of code showing a program that hangs when entering characters via getchar().

The use of this call causes the pico to hang at random, but mostly before having entered 10 characters. This happens when compiled in RELEASE mode.

  • When using the -DCMAKE_BUILD_TYPE=Debug flag in CMake it does work flawlessly.
  • When explicitly using a tight loop with getchar_timeout_us(0) it also works without problem.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions