mkttanabe / Esp32PlainImageToFlashEncBoard

A Tool to Import ESP32 plain flash partition images to the Flash-Encryption mode board
MIT License
1 stars 0 forks source link

The tool will not run (python2 or 3) #1

Open LusterWong opened 3 years ago

LusterWong commented 3 years ago

HI,

I have an Arduino program that needs to be encrypted and download to target board(WEB OTA will be needed later). I don't know IDF, it's too complicated. I've been looking for FLASH encryption, but the official documentation doesn't understand it yet.Come across the tool you provide and try it out.

I use Windows, the PY file has been modified and used in py2 and Py3 environment, the serial port connection is ok, but the operation prompts error, I do not understand the reason of the error.

After the device connection is successful, the command line to perform "F:\python Esp32PlainImageToFlashEncBoard. py", obtain the following information.

ESP32: Connect the source board and press any key
Please wait..
Traceback (most recent call last):
  File "F:\Esp32PlainImageToFlashEncBoard.py", line 255, in <module>
    v = getFlashCryptCount()
  File "F:\Esp32PlainImageToFlashEncBoard.py", line 204, in getFlashCryptCount
    result = subprocess.check_output(cmd)
  File "C:\Users\Luster\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\Luster\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\Luster\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\Luster\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1416, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 Not a valid Win32 application.

After the command was executed, the serial light flashed and the device restarted (I used ESP Prog). Did I do something wrong? It's nice to finally have someone pay attention to developing FLASH encryption for ESP32 using Arduino,

LusterWong commented 3 years ago
ESP32: Connect the source board and press any key
Please wait..
Traceback (most recent call last):
  File "Esp32PlainImageToFlashEncBoard.py", line 255, in <module>
    v = getFlashCryptCount()
  File "Esp32PlainImageToFlashEncBoard.py", line 206, in getFlashCryptCount
    result = subprocess.check_output(cmd)
  File "C:\Python27\lib\subprocess.py", line 212, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "C:\Python27\lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 640, in _execute_child
    startupinfo)
WindowsError: [Error 193] %1 Not a valid Win32 application.

This is the result of running python2.