ESP8266 Compiling with xtensa-freertos lazarus / 77-Embedded ---------------------------------------------------------------------- af0815 · 2022-01-01 16:47 I have created a crosscompiler for xtensa and the lx106 (ESP8266). But i am not able to compile a hello world. Exactly the compiling will work, but not the linking. Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i @echo onset IDF_PATH=C:\data\esp\ESP8266_RTOS_SDKcd C:\data\lazdev\xtensa\projects C:\data\lazdev\xtensa\fpc\bin\i386-win32\ppcrossxtensa -va -Furtl/units/xtensa-freertos/ -Tfreertos -XPxtensa-lx106-elf- -O3 -Wpesp8266 HelloWorld2.lpr -Fl~/esp/xtensa-lx106-elf-libs/ -FlC:\data\esp\ESP8266_RTOS_SDK\components/esp8266/lib -FlC:\data\esp\ESP8266_RTOS_SDK/components/newlib/newlib/lib -Fl~/esp/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/ pause My SDK is under c:\data\esp, not c.\esp to hold my root clean. If i try my HelloWorld2.lpr to compile i get the following message. Quote.... [1.521] Searching file C:\data\lazdev\xtensa\cross\lib\xtensa- freertos\lx106\libstdc++.a... found [1.523] Searching file C:\data\lazdev\xtensa\cross\lib\xtensa- freertos\lx106\libpthread.a... found [1.527] Searching file C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-gcc.exe... found [1.528] Using util C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-gcc.exe [1.529] Executing "C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-gcc.exe -C -P -x c -E -o /esp8266_out.ld -I / /components/esp8266/ld/esp8266.ld" using comspec "C:\WINDOWS\system32\cmd.exe" [1.530] Executing "C:\WINDOWS\system32\cmd.exe" with command line " /C C:\data\lazdev\xtensa\cross\bin\xtensa-freertos\bin\xtensa-lx106-elf- gcc.exe -C -P -x c -E -o /esp8266_out.ld -I / /components/esp8266/ld/esp8266.ld" xtensa-lx106-elf-gcc.exe: error: /components/esp8266/ld/esp8266.ld: No such file or directory xtensa-lx106-elf-gcc.exe: warning: '-x c' after last input file has no effect xtensa-lx106-elf-gcc.exe: fatal error: no input files compilation terminated. [1.589] HelloWorld2.lpr(13,24) Error: Error while linking [1.593] Searching file C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-objdump.exe... found [1.594] Using util C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-objdump.exe [1.595] Searching file HelloWorld2.o... found [1.596] Searching file HelloWorld2.o... found ..... Maybe i have not given all need information to the crosscompiler. But i created my HelloWorld according the  wiki https://wiki.lazarus.freepascal.org/Xtensa point 1.2.4 to test my crosscompiler. Any hints how to get this working? ---------------------------------------------------------------------- bobihot · 2022-01-01 18:21 I currently work with him. But the new one is with core RISK-V and may be good to transfer to him ---------------------------------------------------------------------- af0815 · 2022-01-01 18:50 Quote from: bobihot on January 01, 2022, 07:21:41 pmI currently work with him. But the new one is with core RISK-V and may be good to transfer to him which is 'him' ? I am talking about ESP8266 - not him (or her) ---------------------------------------------------------------------- trev · 2022-01-01 22:10 Dial back the attitude mate. The previous poster, who was trying to help you and whose grasp of English pronouns or translation software may not be perfect, was suggesting that the new ESP8266s have RISK-V cores which may or may not help you. ---------------------------------------------------------------------- engkin · 2022-01-01 23:46 Quoteerror: /components/esp8266/ld/esp8266.ld: No such file or directory Sounds like a wrong path. Maybe confused between backslash and frontslash? ---------------------------------------------------------------------- af0815 · 2022-01-02 08:06 Quote from: engkin on January 02, 2022, 12:46:24 amQuoteerror: /components/esp8266/ld/esp8266.ld: No such file or directory Sounds like a wrong path. Maybe confused between backslash and frontslash? I think it is not confused by backslah/frontslash. I think its more a 'hidden' missing enviroment variable. One indication i have found in the wiki with IDF_PATH. But i think another internal information is missing. @trev and bobihot: Sorry for misunderstanding. I am also a not native speaker and have my troubles with the translation (sometime with google too). I have no indication that the esp8166 have risc-v. I f you mean other chips from expressif maybe. But this should only end in a wrong objectfile, but not in such a compiler message. BTW @trev: Dial back the attitude mate -> is not understandable by me. google translate give me a nonsense message in my native language back. ---------------------------------------------------------------------- af0815 · 2022-01-02 13:25 If i compile with the option -sh Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i @echo onset IDF_PATH=C:\data\esp\ESP8266_RTOS_SDKcd C:\data\lazdev\xtensa\projects C:\data\lazdev\xtensa\fpc\bin\i386-win32\ppcrossxtensa -sh -Furtl/units/xtensa-freertos/ -Tfreertos -XPxtensa-lx106-elf- -O1 -Wpesp8266 HelloWorld2.lpr -Fl~/esp/xtensa-lx106-elf-libs/ -FlC:\data\esp\ESP8266_RTOS_SDK\components/esp8266/lib -FlC:\data\esp\ESP8266_RTOS_SDK/components/newlib/newlib/lib -Fl~/esp/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/lib/ pause i get a ppas.bat file with the following content Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i @echo offSET THEFILE=helloworld2echo Assembling %THEFILE%C:\data\lazdev\xtensa\cross\bin\xtensa-freertos\bin\xtensa- lx106-elf-as.exe -o HelloWorld2.o  HelloWorld2.s --longcallsif errorlevel 1 goto asmendrem Del HelloWorld2.sSET THEFILE=HelloWorld2echo Linking %THEFILE%C:\data\lazdev\xtensa\cross\bin\xtensa-freertos\bin\xtensa- lx106-elf-gcc.exe -C -P -x c -E -o /esp8266_out.ld -I / C:\data\esp\ESP8266_RTOS_SDK/components/esp8266/ld/esp8266.ld.... in the line, where gcc is called, i get a error. QuoteC:\data\lazdev\xtensa\projects>echo Linking HelloWorld2 Linking HelloWorld2 C:\data\lazdev\xtensa\projects>C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-gcc.exe -C -P -x c -E -o /esp8266_out.ld -I / C:\data\esp\ESP8266_RTOS_SDK/components/esp8266/ld/esp8266.ld xtensa-lx106-elf-gcc.exe: error: CreateProcess: No such file or directory C:\data\lazdev\xtensa\projects>if errorlevel 1 goto linkend1 What will he compile ?! I think i am missing here something. Any hint ? ---------------------------------------------------------------------- engkin · 2022-01-02 13:41 Run the problematic line in a terminal, and give it the same slash to eliminate the possibility of wrong slash. ---------------------------------------------------------------------- engkin · 2022-01-02 14:56 If you share the files produced by FPC, I can give it a shot. I already have xtensa SDK. ---------------------------------------------------------------------- ccrause · 2022-01-02 16:10 Quote from: af0815 on January 02, 2022, 09:06:10 amQuote from: engkin on January 02, 2022, 12:46:24 amQuoteerror: /components/esp8266/ld/esp8266.ld: No such file or directory Sounds like a wrong path. Maybe confused between backslash and frontslash? I think it is not confused by backslah/frontslash. I think its more a 'hidden' missing enviroment variable. One indication i have found in the wiki with IDF_PATH. But i think another internal information is missing. This may be a Windows specific compiler bug  The path to esp8266.ld is supposed to start with the project exe output folder, which in this case appears to be empty/unspecified.  Do you see other compiler generated files such as Kconfig or kconfig.in etc in your project folder? As a test, please adding the following to you compiler command: Code: [Select]-FEc:\somefolder\HelloWorldThen report which files end up in this folder during the whole build process. ---------------------------------------------------------------------- ccrause · 2022-01-02 16:33 Quote from: af0815 on January 01, 2022, 05:47:49 pmCode: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i set IDF_PATH=C:\data\esp\ESP8266_RTOS_SDK For information, you can also use the command line option -Ff to pass the SDK path to the compiler as alternative to setting IDF_PATH as environment variable.  This makes it a little easier to compile from inside Lazarus... ---------------------------------------------------------------------- af0815 · 2022-01-02 16:58 Quote from: ccrause on January 02, 2022, 05:10:06 pmAs a test, please adding the following to you compiler command: Code: [Select]-FEc:\somefolder\HelloWorldThen report which files end up in this folder during the whole build process. I have inserted the whole project after the run of test.cmd with all files. In test.cmd is the call for the compiler. ---------------------------------------------------------------------- ccrause · 2022-01-02 17:48 Quote from: af0815 on January 02, 2022, 05:58:48 pmQuote from: ccrause on January 02, 2022, 05:10:06 pmAs a test, please adding the following to you compiler command: Code: [Select]-FEc:\somefolder\HelloWorldThen report which files end up in this folder during the whole build process. I have inserted the whole project after the run of test.cmd with all files. In test.cmd is the call for the compiler. Thanks, at least adding -FE seemed to have fixed the path to esp8266_out.ld:Code: [Select]C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-gcc.exe -C -P -x c -E -o C:\data\lazdev\xtensa\projects\/esp8266_out.ld ... Can you run the ppas.bat and see how far you get?  I'm not sure if Windows will complain about the \/ combination in the path.  If you still get an error when executing this line, try formatting slashes into proper Windows format. This can be fixed in the compiler. Do you know the date of the compiler source code used to build your cross compiler (i.e. when was the compiler source pulled from git)?  There were a couple of changes around November that may impact your situation. ---------------------------------------------------------------------- af0815 · 2022-01-02 18:11 QuoteLazarus 2.3.0 (rev main-2_3-586-ga9457c2f2b) FPC 3.3.1 i386-win32-win32/win64 FPC: git log commit 116c861af6c13f6d3d0d0d91b6dc4e0c1eb88550 (HEAD -> main, origin/main, origin/HEAD) Author: J. Gareth "Curious Kit" Moreton Date:   Mon Dec 27 16:18:13 2021 +0000     MOV/CMP optimisation is now in both Pass 1 and Pass 2 to catch more     eventualities Actual output from ppas.bat (with echo on) as attachment Edit: the correction of the slashes have no effect But i have looked at "-I C:\data\lazdev\xtensa\projects\" - the option -I is not found if i ask the help from the cross-gcc ---------------------------------------------------------------------- ccrause · 2022-01-02 20:00 Quote from: af0815 on January 02, 2022, 07:11:30 pmQuoteLazarus 2.3.0 (rev main-2_3-586-ga9457c2f2b) FPC 3.3.1 i386-win32-win32/win64 FPC: git log commit 116c861af6c13f6d3d0d0d91b6dc4e0c1eb88550 (HEAD -> main, origin/main, origin/HEAD) Author: J. Gareth "Curious Kit" Moreton Date:   Mon Dec 27 16:18:13 2021 +0000 OK, that is recent enough. QuoteActual output from ppas.bat (with echo on) as attachment Edit: the correction of the slashes have no effectThe following error seems to indicate there is still a file missing: xtensa-lx106-elf- gcc.exe: error: CreateProcess: No such file or directory.  Or at least a file that is not located in any of the search directories that gcc knows.  Or perhaps that gcc cannot create the output file?  Just to confirm, do you get the same error message when the slashes are corrected? QuoteBut i have looked at "-I C:\data\lazdev\xtensa\projects\" - the option -I is not found if i ask the help from the cross-gcc -I is a standard gcc option. It may not be obvious from the command line help.  Try just plain Code: [Select]xtensa-lx106-elf-gcc.exe -IThis should say like the following: Quotextensa-lx106-elf-gcc: error: missing path after '-I' ---------------------------------------------------------------------- ccrause · 2022-01-02 20:25 You can also add -v to the gcc command in ppas.bat to see more details: Code: [Select]C:\data\lazdev\xtensa\projects>C:\data\lazdev\xtensa\cro ss\bin\xtensa-freertos\bin\xtensa-lx106-elf-gcc.exe -v -C -P -x c -E -o C:\data\lazdev\xtensa\projects\/esp8266_out.ld -I C:\data\lazdev\xtensa\projects\/ C:\data\esp\ESP8266_RTOS_SDK/components/esp8266/ld/esp8266.ld ---------------------------------------------------------------------- af0815 · 2022-01-02 20:37 As i said, correction of the slashes did not change the errormessage for me. The message came from xtensa-lx106-elf-gcc.exe itself. The reason for me to use the -sh option, is to detect the error on commandline direct. in the meanwhile i have inserted the -v QuoteC:\data\lazdev\xtensa\projects>C:\data\lazdev\xtensa\cross\bin\xt ensa-freertos\bin\xtensa-lx106-elf-gcc.exe -v -C -P -x c -E -o C:\data\lazdev\xtensa\projects\esp8266_out.ld -I C:\data\lazdev\xtensa\projects\ C:\data\esp\ESP8266_RTOS_SDK/components/esp8266/ld/esp8266.ld Using built-in specs. COLLECT_GCC=C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-gcc.exe Target: xtensa-lx106-elf Configured with: /builds/idf/crosstool- NG/.build/HOST-i686-w64-mingw32/xtensa-lx106-elf/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=i686-host_w64-mingw32 --target=xtensa-lx106-elf --prefix=/builds/idf/crosstool- NG/builds/xtensa-lx106-elf --with-local-prefix=/builds/idf/crosstool- NG/builds/xtensa-lx106-elf/xtensa-lx106-elf --with- headers=/builds/idf/crosstool-NG/builds/xtensa-lx106-elf/xtensa- lx106-elf/include --with-newlib --enable-threads=no --disable-shared --with-pkgversion='crosstool-NG esp-2020r3-49-gd5524c1' --disable- __cxa_atexit --enable-cxx-flags=-ffunction-sections --disable-libgomp --disable-libmudflap --disable-libmpx --disable-libssp --disable- libquadmath --disable-libquadmath-support --with- gmp=/builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa- lx106-elf/buildtools/complibs-host --with-mpfr=/builds/idf/crosstool- NG/.build/HOST-i686-w64-mingw32/xtensa-lx106-elf/buildtools/complibs- host --with-mpc=/builds/idf/crosstool- NG/.build/HOST-i686-w64-mingw32/xtensa-lx106-elf/buildtools/complibs- host --with-isl=/builds/idf/crosstool- NG/.build/HOST-i686-w64-mingw32/xtensa-lx106-elf/buildtools/complibs- host --enable-lto --enable-target-optspace --without-long-double-128 --disable-nls --enable-multiarch --enable-languages=c,c++ --disable- libstdcxx-verbose --enable-threads=posix --enable-libstdcxx-time=yes Thread model: posix gcc version 8.4.0 (crosstool-NG esp-2020r3-49-gd5524c1) COLLECT_GCC_OPTIONS='-v' '-C' '-P' '-E' '-o' 'C:\data\lazdev\xtensa\projects\esp8266_out.ld' '-I' 'C:\data\lazdev\xtensa\projects\'  cc1 -E -quiet -C -v -I C:\data\lazdev\xtensa\projects\ -P -iprefix c:\data\lazdev\xtensa\cross\bin\xtensa-freertos\bin\../lib/gcc/xtensa- lx106-elf/8.4.0/ C:\data\esp\ESP8266_RTOS_SDK/components/esp8266/ld/esp8266.ld -o C:\data\lazdev\xtensa\projects\esp8266_out.ld xtensa-lx106-elf-gcc.-iprefix c:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\../lib/gcc/xtensa-lx106-elf/8.4.0/exe: error: CreateProcess: No such file or directoryOne line is interesting. Quote-iprefix c:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\../lib/gcc/xtensa-lx106-elf/8.4.0/exeI think this line produces the error ---------------------------------------------------------------------- af0815 · 2022-01-02 20:42 The dir QuoteC:\data\lazdev\xtensa\cross\bin\xtensa- freertos\libexec\gcc\xtensa-lx106-elf\8.4.0 exist without exe dir. Quotec:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\../lib/gcc/xtensa-lx106-elf/8.4.0/exe is a miracle. ---------------------------------------------------------------------- ccrause · 2022-01-02 21:03 Quote from: af0815 on January 02, 2022, 09:37:58 pmAs i said, correction of the slashes did not change the errormessage for me. The message came from xtensa-lx106-elf-gcc.exe itself. The reason for me to use the -sh option, is to detect the error on commandline direct. in the meanwhile i have inserted the -v QuoteC:\data\lazdev\xtensa\projects>C:\data\lazdev\xtensa\cross\bin\xt ensa-freertos\bin\xtensa-lx106-elf-gcc.exe -v -C -P -x c -E -o C:\data\lazdev\xtensa\projects\esp8266_out.ld -I C:\data\lazdev\xtensa\projects\ C:\data\esp\ESP8266_RTOS_SDK/components/esp8266/ld/esp8266.ld Using built-in specs. COLLECT_GCC=C:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\xtensa-lx106-elf-gcc.exe Target: xtensa-lx106-elf Configured with: /builds/idf/crosstool- NG/.build/HOST-i686-w64-mingw32/xtensa-lx106-elf/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=i686-host_w64-mingw32 --target=xtensa-lx106-elf --prefix=/builds/idf/crosstool- NG/builds/xtensa-lx106-elf --with-local-prefix=/builds/idf/crosstool- NG/builds/xtensa-lx106-elf/xtensa-lx106-elf --with- headers=/builds/idf/crosstool-NG/builds/xtensa-lx106-elf/xtensa- lx106-elf/include --with-newlib --enable-threads=no --disable-shared --with-pkgversion='crosstool-NG esp-2020r3-49-gd5524c1' --disable- __cxa_atexit --enable-cxx-flags=-ffunction-sections --disable-libgomp --disable-libmudflap --disable-libmpx --disable-libssp --disable- libquadmath --disable-libquadmath-support --with- gmp=/builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa- lx106-elf/buildtools/complibs-host --with-mpfr=/builds/idf/crosstool- NG/.build/HOST-i686-w64-mingw32/xtensa-lx106-elf/buildtools/complibs- host --with-mpc=/builds/idf/crosstool- NG/.build/HOST-i686-w64-mingw32/xtensa-lx106-elf/buildtools/complibs- host --with-isl=/builds/idf/crosstool- NG/.build/HOST-i686-w64-mingw32/xtensa-lx106-elf/buildtools/complibs- host --enable-lto --enable-target-optspace --without-long-double-128 --disable-nls --enable-multiarch --enable-languages=c,c++ --disable- libstdcxx-verbose --enable-threads=posix --enable-libstdcxx-time=yes Thread model: posix gcc version 8.4.0 (crosstool-NG esp-2020r3-49-gd5524c1) COLLECT_GCC_OPTIONS='-v' '-C' '-P' '-E' '-o' 'C:\data\lazdev\xtensa\projects\esp8266_out.ld' '-I' 'C:\data\lazdev\xtensa\projects\'  cc1 -E -quiet -C -v -I C:\data\lazdev\xtensa\projects\ -P -iprefix c:\data\lazdev\xtensa\cross\bin\xtensa-freertos\bin\../lib/gcc/xtensa- lx106-elf/8.4.0/ C:\data\esp\ESP8266_RTOS_SDK/components/esp8266/ld/esp8266.ld -o C:\data\lazdev\xtensa\projects\esp8266_out.ld xtensa-lx106-elf-gcc.-iprefix c:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\../lib/gcc/xtensa-lx106-elf/8.4.0/exe: error: CreateProcess: No such file or directoryOne line is interesting. Quote-iprefix c:\data\lazdev\xtensa\cross\bin\xtensa- freertos\bin\../lib/gcc/xtensa-lx106-elf/8.4.0/exeI think this line produces the error That is interesting indeed. Not sure how to fix that.  I checked with my setup on Linux, but the cross-gcc version is much older (5.2.0) and the output looks quite a bit different. A way to skip all the hassle of recreating the linker scripts is to copy the original linker scripts generated when building the example project into the library folder.  The original scripts are esp8266_out.ld and esp8266.project.ld.  Find these in the original SDK example build folder (in my case it is in the build/esp8266 folder, together with libesp8266.a) and copy into the same destination folder as the other libraries. In your case it should go into C:\data\lazdev\xtensa\cross\lib\xtensa-freertos\lx106\ (I assume this is where libesp8266.a and other libraries are saved). If the compiler can locate these scripts (it searches in the library folders list) it will not try to regenerate them, avoiding this troublesome gcc call and also the following ldgen.py script. ---------------------------------------------------------------------- af0815 · 2022-01-07 08:33 Due the troubles with compiling under Linux - https://forum.lazarus.fr eepascal.org/index.php?topic=57725.msg429858;topicseen#msg429858 - i will suspend my test. If it works under Linux, i will test it with Linux too and than think about windows. ---------------------------------------------------------------------- ccrause · 2022-01-07 10:56 I tried configuring Windows 10 Personal according to the instructions given by Espressif, but I cannot get python to work in the msys2 environment.  Can you perhaps give your steps to get to the point of building a SDK example? Specifically getting a command environment where one can execute make to compile a SDK example.  After that I can start testing on Windows. Regarding Linux, I have compiled and tested all these examples with esp8266-rtos-sdk v3.3 and some with v3.4 on an esp8266 board (with the exception of one or two esp32 specific projects).  If anything doesn't work, it is only a matter of finding out what configuration setting is different from a working setup and fixing that.  Unfortunately there are a number of different tools and libraries involved, so it sometimes isn't easy to identify a problem. ---------------------------------------------------------------------- af0815 · 2022-01-08 07:21 Actual i have removed the whole msys2 installation. As i remember i have used pacman. I have found a hint here https://stackoverflow.com/questions/50784367/how-to-install-python- development-tools-on-msys2 Edit: I'm setuping this new - BUT the python is included in the MSYS2 installation from espressif. Quote$ pacman -Qs python local/mingw-w64-i686-python2 2.7.15-2     A high-level scripting language (mingw-w64) local/mingw-w64-i686-python2-appdirs 1.4.3-3     A small Python module for determining appropriate platform- specific dirs,     e.g. a "user data dir" (mingw-w64) local/mingw-w64-i686-python2-asn1crypto 0.24.0-2     Python ASN.1 library with a focus on performance and a pythonic API     (mingw-w64) local/mingw-w64-i686-python2-cachecontrol 0.12.5-1     httplib2 caching for requests (mingw-w64) local/mingw-w64-i686-python2-certifi 2018.8.24-1     Python package for providing Mozilla's CA Bundle (mingw-w64) local/mingw-w64-i686-python2-cffi 1.11.5-2     Foreign Function Interface for Python calling C code (mingw-w64) local/mingw-w64-i686-python2-chardet 3.0.4-2     Python2 module for character encoding auto-detection (mingw-w64) local/mingw-w64-i686-python2-colorama 0.3.9-3     Python API for cross-platform colored terminal text (mingw-w64) local/mingw-w64-i686-python2-cryptography 2.3.1-1     A package designed to expose cryptographic recipes and primitives to Python     developers (mingw-w64) local/mingw-w64-i686-python2-distlib 0.2.7-1     Low-level components of distutils2/packaging (mingw-w64) local/mingw-w64-i686-python2-html5lib 1.0.1-3     A Python HTML parser/tokenizer based on the WHATWG HTML5 spec (mingw-w64) local/mingw-w64-i686-python2-idna 2.7-2     Internationalized Domain Names in Applications (mingw-w64) local/mingw-w64-i686-python2-ipaddress 1.0.22-1     Port of the 3.3+ ipaddress module to 2.6, 2.7, 3.2 (mingw-w64) local/mingw-w64-i686-python2-lockfile 0.12.2-1     Platform-independent file locking module (mingw-w64) local/mingw-w64-i686-python2-msgpack 0.5.6-1     MessagePack serializer implementation for Python (mingw-w64) local/mingw-w64-i686-python2-packaging 17.1-1     Core utilities for Python packages (mingw-w64) local/mingw-w64-i686-python2-pip 18.0-2     An easy_install replacement for installing pypi python packages (mingw-w64) local/mingw-w64-i686-python2-ply 3.11-2     Implementation of lex and yacc parsing tools (mingw-w64) local/mingw-w64-i686-python2-progress 1.4-3     Easy to use progress bars for Python (mingw-w64) local/mingw-w64-i686-python2-pyasn1 0.4.4-1     ASN.1 types and codecs (mingw-w64) local/mingw-w64-i686-python2-pycparser 2.19-1     Complete parser of the C language, written in pure Python (mingw-w64) local/mingw-w64-i686-python2-pyparsing 2.2.0-3     General parsing module for Python (mingw-w64) local/mingw-w64-i686-python2-pytoml 0.1.19-1     A TOML-0.4.0 parser/writer for Python. (mingw-w64) local/mingw-w64-i686-python2-requests 2.19.1-3     Requests is the only Non-GMO HTTP library for Python, safe for human     consumption. (mingw-w64) local/mingw-w64-i686-python2-retrying 1.3.3-1     A general purpose Python retyring library (mingw-w64) local/mingw-w64-i686-python2-setuptools 40.4.3-1     Easily download, build, install, upgrade, and uninstall Python packages     (mingw-w64) local/mingw-w64-i686-python2-six 1.11.0-2     Python 2 and 3 compatibility utilities (mingw-w64) local/mingw-w64-i686-python2-urllib3 1.23-2     HTTP library with thread-safe connection pooling and file post support     (mingw-w64) local/mingw-w64-i686-python2-webencodings 0.5.1-3     This is a Python implementation of the WHATWG Encoding standard (mingw-w64) Insert in .bash_profile (in MSYS2 home/username to find) export IDF_PATH="${HOME}/esp/ESP8266_RTOS_SDK" PATH="/d/data/xtensa-lx106-elf/bin:${PATH}" BTW - my installation of all tools is in D:\data Quote $ make flash Toolchain path: /d/data/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc Toolchain version: esp-2020r3-49-gd5524c1 Compiler version: 8.4.0 Python requirements from D:/data/msys32/home/andi/esp/ESP8266_RTOS_SDK/requirements.txt are satisfied. CC build/bootloader/main/bootloader_start.o AR build/bootloader/main/libmain.a CC build/bootloader/bootloader_support/src/bootloader_random.o CC build/bootloader/bootloader_support/src/flash_encrypt.o CC build/bootloader/bootloader_support/src/bootloader_sha.o $ make flash Toolchain path: /d/data/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc Toolchain version: esp-2020r3-49-gd5524c1 Compiler version: 8.4.0 Python requirements from D:/data/msys32/home/andi/esp/ESP8266_RTOS_SDK/requirements.txt are satisfied. CC build/bootloader/main/bootloader_start.o AR build/bootloader/main/libmain.a CC build/bootloader/bootloader_support/src/bootloader_random.o CC build/bootloader/bootloader_support/src/flash_encrypt.o CC build/bootloader/bootloader_support/src/bootloader_sha.o ..... CC build/wpa_supplicant/src/wps/wps_attr_process.o AR build/wpa_supplicant/libwpa_supplicant.a Generating esp8266.project.ld LD build/hello-world.elf esptool.py v2.4.0 Flashing binaries to serial port COM3 (app at offset 0x10000)... esptool.py v2.4.0 Connecting.... Chip is ESP8266EX Features: WiFi MAC: 4c:75:25:10:c4:08 Uploading stub... Running stub... Stub running... Configuring flash size... Compressed 10432 bytes to 7018... Wrote 10432 bytes (7018 compressed) at 0x00000000 in 0.6 seconds (effective 130.5 kbit/s)... Hash of data verified. Compressed 169280 bytes to 108550... Wrote 169280 bytes (108550 compressed) at 0x00010000 in 9.6 seconds (effective 140.4 kbit/s)... Hash of data verified. Compressed 3072 bytes to 83... Wrote 3072 bytes (83 compressed) at 0x00008000 in 0.0 seconds (effective 1534.9 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin... Its running on the device Quote ets Jan  8 2013,rst cause:2, boot mode:(3,6) load 0x40100000, len 7040, room 16 chksum 0x20 load 0x3ffe8408, len 24, room 8 tail 0 chksum 0xa9 load 0x3ffe8420, len 3324, room 8 tail 4 chksum 0xe3 csum 0xe3 I (84) boot: ESP-IDF v3.4-53-g83517ba1 2nd stage bootloader I (84) boot: compile time 10:31:29 I (84) qio_mode: Enabling default flash chip QIO I (100) boot: SPI Speed      : 40MHz I (113) boot: SPI Mode       : QIO I (126) boot: SPI Flash Size : 2MB I (139) boot: Partition Table: I (150) boot: ## Label            Usage          Type ST Offset   Length I (173) boot:  0 nvs              WiFi data        01 02 00009000 00006000 I (196) boot:  1 phy_init         RF data          01 01 0000f000 00001000 I (219) boot:  2 factory          factory app      00 00 00010000 000f0000 I (242) boot: End of partition table I (255) esp_image: segment 0: paddr=0x00010010 vaddr=0x40210010 size=0x1cc70 (11 7872) map 0x40210010: _stext at ??:? I (338) esp_image: segment 1: paddr=0x0002cc88 vaddr=0x4022cc80 size=0x071f0 ( 2 9168) map I (353) esp_image: segment 2: paddr=0x00033e80 vaddr=0x3ffe8000 size=0x00544 ( 1348) load I (361) esp_image: segment 3: paddr=0x000343cc vaddr=0x40100000 size=0x00080 (  128) load I (388) esp_image: segment 4: paddr=0x00034454 vaddr=0x40100080 size=0x050c0 ( 2 0672) load I (424) boot: Loaded app from partition at offset 0x10000 Hello world! This is ESP8266 chip with 1 CPU cores, WiFi, silicon revision 1, 2MB external fl ash The next step can be the tests with fpc. The MSYS2 System is up and running. ---------------------------------------------------------------------- af0815 · 2022-01-08 13:14 compiling with windows: i patched fpcupdeluxe to work with the correct tools and adapted the fpc.cfg for the correct type. And build the crosscompiler. this well done (says fpcupdeluxe) Now i use the following script to make the steps more transparent Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i @echo onset IDF_PATH=D:\data\msys32\home\andi\esp\ESP8266_RTOS_SDKcd D:\data\lazde v\xtensa\projects\helloworldD:\data\lazdev\xtensa\fpc\bin\i386- win32\ppcrossxtensa -sh -Furtl/units/xtensa-freertos/ -Tfreertos -XPxtensa-lx106-elf- -O- -Wpesp8266 -WP4.0 HelloWorld2.lpr -FlD:\data\msys32\home\andi\esp\xtensa-lx106-elf-libs -FlD:\data\msys3 2\home\andi\esp\ESP8266_RTOS_SDK\components/esp8266/lib -FED:\data\lazdev\xtensa\projects\helloworldpause after this i get a ppas.bat. if i start this i get QuoteAssembling helloworld2 Linking D:\data\lazdev\xtensa\projects\helloworld\HelloWorld2 D:\data\xtensa-lx106-elf\bin\xtensa-lx106-elf-ld.exe: cannot find libc_fnano.a D:\data\xtensa-lx106-elf\bin\xtensa-lx106-elf-ld.exe: cannot find libstdc++.a An error occurred while linking D:\data\lazdev\xtensa\projects\helloworld\HelloWorld2 Drücken Sie eine beliebige Taste . . .it will correct because c_fnano and libstdc++ are not built for this target. ---------------------------------------------------------------------- ccrause · 2022-01-08 15:19 Quote from: af0815 on January 08, 2022, 02:14:52 pmCode: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  -WP4.0after this i get a ppas.bat. if i start this i get QuoteAssembling helloworld2 Linking D:\data\lazdev\xtensa\projects\helloworld\HelloWorld2 D:\data\xtensa-lx106-elf\bin\xtensa-lx106-elf-ld.exe: cannot find libc_fnano.a D:\data\xtensa-lx106-elf\bin\xtensa-lx106-elf-ld.exe: cannot find libstdc++.a Interesting, it seems as if fpcupdeluxe did not pull the latest fpc source.  At least I cannot find an esp8266rtos_30400.pp mentioned in the fpcupdeluxe.txt file, which is the unit that determines the basic library list for linking. This file should be located in fpcsrc\rtl\freertos\xtensa\ folder.  If it is there, it is not included in the MakeFile, which should include this unit in the list of compiled units. Also, the latest esp8266 SDK version is 3.4, so specify -WP3.4 .  If this is a fpcupdeluxe supplied parameter it should be corrected there. ---------------------------------------------------------------------- af0815 · 2022-01-08 15:36 According https://docs.espressif.com/projects/esp8266-rtos- sdk/en/latest/get-started/index.html#get-started-get-esp-idf it is cloned from git and in ESP8266_RTOS_SDK/make/version.mkit is coded as QuoteIDF_VERSION_MAJOR := 4 IDF_VERSION_MINOR := 0 IDF_VERSION_PATCH := 0this is IMHO 4.0. This is not a standard parameter of fpcupdeluxe. Edit: If it is not the absolute latest version of FPC, it can be my fault. I have fight against the wrong detection of the tollset at building the cross compiler, so it can be the basic fpc is few days old. I am correcting this yet. Quotefpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC was at revision/hash: 3.3.1-9835-g3cf00af48d fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC is now at revision/hash: 3.3.1-9884-g307c284f6a ---------------------------------------------------------------------- ccrause · 2022-01-08 18:11 Quote from: af0815 on January 08, 2022, 04:36:53 pmAccording https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get- started/index.html#get-started-get-esp-idf it is cloned from git and in ESP8266_RTOS_SDK/make/version.mkit is coded as QuoteIDF_VERSION_MAJOR := 4 IDF_VERSION_MINOR := 0 IDF_VERSION_PATCH := 0this is IMHO 4.0. This is not a standard parameter of fpcupdeluxe. Edit: If it is not the absolute latest version of FPC, it can be my fault. I have fight against the wrong detection of the tollset at building the cross compiler, so it can be the basic fpc is few days old. I am correcting this yet. Quotefpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC was at revision/hash: 3.3.1-9835-g3cf00af48d fpcupdeluxe: info: FPCNativeInstaller (GetModule: FPC): FPC is now at revision/hash: 3.3.1-9884-g307c284f6a OK, seems like you are on the trunk version of esp8266-rtos-sdk which is not tested with fpc to check the build requirements. Using - WP4.0 in fpc should then fall back to the v3. 4 SDK settings. ---------------------------------------------------------------------- af0815 · 2022-01-08 18:30 This is the 'official' way of installing the sdk according the website. ---------------------------------------------------------------------- ccrause · 2022-01-09 13:36 Quote from: af0815 on January 08, 2022, 07:30:45 pmThis is the 'official' way of installing the sdk according the website. Yes, I see. The problem is that the current esp8266 Get Started link results in installing the latest master branch, which is updated weekly.  This presents a shifting support target, my preference would be to only support release versions.  But this doesn't appear to be the cause of your compilation problems. ---------------------------------------------------------------------- ccrause · 2022-01-09 14:10 Quote from: af0815 on January 08, 2022, 02:14:52 pmcompiling with windows: i patched fpcupdeluxe to work with the correct tools and adapted the fpc.cfg for the correct type. And build the crosscompiler. this well done (says fpcupdeluxe) Now i use the following script to make the steps more transparent Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i @echo onset IDF_PATH=D:\data\msys32\home\andi\esp\ESP8266_RTOS_SDKcd D:\data\lazde v\xtensa\projects\helloworldD:\data\lazdev\xtensa\fpc\bin\i386- win32\ppcrossxtensa -sh -Furtl/units/xtensa-freertos/ -Tfreertos -XPxtensa-lx106-elf- -O- -Wpesp8266 -WP4.0 HelloWorld2.lpr -FlD:\data\msys32\home\andi\esp\xtensa-lx106-elf-libs -FlD:\data\msys3 2\home\andi\esp\ESP8266_RTOS_SDK\components/esp8266/lib -FED:\data\lazdev\xtensa\projects\helloworldpause after this i get a ppas.bat. if i start this i get QuoteAssembling helloworld2 Linking D:\data\lazdev\xtensa\projects\helloworld\HelloWorld2 D:\data\xtensa-lx106-elf\bin\xtensa-lx106-elf-ld.exe: cannot find libc_fnano.a D:\data\xtensa-lx106-elf\bin\xtensa-lx106-elf-ld.exe: cannot find libstdc++.a An error occurred while linking D:\data\lazdev\xtensa\projects\helloworld\HelloWorld2 Drücken Sie eine beliebige Taste . . .it will correct because c_fnano and libstdc++ are not built for this target. If -WP is larger than 3.3 fpc should load unit esp8266rtos_30400, which only links to libc_nano, not libc_fnano.  Your attached build log does not show a unit esp8266_30300 or esp8266_30400 being build, so something is funny with the version of the cross fpc as downloaded and/or build by fpcupdeluxe.  Can you verify that esp8266_30300.pp and esp8266_30400.pp do exist in D:/data/lazdev/xtensa/fpcsrc/rtl/freertos/xtensa and also that these units are referenced in /fpcsrc/rtl/freertos/MakeFile?  These changes were implemented in this commit, but was included before commit 307c284f6a which is your latest fpc revision.  So this is a bit puzzling... Then there remains a problem with locating libstdc++.  In the latest bin tools this library should be located in D:\data\xtensa- lx106-elf\xtensa-lx106-elf\lib, together with libc_nano.  You either have to copy the libraries in this folder to your overall library folder (D:\data\msys32\home\andi\esp\xtensa-lx106-elf-lib) if these libraries are not already there, or add another -FlD:\data\xtensa- lx106-elf\xtensa-lx106-elf\lib statement to your project's compile command to add this path to fpc's library search list. Disclaimer: I'm translating from Linux paths to what I assume is equivalent to your Windows folder structures, but the exact paths I mention above may not be correct. ---------------------------------------------------------------------- af0815 · 2022-01-09 14:21 I have changed to the 3.4 version (with git no problem). And rebuild the example and copy the produced files to xtensa-lx106-elf-libs like int the Xtensa - FPC wiki described Ok, now the problem with libc_nano and  libstdc++.a are gone. Actual i have QuoteAssembling blink Linking D:\data\lazdev\xtensa\projects\blink\blink Linking D:\data\lazdev\xtensa\projects\blink\blink Traceback (most recent call last):   File "D:\data\msys32\home\andi\esp\ESP8266_RTOS_SDK/components/espto ol_py/esptool/esptool.py", line 35, in     import serial.tools.list_ports as list_ports ModuleNotFoundError: No module named 'serial' An error occurred while linking D:\data\lazdev\xtensa\projects\blink\blink Drücken Sie eine beliebige Taste . . . But this looks python specific problem and i must handle this. it is a bit tricky :-) Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i python -m pip install --upgrade pippip uninstall serialpip uninstall pyserialpip install pyserial you must first upgrade to the last pip version, then uninstall serial and pyserial, because there is maybe an internal naming conflict, after this you can reinstall pyserial (only) Now i get a blink.bin ---------------------------------------------------------------------- af0815 · 2022-01-09 14:45 Now i have copied the needed bin files and flash Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i @echo onset IDF_PATH=D:\data\msys32\home\andi\esp\ESP8266_RTOS_SDKcd D:\data\lazdev\xtensa\projects\blinkpython.exe D:\data\msys32\home\and i\esp\ESP8266_RTOS_SDK/components/esptool_py/esptool/esptool.py --chip esp8266 --port "COM3" --baud 921600 --before "default_reset" --after "hard_reset" write_flash -z --flash_mode "dio" --flash_freq "40m" --flash_size "2MB"   0x0 bootloader.bin 0x10000 blink.bin 0x8000 partitions_singleapp.bin Quoteesptool.py v2.4.0 Connecting........__ Chip is ESP8266EX Features: WiFi MAC: 4c:75:25:10:c4:08 Uploading stub... Running stub... Stub running... Changing baud rate to 921600 Changed. Configuring flash size... Compressed 10432 bytes to 7020... Wrote 10432 bytes (7020 compressed) at 0x00000000 in 0.1 seconds (effective 867.8 kbit/s)... Hash of data verified. Compressed 157136 bytes to 100991... Wrote 157136 bytes (100991 compressed) at 0x00010000 in 1.4 seconds (effective 883.2 kbit/s)... Hash of data verified. Compressed 3072 bytes to 83... Wrote 3072 bytes (83 compressed) at 0x00008000 in 0.0 seconds (effective 1520.3 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin... After a reset my esp8266 is blinking :-) Many thanks go to ccrause and his help. And to DonAlfredo for his fpcupdeluxe. So my question is - what can i do for you ? ---------------------------------------------------------------------- ccrause · 2022-01-09 16:50 Quote from: af0815 on January 09, 2022, 03:45:29 pmAfter a reset my esp8266 is blinking :-) Many thanks go to ccrause and his help. And to DonAlfredo for his fpcupdeluxe. Well done! I know it is frustrating when something should just work, but does not. QuoteSo my question is - what can i do for you ? Perhaps update the wiki?  In particular getting the SDK toolchain to work on Windows - I struggled a lot to get to the point where I could compile an example on Windows. ---------------------------------------------------------------------- af0815 · 2022-01-09 18:48 I have a working fpcupdeluxe, but nothing for other people. One goal is, stm32 and esp8266 cannot actual work at the same time in fpc out of the box. If you create one, you overwrite the other, without manual work. The correct crossbin and libs should exists for fpcupdeluxe. The target 4.x is comming  And i have to test all with your samples in Lazarus.