Closed ghost closed 7 years ago
Hi Michal,
Thanks for contributing this set of steps. We're very keen to make the Windows instructions as easy as possible, however it's not precisely clear to me in what way these steps are easier than the official getting started guide.
As a starting point, could you please explain to me the problems you've found with the existing Windows setup guide. I'd like to understand your motivations for writing this document. Then perhaps we can work through them together to find improvements.
Up to Section Two - Compiling And Flashing Applications step2. all seems to be OK.
When running step 2. "make menuconfig" following error shows up:
zconf.hash.c:166:1: error: conflicting types for ‘kconf_id_lookup’
kconf_id_lookup (register const char str, register size_t len)
^~~~~~~
zconf.hash.c:33:31: note: previous declaration of ‘kconf_id_lookup’ was here
static const struct kconf_id kconf_id_lookup(register const char *str, register unsigned int len);
Please help!
The suggestion to update gperf.git is no help!
@occamw in future, please open a new issue for an new/different error instead of commenting on an existing issue.
zconf.hash.c:33:31: note: previous declaration of ‘kconf_id_lookup’ was here static const struct kconf_id kconf_id_lookup(register const char str, register unsigned int len);
Please help!
The new gperf version 3.1 changed the type signature for ID lookup functions. There is a fix for this coming soon in esp-idf, but in the meantime you can entirely delete this line in zconf.gperf
(note this is in a different file to zconf.hash.c, which is autogenerated by gconf from this source file):
https://github.com/espressif/esp-idf/blob/master/tools/kconfig/zconf.gperf#L12
... and it should build correctly.
zconf.hash.c:33:31: note: previous declaration of ‘kconf_id_lookup’ was here This is fixed in the master branch as of 578e938.
Worked like a charm. Only issue I saw was having to run the build multiple times to get all the projects built. Seems to all have been built after all that. Thanks for the efforts Michael.
Hi @michal037 ,
I think the fixes in 5faee6a should take care of the problems you were describing here. If you think there is anything left which doesn't work smoothly with the Windows setup, please open a new issue and let us know about it.
Angus
The Windows setup from http://esp-idf.readthedocs.io/en/latest/windows-setup.html still not complete - at least not the pre-prepared environment. The make for the template project searches for python: _... CC bootloader_start.o AR libmain.a LD bootloader.elf /bin/sh: python: command not found make[1]: [/d/Sources/esp-idf/components/esptool_py/Makefile.projbuild:49: /d/Sources/esp-idf-template/build/bootloader/bootloader.bin] Error 127 make: [/d/Sources/esp-idf/components/bootloader/Makefile.projbuild:31: /d/Sources/esp-idf-template/build/bootloader/bootloader.bin] Error 2_
Tried to add the C:\msys32\mingw32\bin to %PATH% in the environment variables since there I have seen python but solved nothing.
@brownx there's a mistake in one of the steps, you need to run ...\msys32\mingw32.exe
not ...\msys32\msys_shell.cmd
. It was only changed in one place not both places in the docs.
Ref: https://github.com/espressif/esp-idf/issues/493#issuecomment-291690881
Documentation fix coming shortly.
@projectgus And it's not msys2.exe
neither. (ps: spend about 2h to figure this out)
Hi @Gfast2,
I'm very sorry to hear that. From what I can see it looks like msys2.exe was incorrectly mentioned in the first post in this issue.
Rather than using the user-submitted guide found above, please use our official documentation here:
http://esp-idf.readthedocs.io/en/latest/get-started/windows-setup.html
it's been improved significantly since this issue was first opened. I've added a note at the top of the issue with a link, as I'm guessing this is turning up in Google searches and the like (major thanks to @michal037 who originally contributed the above steps - a lot of the observations & suggestions shown there have been rolled into the official documentation.)
If you find any shortcomings in the official documentation, please open issues to report them - we'll gladly fix them.
@projectgus All right. Thank you all again for the effort behind the scene! I really appriciate! ps: Since I'd building some industrial level device based on ESP32 right now. Is there some list to showing sold production Product based on this chip?
It's seemingly we should open the mingw32.exe not msys2.exe while compiling and flashing on Windows.
@memory125 It was my mistake. I did not notice it then. That's why I tried to figure out why it does not work.
No worries, it works fine now.
Hi michal037, and thk thk thk thk thk a lot !!! If i not get your post i never will do my project start !!! Ir is very cool man, keep going !!! thk again :)
Hello Michal037,
I really liked your solution for setting up my ESP-IDF after failing to install properly with expressif website tutorials. Although your details are very well explained and documented with clear understanding, I am still not able to compile an app in my environment. The make all process just sits there all day long without compiling. In the end I have to just terminate the process.
Initially I tried to install everything manually and didn't succeed and then I tried to install with the long one off command set that you have provided. Before I tried the long command set, I reinstalled my MSYS2 32bit program in a different location on my Windows 7 32bit machine C:/msys2 directory without any space chars etc.
I am getting this error and don't know what to do. Any suggestions?
$ curl -sS https://raw.githubusercontent.com/michal037/VariousDestiny/master/esp32/esp32-autotoolchain-msys2.sh > /esp32-autotoolchain-msys2.sh && cd / && chmod +x esp32-autotoolchain-msys2.sh && ./esp32-autotoolchain-msys2.sh ./esp32-autotoolchain-msys2.sh: line 1: 404:: command not found
Many thanks
Hi @hussaa1 & @michal037 ,
Maybe look for a mailing list (if it exists)? To get advice on how to fix it right now.
We don't have a mailing list but there is an active forum: https://esp32.com/
@hussaa1, if following the Get Started Guide for the version of ESP-IDF that you're using is not working then please post there with some details about what you've done and what error(s) you see, and someone should be able to help.
Note that in ESP-IDF V4.0 and newer, we no longer require or recommend MSYS2/MINGW32 for Windows users - the Get Started steps will guide you through a different installation method.
(Note: this material refers to an older version of IDF. Current Windows setup documentation can be found at http://esp-idf.readthedocs.io/en/latest/get-started/windows-setup.html )
Section One - Creating The Environment
I present to you the simplest method, according to me.
Download MSYS2 installer from:
https://msys2.github.io
I made all steps on the 32-bit version. I don't test 64-bit MSYS2, You can check at your own risk. (Possible errors) File name:msys2-i686-20161025.exe
Install MSYS2 where You want, but be careful! NEVER USE SPACE CHAR IN THE FILES PATH. After the installation is complete. You can run MSYS2 from setup wizard or msys32/msys2.exe program.
If you do not want to do the rest manually, paste and run this command in MSYS2 console and go to the section two. This option provides additional useful features.
Now, you must update your MSYS2. Write these commands. Becouse MSYS2 have got
pacman
package manager, I used it. If the program asks for approval, typet
. You MUST write these 3 commands!pacman -Sy pacman
pacman -Syu
pacman -Su
Write in MSYS2 console:
Now you must join to
msys32/home
directory, in your windows. In my case, localisation is:C:\msys32\home
Now is time to download several files.windows_install_prerequisites.sh
script from this localisation:https://raw.githubusercontent.com/espressif/esp-idf/master/tools/windows/windows_install_prerequisites.sh
get-pip.py
from:https://bootstrap.pypa.io/get-pip.py
https://github.com/pyserial/pyserial/releases
If you download another version, remember to change some commands where pyserial is.Save this three files to
msys32/home
directory.version 2.7
. Write in MSYS2 console this:pacman -S python2
and typet
, if program ask you about it.VERY IMPORTANT: you must change Python name. from:
python2.7.exe
orpython2.exe
topython.exe
.For compatibility, write this in MSYS2 console:
You need
tar
program, for unpack the files. Write this in MSYS2 console:pacman -S tar
and typet
for true.Now you must run some scripts for the installation of the necessary files. Write this commands:
After all, You must see it:
Once ESP-IDF is downloaded/checked out, set the environment variable IDF_PATH in /etc/profile to point to the directory.
cd /home rm get-pip.py rm pyserial-3.2.1.tar.gz rm -rf pyserial-3.2.1/ rm windows_install_prerequisites.sh
cd /home git clone --recursive https://github.com/espressif/esp-idf.git git clone https://github.com/espressif/esp-idf-template.git
cd /home/esp-idf chmod +x add_path.sh echo "export IDF_PATH=\"/home/esp-idf\"" >> /etc/profile.d/esp32_toolchain.sh echo "cd /home/esp-idf" >> /etc/profile.d/esp32_toolchain.sh echo ". add_path.sh > /dev/null" >> /etc/profile.d/esp32_toolchain.sh echo "cd /home" >> /etc/profile.d/esp32_toolchain.sh echo "echo \"MSYS2 console for ESP32\"" >> /etc/profile.d/esp32_toolchain.sh
To flash all build output, run 'make flash' or: python /home/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/esp-idf-template/build/bootloader/bootloader.bin 0x10000 /home/esp-idf-template/build/app-template.bin 0x8000 /home/esp-idf-template/build/partitions_singleapp.bin
0x1000 /home/esp-idf-template/build/bootloader/bootloader.bin 0x10000 /home/esp-idf-template/build/app-template.bin 0x8000 /home/esp-idf-template/build/partitions_singleapp.bin