Project

General

Profile

A glitch in flash uploading in new version

Added by Supachai Vorapojpisut about 2 months ago

Issue:
Flash uploading failed in Simulink as in the attached screenshot. But when copy command to execute in command prompt, then execution is ok. I have checked and found that the Simulink version used "-b 460800" that may be the problem.

Hardware
M5StickC (ESP32-PICO-D4) already used in Waijung 22.4a without problem.

Environment:
  • MATLAB 2022a
  • Waijung 22.4b

Model:
Just target setup and GPIO digital out.

Log output (failed case in Simulink)

[2/3] cmd.exe /C "cd /D C:\waijung2\targets\esp32\setup\esp_idf\components\esptool_py && C:\waijung2\targets\esp32\setup\.espressif\tools\cmake\3.20.3\bin\cmake.exe -D IDF_PATH="C:/waijung2/targets/esp32/setup/esp_idf" -D SERIAL_TOOL="C:/waijung2/targets/esp32/setup/.espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe C:/waijung2/targets/esp32/setup/esp_idf/components/esptool_py/esptool/esptool.py --chip esp32" -D SERIAL_TOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/vsupa/Desktop/Projects/testM5StickC_waijung2/testM5StickC_waijung2_esp32_build_system/build" -P C:/waijung2/targets/esp32/setup/esp_idf/components/esptool_py/run_serial_tool.cmake" 
esptool.py esp32 -p COM7 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 bootloader/bootloader.bin 0x10000 waijung2_esp32.bin 0x8000 partition_table/partition-table.bin
esptool.py v3.2-dev
Serial port COM7
Connecting....
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 94:b9:7e:ab:34:24
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
A fatal error occurred: No serial data received.
CMake Error at run_serial_tool.cmake:56 (message):
  C:/waijung2/targets/esp32/setup/.espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe
  C:/waijung2/targets/esp32/setup/esp_idf/components/esptool_py/esptool/esptool.py
  --chip esp32 failed
FAILED: CMakeFiles/flash

Log output (OK in command prompt)

C:\Users\vsupa>cmd.exe /C "cd /D C:\waijung2\targets\esp32\setup\esp_idf\components\esptool_py && C:\waijung2\targets\esp32\setup\.espressif\tools\cmake\3.20.3\bin\cmake.exe -D IDF_PATH="C:/waijung2/targets/esp32/setup/esp_idf" -D SERIAL_TOOL="C:/waijung2/targets/esp32/setup/.espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe C:/waijung2/targets/esp32/setup/esp_idf/components/esptool_py/esptool/esptool.py --chip esp32" -D SERIAL_TOOL_ARGS="--before=default_reset --after=hard_reset write_flash @flash_args" -D WORKING_DIRECTORY="C:/Users/vsupa/Desktop/Projects/testM5StickC_waijung2/testM5StickC_waijung2_esp32_build_system/build" -P C:/waijung2/targets/esp32/setup/esp_idf/components/esptool_py/run_serial_tool.cmake" 
Note: C:/waijung2/targets/esp32/setup/.espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe C:/waijung2/targets/esp32/setup/esp_idf/components/esptool_py/esptool/esptool.py --chip esp32 will search for a serial port. To specify a port, set the ESPPORT environment variable.
Note: C:/waijung2/targets/esp32/setup/.espressif/python_env/idf4.4_py3.8_env/Scripts/python.exe C:/waijung2/targets/esp32/setup/esp_idf/components/esptool_py/esptool/esptool.py --chip esp32 will attempt to set baud rate automatically. To specify a baud rate, set the ESPBAUD environment variable.
esptool.py esp32 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 bootloader/bootloader.bin 0x10000 waijung2_esp32.bin 0x8000 partition_table/partition-table.bin
esptool.py v3.2-dev
Found 1 serial ports
Serial port COM7
Connecting....
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 94:b9:7e:ab:34:24
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00010000 to 0x00039fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 25296 bytes to 15812...
Writing at 0x00001000... (100 %)
Wrote 25296 bytes (15812 compressed) at 0x00001000 in 1.8 seconds (effective 113.9 kbit/s)...
Hash of data verified.
Compressed 169712 bytes to 89576...
Writing at 0x00010000... (16 %)
Writing at 0x0001b02b... (33 %)
Writing at 0x00020756... (50 %)
Writing at 0x00025fdd... (66 %)
Writing at 0x0002e5d7... (83 %)
Writing at 0x00036958... (100 %)
Wrote 169712 bytes (89576 compressed) at 0x00010000 in 8.4 seconds (effective 161.9 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 386.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...


Replies (3)

RE: A glitch in flash uploading in new version - Added by Supachai Vorapojpisut about 2 months ago

No issue with other boards (ESP32-D0WDQ6 and ESP32-WROOM). May be just the hardware I used.

RE: A glitch in flash uploading in new version - Added by Chandima Jayaneththi (จันทิมา) about 2 months ago

Hello Supachai,

Could you please attach the log message output with waijung2 22.4a. it will help us to investigate further with this issue.

Thank you.

Best regards,
Chandima.

RE: A glitch in flash uploading in new version - Added by Supachai Vorapojpisut about 2 months ago

It is my mistake since the board used with the previous Waijung 2 is another board. I have checked that M5StickC does not work with 2022.22c in Simulink mode, and work when copy command to execute in command prompt.

    (1-3/3)