Skip to content

arduino-cli USB CDC enable function requirement #1869

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

Closed
3 tasks done
yoyojacky opened this issue Sep 8, 2022 · 2 comments
Closed
3 tasks done

arduino-cli USB CDC enable function requirement #1869

yoyojacky opened this issue Sep 8, 2022 · 2 comments
Assignees
Labels
type: support OT: Request for help using the project

Comments

@yoyojacky
Copy link

Describe the request

I want to enable or disable ESP32-C3 module which is from DFRobot, and it works well under arduino-cli, but once i use arduino-cli monitor -p /dev/ttyACM0 there is no output, after searching and discussing with my friends , he said we need to enable USB CDC during flashing the chip, but i can not find the way to add parameter's about enabling USB CDC.

Describe the current behavior

It is works well under arduino-cli, but once i use arduino-cli monitor -p /dev/ttyACM0 there is no output, after searching and discussing with my friends , he said we need to enable USB CDC during flashing the chip, but i can not find the way to add parameter's about enabling USB CDC.

Arduino CLI version

0.26.0-> 0.27.1

Operating system

Linux

Operating system version

Debian 11 Bullseye 64bit on Raspberry Pi 4B

Additional context

No response

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the nightly build
  • My request contains all necessary details
@yoyojacky yoyojacky added the type: enhancement Proposed improvement label Sep 8, 2022
@per1234 per1234 self-assigned this Sep 8, 2022
@per1234
Copy link
Contributor

per1234 commented Sep 8, 2022

Hi @yoyojacky. Custom board options such as "USB CDC On Boot" are set via the FQBN you pass to arduino-cli commands via the --fqbn flag.

The format of the FQBN is like this:

<vendor ID>:<architecture>:<board ID>[:<menu ID>=<option ID>[,<menu ID>=<option ID>]...]

You can learn all the available menu IDs and option IDs for a given board by running the following command:

arduino-cli board details --fqbn <FQBN>

(where <FQBN> is replaced by the fully qualified board name of the board you are using)

For example if you are using the "ESP32C3 Dev Module" board (FQBN: esp32:esp32:esp32c3):

$ ./arduino-cli board details -b esp32:esp32:esp32c3
Board name:            ESP32C3 Dev Module
FQBN:                  esp32:esp32:esp32c3
Board version:         2.0.4

Package name:          esp32
Package maintainer:    Espressif Systems
Package URL:           https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json    
Package website:       https://github.com/espressif/arduino-esp32
Package online help:   http://esp32.com

Platform name:         esp32
Platform category:     ESP32
Platform architecture: esp32
Platform URL:          https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esp32-2.0.4.zip
Platform file name:    esp32-2.0.4.zip
Platform size (bytes): 259715595
Platform checksum:     SHA-256:832609d6f4cd0edf4e471f02e30b7f0e1c86fdd1b950990ef40431e656237214

Required tool:         esp32:riscv32-esp-elf-gcc                                            gcc8_4_0-esp-2021r2-patch3

Required tool:         esp32:xtensa-esp32-elf-gcc                                           gcc8_4_0-esp-2021r2-patch3

Required tool:         esp32:xtensa-esp32s2-elf-gcc                                         gcc8_4_0-esp-2021r2-patch3

Required tool:         esp32:xtensa-esp32s3-elf-gcc                                         gcc8_4_0-esp-2021r2-patch3

Required tool:         esp32:esptool_py                                                     3.3.0

Required tool:         esp32:mkspiffs                                                       0.2.3

Required tool:         esp32:mklittlefs                                                     3.0.0-gnu12-dc7f933

Option:                USB CDC On Boot                                                                                 CDCOnBoot
                       Disabled                                                             ✔                          CDCOnBoot=default
                       Enabled                                                                                         CDCOnBoot=cdc
Option:                Partition Scheme                                                                                PartitionScheme
                       Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)                     ✔                          PartitionScheme=default
                       Default 4MB with ffat (1.2MB APP/1.5MB FATFS)                                                   PartitionScheme=defaultffat
                       8M Flash (3MB APP/1.5MB FAT)                                                                    PartitionScheme=default_8MB
                       Minimal (1.3MB APP/700KB SPIFFS)                                                                PartitionScheme=minimal
                       No OTA (2MB APP/2MB SPIFFS)                                                                     PartitionScheme=no_ota
                       No OTA (1MB APP/3MB SPIFFS)                                                                     PartitionScheme=noota_3g
                       No OTA (2MB APP/2MB FATFS)                                                                      PartitionScheme=noota_ffat
                       No OTA (1MB APP/3MB FATFS)                                                                      PartitionScheme=noota_3gffat
                       Huge APP (3MB No OTA/1MB SPIFFS)                                                                PartitionScheme=huge_app
                       Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)                                                PartitionScheme=min_spiffs
                       16M Flash (2MB APP/12.5MB FAT)                                                                  PartitionScheme=fatflash
                       16M Flash (3MB APP/9MB FATFS)                                                                   PartitionScheme=app3M_fat9M_16MB
                       RainMaker                                                                                       PartitionScheme=rainmaker
Option:                CPU Frequency                                                                                   CPUFreq
                       160MHz (WiFi)                                                        ✔                          CPUFreq=160
                       80MHz (WiFi)                                                                                    CPUFreq=80
                       40MHz                                                                                           CPUFreq=40
                       20MHz                                                                                           CPUFreq=20
                       10MHz                                                                                           CPUFreq=10
Option:                Flash Mode                                                                                      FlashMode
                       QIO                                                                  ✔                          FlashMode=qio
                       DIO                                                                                             FlashMode=dio
                       QOUT                                                                                            FlashMode=qout
                       DOUT                                                                                            FlashMode=dout
Option:                Flash Frequency                                                                                 FlashFreq
                       80MHz                                                                ✔                          FlashFreq=80
                       40MHz                                                                                           FlashFreq=40
Option:                Flash Size                                                                                      FlashSize
                       4MB (32Mb)                                                           ✔                          FlashSize=4M
                       8MB (64Mb)                                                                                      FlashSize=8M
                       2MB (16Mb)                                                                                      FlashSize=2M
                       16MB (128Mb)                                                                                    FlashSize=16M
Option:                Upload Speed                                                                                    UploadSpeed
                       921600                                                               ✔                          UploadSpeed=921600
                       115200                                                                                          UploadSpeed=115200
                       256000                                                                                          UploadSpeed=256000
                       230400                                                                                          UploadSpeed=230400
                       512000                                                                                          UploadSpeed=512000
Option:                Core Debug Level                                                                                DebugLevel
                       None                                                                 ✔                          DebugLevel=none
                       Error                                                                                           DebugLevel=error
                       Warn                                                                                            DebugLevel=warn
                       Info                                                                                            DebugLevel=info
                       Debug                                                                                           DebugLevel=debug
                       Verbose                                                                                         DebugLevel=verbose
Programmers:           Id                                                                   Name
                       esptool                                                              Esptool

Here we can see that the ID for the "USB CDC On Boot" menu is CDCOnBoot and the ID for the "Enabled" option is cdc.

So the full FQBN is:

esp32:esp32:esp32c3:CDCOnBoot=cdc

If you have any additional questions about using Arduino CLI, feel free to post on the dedicated Arduino Forum section here:

https://forum.arduino.cc/c/software/arduino-cli/89

More information about custom board options here:

https://arduino.github.io/arduino-cli/latest/platform-specification/#custom-board-options

And about setting them via the FQBN here:

https://arduino.github.io/arduino-cli/latest/FAQ/#how-to-set-multiple-board-options

We are tracking the need to better document the FQBN format here:

#355

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 8, 2022
@per1234 per1234 added type: support OT: Request for help using the project and removed type: enhancement Proposed improvement labels Sep 8, 2022
@yoyojacky
Copy link
Author

Hi @yoyojacky. Custom board options such as "USB CDC On Boot" are set via the FQBN you pass to arduino-cli commands via the --fqbn flag.

The format of the FQBN is like this:

<vendor ID>:<architecture>:<board ID>[:<menu ID>=<option ID>[,<menu ID>=<option ID>]...]

You can learn all the available menu IDs and option IDs for a given board by running the following command:

arduino-cli board details --fqbn <FQBN>

(where <FQBN> is replaced by the fully qualified board name of the board you are using)

For example if you are using the "ESP32C3 Dev Module" board (FQBN: esp32:esp32:esp32c3):

$ ./arduino-cli board details -b esp32:esp32:esp32c3
Board name:            ESP32C3 Dev Module
FQBN:                  esp32:esp32:esp32c3
Board version:         2.0.4

Package name:          esp32
Package maintainer:    Espressif Systems
Package URL:           https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json    
Package website:       https://github.com/espressif/arduino-esp32
Package online help:   http://esp32.com

Platform name:         esp32
Platform category:     ESP32
Platform architecture: esp32
Platform URL:          https://github.com/espressif/arduino-esp32/releases/download/2.0.4/esp32-2.0.4.zip
Platform file name:    esp32-2.0.4.zip
Platform size (bytes): 259715595
Platform checksum:     SHA-256:832609d6f4cd0edf4e471f02e30b7f0e1c86fdd1b950990ef40431e656237214

Required tool:         esp32:riscv32-esp-elf-gcc                                            gcc8_4_0-esp-2021r2-patch3

Required tool:         esp32:xtensa-esp32-elf-gcc                                           gcc8_4_0-esp-2021r2-patch3

Required tool:         esp32:xtensa-esp32s2-elf-gcc                                         gcc8_4_0-esp-2021r2-patch3

Required tool:         esp32:xtensa-esp32s3-elf-gcc                                         gcc8_4_0-esp-2021r2-patch3

Required tool:         esp32:esptool_py                                                     3.3.0

Required tool:         esp32:mkspiffs                                                       0.2.3

Required tool:         esp32:mklittlefs                                                     3.0.0-gnu12-dc7f933

Option:                USB CDC On Boot                                                                                 CDCOnBoot
                       Disabled                                                             ✔                          CDCOnBoot=default
                       Enabled                                                                                         CDCOnBoot=cdc
Option:                Partition Scheme                                                                                PartitionScheme
                       Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)                     ✔                          PartitionScheme=default
                       Default 4MB with ffat (1.2MB APP/1.5MB FATFS)                                                   PartitionScheme=defaultffat
                       8M Flash (3MB APP/1.5MB FAT)                                                                    PartitionScheme=default_8MB
                       Minimal (1.3MB APP/700KB SPIFFS)                                                                PartitionScheme=minimal
                       No OTA (2MB APP/2MB SPIFFS)                                                                     PartitionScheme=no_ota
                       No OTA (1MB APP/3MB SPIFFS)                                                                     PartitionScheme=noota_3g
                       No OTA (2MB APP/2MB FATFS)                                                                      PartitionScheme=noota_ffat
                       No OTA (1MB APP/3MB FATFS)                                                                      PartitionScheme=noota_3gffat
                       Huge APP (3MB No OTA/1MB SPIFFS)                                                                PartitionScheme=huge_app
                       Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)                                                PartitionScheme=min_spiffs
                       16M Flash (2MB APP/12.5MB FAT)                                                                  PartitionScheme=fatflash
                       16M Flash (3MB APP/9MB FATFS)                                                                   PartitionScheme=app3M_fat9M_16MB
                       RainMaker                                                                                       PartitionScheme=rainmaker
Option:                CPU Frequency                                                                                   CPUFreq
                       160MHz (WiFi)                                                        ✔                          CPUFreq=160
                       80MHz (WiFi)                                                                                    CPUFreq=80
                       40MHz                                                                                           CPUFreq=40
                       20MHz                                                                                           CPUFreq=20
                       10MHz                                                                                           CPUFreq=10
Option:                Flash Mode                                                                                      FlashMode
                       QIO                                                                  ✔                          FlashMode=qio
                       DIO                                                                                             FlashMode=dio
                       QOUT                                                                                            FlashMode=qout
                       DOUT                                                                                            FlashMode=dout
Option:                Flash Frequency                                                                                 FlashFreq
                       80MHz                                                                ✔                          FlashFreq=80
                       40MHz                                                                                           FlashFreq=40
Option:                Flash Size                                                                                      FlashSize
                       4MB (32Mb)                                                           ✔                          FlashSize=4M
                       8MB (64Mb)                                                                                      FlashSize=8M
                       2MB (16Mb)                                                                                      FlashSize=2M
                       16MB (128Mb)                                                                                    FlashSize=16M
Option:                Upload Speed                                                                                    UploadSpeed
                       921600                                                               ✔                          UploadSpeed=921600
                       115200                                                                                          UploadSpeed=115200
                       256000                                                                                          UploadSpeed=256000
                       230400                                                                                          UploadSpeed=230400
                       512000                                                                                          UploadSpeed=512000
Option:                Core Debug Level                                                                                DebugLevel
                       None                                                                 ✔                          DebugLevel=none
                       Error                                                                                           DebugLevel=error
                       Warn                                                                                            DebugLevel=warn
                       Info                                                                                            DebugLevel=info
                       Debug                                                                                           DebugLevel=debug
                       Verbose                                                                                         DebugLevel=verbose
Programmers:           Id                                                                   Name
                       esptool                                                              Esptool

Here we can see that the ID for the "USB CDC On Boot" menu is CDCOnBoot and the ID for the "Enabled" option is cdc.

So the full FQBN is:

esp32:esp32:esp32c3:CDCOnBoot=cdc

If you have any additional questions about using Arduino CLI, feel free to post on the dedicated Arduino Forum section here:

https://forum.arduino.cc/c/software/arduino-cli/89

More information about custom board options here:

https://arduino.github.io/arduino-cli/latest/platform-specification/#custom-board-options

And about setting them via the FQBN here:

https://arduino.github.io/arduino-cli/latest/FAQ/#how-to-set-multiple-board-options

We are tracking the need to better document the FQBN format here:

#355

Thank you very much!!! It works!!! you are my god.... thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: support OT: Request for help using the project
Projects
None yet
Development

No branches or pull requests

2 participants