Closed rvbc1 closed 10 months ago
Ok, I found a workaround.
I added the following line to platformio.ini:
extra_scripts = pre:modify_upload.py
And created a "modify_upload.py" script:
Import("env")
def before_upload(source, target, env):
uploader_flags = env['UPLOADERFLAGS']
try:
index = uploader_flags.index('--flash_freq') + 1
uploader_flags[index] = 'keep'
except ValueError:
print("Not found '--flash_freq' in flags")
env.Replace(UPLOADERFLAGS=uploader_flags)
env.AddPreAction("upload", before_upload)
I discovered the "keep" parameter in the Arduino IDE upload command.
Hopefully, this workaround can help others until the upload command issue is resolved. ;)
@rvbc1 I have no H2 to test. So there is high chance there are maybe other bugs which only occurs with a real device connected. Will have a look into, probably similar as the changes needed for the C2. Can you post your used boards.json for the H2 and the Platformio env for?
Have you used the boards.json esp32-h2-devkitm-1
? If not the error is in your setup. There is an extra setting needed for the H2 -> img_freq
. This setting is provided in the H2 boards.json and it is implemented to use. There is still a chance i made a mistake here.
But without using the H2 boards json it will fail.
This is the commit https://github.com/Jason2866/platform-espressif32/commit/37cafcc4745c0764f931fa0c6a26596041ba58ba with the needed changes for the H2 (Adopted for Platformio as it is done for ArduinoIDE in platforms.txt).
The option keep
is a bad idea here, it can end in bootloops. The correct value needs to be provided.
Mhh, probably this needs to be changed everywhere https://github.com/Jason2866/platform-espressif32/blob/Arduino/IDF5/builder/main.py#L430
from "--flash_freq", "${__get_board_f_flash(__env__)}",
to "--flash_freq", "${__get_board_img_freq(__env__)}",
EDIT: Try
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/H2
board = esp32-h2-devkitm-1
framework = arduino
Hi,
Thank you so much for your help and dedication in solving this issue. I am indeed using the 'esp32-h2-devkitm-1' setup. After applying your suggested solution (platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/H2), the board programs without any issues. I am aware that the 'keep' parameter might not be the best choice, but I started my tests with this ESP32 H2 board, and while I could program it through the Arduino IDE, PlatformIO was not compatible, which is why I copied this parameter from there.
Thank you once again for your assistance! You mentioned that you do not have access to the H2 board, so if you ever need anything tested, just let me know. I have these boards in stock and would be happy to help out.
Thx, for testing will merge the changes in branch Arduino/IDF5
Hello,
I've been trying out your IDF5 branch and here's my configuration in platformio.ini:
Everything seems to be working fine so far (the code compiles), but I encounter an issue when trying to upload the firmware. Here's what I see:
In Arduino IDE 2.2.1 and Arduino 3.0.0-alpha2, the compilation and upload process both work fine. Could you possibly help me figure out how to fix this issue? Or could you guide me on where to adjust the settings for esptool to get this working correctly?