Page 1 of 1

idf.py.exe has stopped working - when starting esp-idf command prompt

Posted: Thu Sep 05, 2019 2:15 pm
by willemjoosten
Installed the ESP IDF Tools using esp-idf-tools-setup-2.0 on Windows 7 (I know, old ;)) Everything went fine.

But when I open the ESP-IDF command prompt I get an error idf.py.exe stopped working. This is what I get in the command prompt:

Code: Select all

Using Python in C:\Users\willem\AppData\Local\Programs\Python\Python37\
Python 3.7.4
Using Git in C:\Program Files\Git\cmd\
git version 2.14.1.windows.1
IDF version does not include export.bat. Using the fallback version.
IDF version does not include tools\tools.json. Using the fallback version.
IDF version does not include tools\idf_tools.py. Using the fallback version.

Setting IDF_PATH: C:\Users\willem\Desktop\esp-idf-2

Adding ESP-IDF tools to PATH...
Not using an unsupported version of tool cmake found in PATH: 3.15.0. To use it,
 run 'C:\Users\willem\AppData\Local\Programs\Python\Python37\python.exe C:\espre
ssif\idf_tools_fallback.py --tools-json C:\espressif\tools_fallback.json export
--prefer-system'
I did some Googling on 'idf.py.exe' but did not find any information about this problem. Also pretty new to the ESP-IDF. So any help is appreciated. Is this a 'compiled' Python script? Can this be replaced (and where? some batch file?) by the Python script itself?

Re: idf.py.exe has stopped working - when starting esp-idf command prompt

Posted: Fri Sep 06, 2019 2:27 am
by ESP_Angus
Hi Willem,

idf.py.exe is a simple launcher .exe that runs "python idf.py". There's some description of it here:
https://github.com/espressif/esp-idf/tr ... ws/idf_exe

If it doesn't work then you can probably delete it and use "Python launcher" to run the .py file directly as mentioned in the README, however we'd like to figure out why it doesn't work.

Can you tell us anything else about your Windows 7 install? Any anti-virus or other protective software installed? Any other details you can tell us about the error message when it crashes?

Thanks,

Angus

Re: idf.py.exe has stopped working - when starting esp-idf command prompt

Posted: Sun Sep 08, 2019 11:07 am
by willemjoosten
Hi Angus,

Thanks a lot! Will apply the workaround later. For now:

I launched a debugger after the 'idf.py.exe has stopped working' dialog (no other information in this screen) and get "Unhandled exception at 0x74DCE082 (KernelBase.dll) in idf.py.exe: 0xC0000005: Access violation writing location 0x00000000." (No debug symbols installed so no further information)

I do have ESet antivirus. Turning real time protection off makes no difference however. Except for Windows Firewall there is no other security / protection software running.

Let me know if I can help by providing extra information or test things.

Thanks,
Willem

Re: idf.py.exe has stopped working - when starting esp-idf command prompt

Posted: Wed Sep 11, 2019 7:40 am
by ESP_Angus
Hi Willem,

Thanks for being patient. My colleague reminded me of this similar bug report:
https://github.com/espressif/esp-idf/issues/3740

If you download the "fixed" idf.py.exe from here and copy over your existing one, does it work?

We plan to release an updated IDF Tools installer with this fix, before the v4.0 final release.


Angus

Re: idf.py.exe has stopped working - when starting esp-idf command prompt

Posted: Tue Sep 17, 2019 12:09 pm
by willemjoosten
Hi Angus,

No worries, I'm never in a rush :)

No. The updated version did not solve the problem. BUT I found the cause of the problem while fiddling a bit with the program settings:

The program expects administrator privileges to run. When I run the program (as well as the ESP-IDF command prompt) as administror it works without any problems. Also when I change it to run in 'compatibility mode' as if were a Windows XP program, Windows prompts if the program should be allowed to make changes to the system (ie elevated privileges) and I when click 'Yes' it works fine.

So I guess you have to eigther sign the program so Windows sees it as a trusted application. Or make sure it is compiled in such a way it asks for these permissions.

Regard and have a nice day!
Willem

Re: idf.py.exe has stopped working - when starting esp-idf command prompt

Posted: Wed Sep 18, 2019 3:38 am
by ESP_igrr
Could you please add a bit more details, where the IDF Tools have been installed (i.e. what is the IDF_TOOLS_PATH), where your ESP-IDF directory is, and where the project directory is.

idf.py.exe and other tools do not normally need administrator privileges to run, so this indicates there is some misconfiguration. Also in our tests on Window 7 and Windows 10 there were no prompts related to digital signatures, aside from the one for the installer (which is now signed).

When you say
No. The updated version did not solve the problem.
is the error with the updated version the same as with the original version (0xC0000005: Access violation writing location 0x00000000)? If yes, is it possible that the original version of idf.py.exe is still being used somehow? You can run "where idf.py.exe" to check the install location, and then check that the file size at this location is 27648 bytes. If not, then somehow you are still using the original one.

Re: idf.py.exe has stopped working - when starting esp-idf command prompt

Posted: Wed Sep 18, 2019 1:08 pm
by willemjoosten
My bad! There were two installation directories... I replaced the tool in de other directory and everything works fine now!

Thanks.

(Will will also have my eyesight checked - when I run the script as the administrator I just get an error message '... from the ESP-IDF ...' which I mistook for succes... )