Page 1 of 1

How do you set the flashing baud rate in Visual Studio Code?

Posted: Sat Jun 20, 2020 8:23 pm
by aestetix
In VSCode how do you set the -b parameter when esptool.py is called to set the baud rate?

It defaults to 115200 which is rather slow and I can't see where to change it.

Re: How do you set the flashing baud rate in Visual Studio Code?

Posted: Mon Jun 29, 2020 4:13 pm
by rennix.io
Don't worry, this is an easy fix... on VSC go to the bottom left corner settings gear icon (the bigger icon, not the one on the bottom bar), it will open a tab for settings. On the top search bar, "Search Settings" you can search baud then you'll be graced with Idf: Baud Rate where you can change this setting here.

Re: How do you set the flashing baud rate in Visual Studio Code?

Posted: Tue Jul 07, 2020 1:07 pm
by aestetix
Thanks but unfortunately that doesn't work.

In the configuration the only options for "baud" are "idf.py monitor baud rate" and "UART console baud rate".

If I change the idf.py monitor baud rate it flashes at 115200 but then switches to the higher rate for the monitor. The UART console baud rate has no effect.

Re: How do you set the flashing baud rate in Visual Studio Code?

Posted: Tue Jul 28, 2020 2:55 am
by jgustavoam
Hi,
With this command
idf.py

See this parameter :


-b, --baud INTEGER Baud rate for flashing. This option can be used at most once either globally, or for one subcommand.

Code: Select all

C:\Users\jgust\esp-idf>idf.py --help
Checking Python dependencies...
Python requirements from C:\Users\jgust\esp-idf\requirements.txt are satisfied.
Usage: C:\Users\jgust\esp-idf\tools\idf.py [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

  ESP-IDF build management

Options:
  -C, --project-dir PATH          Project directory.
  -B, --build-dir PATH            Build directory.
  -n, --no-warnings               Disable Cmake warnings.
  -v, --verbose                   Verbose build output.
  --ccache / --no-ccache          Use ccache in build. Disabled by default, unless IDF_CCACHE_ENABLE environment
                                  variable is set to a non-zero value.

  -G, --generator [Ninja|MinGW Makefiles]
                                  CMake generator.
  -D, --define-cache-entry TEXT   Create a cmake cache entry. This option can be used at most once either globally, or
                                  for one subcommand.

  -b, --baud INTEGER              Baud rate for flashing. This option can be used at most once either globally, or for
                                  one subcommand.

  -p, --port TEXT                 Serial port. This option can be used at most once either globally, or for one
                                  subcommand.

  --help                          Show this message and exit.

Commands:
  all                    Aliases: build. Build the project.
  app                    Build only the app.
  app-flash              Flash the app only.
  bootloader             Build only bootloader.
  bootloader-flash       Flash bootloader only.
  clean                  Delete build output files from the build directory.
  confserver             Run JSON configuration server.
  efuse_common_table     Genereate C-source for IDF's eFuse fields.
  efuse_custom_table     Genereate C-source for user's eFuse fields.
  encrypted-app-flash    Flash the encrypted app only.
  encrypted-flash        Flash the encrypted project.
  erase_flash            Erase entire flash chip.
  erase_otadata          Erase otadata partition.
  flash                  Flash the project.
  fullclean              Delete the entire build directory contents.
  menuconfig             Run "menuconfig" project configuration tool.
  monitor                Display serial output.
  partition_table        Build only partition table.
  partition_table-flash  Flash partition table only.
  read_otadata           Read otadata partition.
  reconfigure            Re-run CMake.
  show_efuse_table       Print eFuse table.
  size                   Print basic size information about the app.
  size-components        Print per-component size information.
  size-files             Print per-source-file size information.

C:\Users\jgust\esp-idf>

Re: How do you set the flashing baud rate in Visual Studio Code?

Posted: Tue Jul 28, 2020 7:53 am
by aestetix
I noticed this in the tasks.json file:

Code: Select all

"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} -b ${config:idf.baudRate} flash",
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} -b ${config:idf.baudRate} monitor",
So it's using the same

Code: Select all

config:idf.baudRate
for both flashing and monitoring. First thing would be to separate those two so that you don't have to run the monitor at the same speed as the flasher.

What's strange is that the config option affects the monitor baud rate but not the flasher baud rate... Unless it does affect the flasher and it's just that you can't flash faster than you can at 115200 baud due to the bootloader being slow or something. Maybe I can get a scope on there to see what the actual rate is.