Esp32_2_Mini compiler port fail

For general Flowcode discussion that does not belong in the other sections.
medelec35
Valued Contributor
Posts: 2367
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 745 times
Been thanked: 808 times

Re: Esp32_2_Mini compiler port fail

Post by medelec35 »

If it won't compile unless you hold it down, then what about letting go as soon as the first mention of Writing, e.g Writing at 0x00001000... (14 %)
Martin

jgu1
Posts: 943
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 863 times
Been thanked: 210 times

Re: Esp32_2_Mini compiler port fail

Post by jgu1 »

I'll continue on my little project later today Martin, regardless, you would always have heard from me ;)

UPDATE: Hi Martin

I think there might be a slight misunderstanding (English is not my native language, as I'm Danish) :lol: .

Initially, when I compiled, I didn't notice the progress percentage counting up (10%, 20%, etc.). I only focused on the end result showing an error message, so I assumed the compilation/flashing had failed completely because of lines like this at the end:

Running ninja in directory C:\FC_ESP_5.3\mtxesp32_s2_sdkconfig\build

Executing "ninja flash"...

Programming Failed.

C:\ProgramData\MatrixTSL\FlowcodeV11\FCD\ESP\Batch\esp32_prog.bat reported error code 0x1

Autoclose turned off

FINISHED

However, it turns out the ESP32-S2 actually gets programmed 100% fine and works perfectly! That is what confuses me—the program reaches the board successfully, but the console still reports "Programming Failed" at the very end.

I also just tried your suggestion of holding down the BOOT button, but it gave the exact same result: the error message still appears, even though the ESP is programmed correctly and runs as expected.

Thanks again for helping!

Best regards,

Jørgen

jgu1
Posts: 943
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 863 times
Been thanked: 210 times

Re: Esp32_2_Mini compiler port fail

Post by jgu1 »

Well, I ask AI :lol: :lol: Hope that´s ok. and here is the answer.


Exactly why the board works 100% fine even though Flowcode reports "Programming Failed"!

Here is what is actually happening:

Upload completes 100%: When Flowcode calls esptool.py, the entire binary is successfully flashed onto the ESP32-S2 memory first.

The issue occurs during the final reset: Once the upload reaches 100%, esptool attempts to issue a hard reset command over USB to restart the chip (--after hard_reset).

Lost COM connection: Because the script uses COM_AUTODETECT, the tool loses the USB serial connection at the exact millisecond the ESP32-S2 resets its internal USB interface.

False error reported: Since esptool doesn't receive a clean closing response from the virtual serial port during the reset, it exits with error code 0x1. Flowcode sees this exit code and displays "Programming Failed"—even though the code was fully written and is running perfectly.

So it turns out to be a purely cosmetic error at the very last step of the flashing sequence. Everything is working as it should on the hardware side!

I live with that, no problem, and only for the ESP-S2, maybe also an info for other Flowcode user :D

Best regards

Jorgen

BenR
Matrix Staff
Posts: 2267
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 625 times
Been thanked: 832 times

Re: Esp32_2_Mini compiler port fail

Post by BenR »

It could just be this warning being elevated to an error, even though programming itself was flawless.
WARNING: ESP32-S2FNR2 (revision v0.0) chip was placed into download mode using GPIO0.
esptool.py can not exit the download mode over USB. To run the app, reset the chip manually.
To suppress this note, set --after option to 'no_reset'.

Post Reply