Device Firmware Upgrade via USB on ESP32-S3

4okoboko
Posts: 7
Joined: Wed Nov 16, 2022 7:54 am

Device Firmware Upgrade via USB on ESP32-S3

Postby 4okoboko » Wed Jun 21, 2023 8:40 pm

Hello, I am trying to flash a custom-made PCB with ESP32-S3 via USB following the description under https://docs.espressif.com/projects/esp ... s/dfu.html.

I have the electrical connections as described, i.e.
20 --> D+ (green)
19 --> D- (white)

Ca. 2 months ago, I managed to flash the ESP32-S3 via USB several times by simply navigating to my "bleprph" example project folder and then running from the command line the following command :
/home/boko/.espressif/python_env/idf5.1_py3.10_env/bin/python /home/boko/esp/esp-idf/tools/idf.py dfu dfu-flash

Now, I can't. When I try the same command, it fails with the following error messages:

Code: Select all

~/Desktop/ESP32/esp32_spraykit/bleprph$ /home/boko/.espressif/python_env/idf5.1_py3.10_env/bin/python /home/boko/esp/esp-idf/tools/idf.py dfu
Setting IDF_PATH environment variable: /home/boko/esp/esp-idf
Adding "dfu"'s dependency "all" to list of commands with default set of options.
Executing action: all (aliases: build)
Running cmake in directory /home/boko/Desktop/ESP32/esp32_spraykit/bleprph/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/boko/.espressif/python_env/idf5.1_py3.10_env/bin/python -DESP_PLATFORM=1 -DIDF_TARGET=esp32s3 -DCCACHE_ENABLE=0 /home/boko/Desktop/ESP32/esp32_spraykit/bleprph"...
-- Found Git: /usr/bin/git (found version "2.34.1") 
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: xtensa-esp32s3-elf-gcc
CMake Error at /home/boko/esp/esp-idf/tools/cmake/project.cmake:342 (__project):
  The CMAKE_C_COMPILER:

    xtensa-esp32s3-elf-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
  CMakeLists.txt:9 (project)


CMake Error at /home/boko/esp/esp-idf/tools/cmake/project.cmake:342 (__project):
  The CMAKE_CXX_COMPILER:

    xtensa-esp32s3-elf-g++

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
  CMakeLists.txt:9 (project)


CMake Error at /home/boko/esp/esp-idf/tools/cmake/project.cmake:342 (__project):
  The CMAKE_ASM_COMPILER:

    xtensa-esp32s3-elf-gcc

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.
Call Stack (most recent call first):
  CMakeLists.txt:9 (project)


-- Warning: Did not find file Compiler/-ASM
-- Configuring incomplete, errors occurred!
See also "/home/boko/Desktop/ESP32/esp32_spraykit/bleprph/build/CMakeFiles/CMakeOutput.log".
See also "/home/boko/Desktop/ESP32/esp32_spraykit/bleprph/build/CMakeFiles/CMakeError.log".
HINT: Try to reinstall the toolchain for the chip that you trying to use. 
For more information run 'idf.py docs -sp get-started/#installation' and follow the instructions for your system
cmake failed with exit code 1, output of the command is in the /home/boko/Desktop/ESP32/esp32_spraykit/bleprph/build/log/idf_py_stderr_output_76127 and /home/boko/Desktop/ESP32/esp32_spraykit/bleprph/build/log/idf_py_stdout_output_76127
boko@hp-elitebook-850-g8:~/Desktop/ESP32/esp32_spraykit/bleprph$
I can see from the messages that "C compiler / CXX compiler / ASM compiler identification" are unknown to CMake, but before trying to make any changes, I wanted to first ask if I need to set something else up before running the "idf.py dfu" command, as it worked ca. 2 months ago without any further settings.

Trying to set the target by typing in the command line

Code: Select all

/home/boko/.espressif/python_env/idf5.1_py3.10_env/bin/python /home/boko/esp/esp-idf/tools/idf.py set-target esp32s3
fails with the same errors.

Any help or hint about how to solve the issue would be appreciated :-)

P.S. I can build and flash via UART the same project, so the C compiler and ASM compiler issue does not manifest via UART, only via USB.

nochkin
Posts: 8
Joined: Tue Jun 20, 2023 5:04 am

Re: Device Firmware Upgrade via USB on ESP32-S3

Postby nochkin » Tue Jun 27, 2023 3:54 pm

cmake can't find xtensa-esp32s3-elf-gcc binary in your PATH.
Make sure xtensa-esp32s3 compiler is installed. If it's, then you need to add its bin directory to your PATH. If you need to keep it permanent, you will need to put it in .bashrc/.bash_profile or similar file depending on the shell you use.
To verify you've done it correctly, you can just run:

Code: Select all

xtensa-esp32s3-elf-gcc --version
If you see the version output, then you are set.

Another option is to set CC, CXX, ASM env variables, but I think it's easier to have it in PATH.

Who is online

Users browsing this forum: Bing [Bot] and 69 guests