Skip to content

Freezing at boot #2322

Answered by earlephilhower
HamzaHajeir asked this question in Q&A
Aug 8, 2024 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

You're using undefined C++ behavior with the global constructor, and things are going pear shaped. C++ does not specify which order global constructors are called. Your struct s is trying to use Serial before it is created and well before USB is actually configured by the main() routine. Move the constructor to a method and call that method from setup().

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@HamzaHajeir
Comment options

@earlephilhower
Comment options

@HamzaHajeir
Comment options

@earlephilhower
Comment options

@HamzaHajeir
Comment options

Answer selected by HamzaHajeir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants