Why USB CDC on Boot is disabled by default

Hello, I am using IDE 2.3.7. Whenever this thing is disabled, nothing shows up on the Serial Monitor. Sometimes it gets disabled automatically after I enabled it. Is there a way to set it to be enabled all the time?

I would like to know as well.

Which board are you using? If you have a board with native USB, that is no separate USB chip such as CH340, then "USB CDC on boot" has to be enabled. If the board type that you have selected in the IDE exactly matches the characteristics of your board then "USB CDC on boot" should already have the correct setting. If you have chosen only a similar board, maybe because your exact board is not listed in the IDE, the you the problem that you have described.

The default setting is determined by the provider of the board package; e.g. Espressif.

You can change it in the boards.txt file (see https://support.arduino.cc/hc/en-us/articles/4415103213714-Find-sketches-libraries-board-cores-and-other-files-on-your-computer#boards where to find it).

In that file, find your board. E.g. for the ESP32C5 Dev Module

  1. Search the file for the name as you see it in the IDE; you will find esp32c5.name=ESP32C5 Dev Module
  2. Scroll down till you find esp32c5.menu.CDCOnBoot.default=Disabled
  3. Change that line to esp32c5.menu.CDCOnBoot.default=Enabled
  4. Save the file
  5. Repeat for other boards of interest.

You need to restart the IDE to make the change take effect.

Notes:

  1. Make sure to make a backup of the boards.txt file.
  2. Be aware that an update of the board package will wipe the changes that you have made.

[edit]Added second note