diff --git a/CMakeLists.txt b/CMakeLists.txt index 05a78e3..a98cf5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,7 +208,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Release) -DINPUT_libjpeg=no -DINPUT_libmd4c=no) elseif(CMAKE_SYSTEM_NAME STREQUAL Windows) - # Install Qt6 for host + # Install Qt6 for host using https://github.com/miurahr/aqtinstall find_package(Python3 REQUIRED COMPONENTS Interpreter) execute_process( COMMAND @@ -410,6 +410,8 @@ cpmaddpackage( GITHUB_REPOSITORY higaski/esp-serial-flasher GIT_TAG + # TODO actual tag once #103 got merged + # https://github.com/espressif/esp-serial-flasher/pull/103 928dd73850c2c2cd689ecdeb854afe7b2b159622 VERSION 1.3.0 @@ -458,7 +460,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Release) URL https://github.com/dejavu-fonts/dejavu-fonts/releases/download/version_2_37/dejavu-fonts-ttf-2.37.zip VERSION - ${ARG_VERSION} + 2.37 DOWNLOAD_ONLY TRUE) add_custom_command( @@ -528,7 +530,6 @@ if(CMAKE_BUILD_TYPE STREQUAL Release) -targetDir ${TARGET_DIR} # -verbose 3 # -platform win_x86_64 # - -icon ${CMAKE_CURRENT_SOURCE_DIR}/data/images/icon.ico # ) endif() diff --git a/README.md b/README.md index f522679..66fb4f1 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ It currently supports the following ESP microcontrollers: - [ESP32H2](https://www.espressif.com/en/products/socs/esp32-h2) - [ESP32C6](https://www.espressif.com/en/products/socs/esp32-c6) -### [Latest release](https://github.com/higaski/QtESPFlasher/releases/latest) -
Table of contents
    @@ -25,7 +23,7 @@ It currently supports the following ESP microcontrollers:
  1. Reset modes
  2. Disabling the stub loader
  3. Trace
  4. -
  5. Trace
  6. +
  7. Chip type
  8. Serial port
  9. Baud rate
  10. @@ -39,7 +37,7 @@ It currently supports the following ESP microcontrollers: ## Features - GUI flashes either - - an [esp-idf](https://github.com/espressif/esp-idf) build folder + - an [ESP-IDF](https://github.com/espressif/esp-idf) build directory - a [flasher_args.json](https://github.com/espressif/esp-idf/blob/master/components/esptool_py/flasher_args.json.in) file - a .zip archive - single/multiple loose binaries @@ -51,20 +49,21 @@ Most options are supported equally by CLI and GUI. The following table contains | Option | Description | | --------------- | --------------------------------------------------------------- | | `-c`, `--chip` | Target chip type | -| `-p`, `--port` | Serial port baud rate | +| `-p`, `--port` | Serial port device | +| `-b`, `--baud` | Serial port baud rate | | `--before` | What to do before connecting to the chip | | `-a`, `--after` | What to do after QtESPFlasher is finished | | `--no-stub` | Disable launching the flasher stub, only talk to ROM bootloader | | `-t`, `--trace` | Enable trace-level output of QtESPFlasher interactions | -| `-l`, `--list` | List all available serial interfaces | +| `-l`, `--list` | List all available serial devices | -The following screenshot shows the GUI options. +And this screenshot shows how the options are displayed in the GUI. ![options](data/images/options.png) ### Reset modes By default, QtESPFlasher tries to hard reset the chip into bootloader mode before it starts and hard resets the chip to run the normal program once it is complete. The `--before` and `--after` options allow this behavior to be changed. -#### Reset before operation +#### Reset before operation The `--before` argument allows you to specify whether the chip needs resetting into bootloader mode before QtESPFlasher talks to it. - `--before default_reset` is the default, which uses DTR & RTS serial control lines to try to reset the chip into bootloader mode. - `--before no_reset` will skip DTR/RTS control signal assignments and just start sending a serial synchronization command to the chip. This is useful if your chip doesn't have DTR/RTS, or for some serial interfaces (like Arduino board onboard serial) which behave differently when DTR/RTS are toggled. @@ -78,7 +77,7 @@ The `--after` argument allows you to specify whether the chip should be reset af The `--no-stub` option disables uploading of a software "stub loader" that manages flash operations, and only talks directly to the loader in ROM. ### Trace -QtESPFlasher has a `--trace` option which can be supplied in the first group of arguments (before the command). This will dump all traffic sent and received via the serial port to a log file next to the executable called `trace.txt`. +QtESPFlasher has a `--trace` option which can be supplied in the first group of arguments (before the command). This will dump all traffic sent and received via the serial port to a log file called `trace.txt` in the application root directory. ### Chip type The target chip type can be selected using the `-c`, `--chip` option. If no `-c` option is specified, QtESPFlasher automatically detects the chip type when connecting. @@ -87,7 +86,7 @@ The target chip type can be selected using the `-c`, `--chip` option. If no `-c` The serial port is selected using the `-p`, `--port` option. If no `-p` option is specified, QtESPFlasher will enumerate all connected serial ports and try each one until it finds an Espressif device connected. ### Baud rate -The default QtESPFlasher baud rate is 115200. Slower rates may be set using `-b`, `--baud`. It is recommend to only set the baud rate if you're experiencing transmission errors during flashing. If left at default QtESPFlasher tries to change the baud rate to 460800 when running. +The default QtESPFlasher baud rate is 115200. Slower rates may be set using `-b`, `--baud`. It is **recommend** to only set the baud rate if you're experiencing transmission errors during flashing. If left at default QtESPFlasher tries to change the baud rate to 460800 when running to considerably reduce flash times. ## Usage ### CLI @@ -126,11 +125,16 @@ Done ``` ### GUI -#### Add folder -![usage add dir](data/images/usage_add_dir.gif) +QtESPFlasher offers a few different ways to select binaries for flashing. -#### Add binaries -![usage add bin](data/images/usage_add_bin.gif) +#### Add directory +The build directory of an ESP-IDF project can be selected directly using the ![folder open](data/images/folder_open.png) symbol. ESP-IDF builds generate a file called flasher_args.json which contains project flash information in JSON format. This file is red by QtESPFlasher to obtain all of the projects binaries and their offsets. +![usage add dir](data/images/usage_add_dir.gif) #### Add .zip archive -![usage add zip](data/images/usage_add_zip.gif) \ No newline at end of file +A zipped ESP-IDF build directory can also be selected directly using the ![file](data/images/file.png) symbol. The .zip file must contain a flasher_args.json file, just like when adding a directory. +![usage add zip](data/images/usage_add_zip.gif) + +#### Add binaries +If there is no flasher_args.json file available, binaries can also be added directly. This is done by selecting .bin files with the ![file](data/images/file.png) symbol. Please note that in this case the offset must be entered **manually**. Offsets in the C language convention, such as “0x” for base 16 or “0b” for base 2, are supported. +![usage add bin](data/images/usage_add_bin.gif) \ No newline at end of file diff --git a/data/images/file.png b/data/images/file.png new file mode 100644 index 0000000..16a1b81 Binary files /dev/null and b/data/images/file.png differ diff --git a/data/images/folder_open.png b/data/images/folder_open.png new file mode 100644 index 0000000..b5f511e Binary files /dev/null and b/data/images/folder_open.png differ diff --git a/src/esp_flasher.cpp b/src/esp_flasher.cpp index 1fc4d21..fe5e2eb 100644 --- a/src/esp_flasher.cpp +++ b/src/esp_flasher.cpp @@ -509,7 +509,7 @@ void EspFlasher::transfer_debug_print(uint8_t const* data, if (_trace != "trace") return; static auto const log_path{ - QCoreApplication::applicationDirPath().toStdString() + "/trace.txt"}; + QCoreApplication::applicationDirPath().toStdString() + "/../trace.log"}; static auto fd{fopen(log_path.c_str(), "w")}; static gsl::final_action close{[&fd] { fclose(fd); }};