ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

User avatar
fasani
Posts: 195
Joined: Wed Jan 30, 2019 12:00 pm
Location: Barcelona
Contact:

ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby fasani » Thu Sep 05, 2019 5:34 pm

First of all a big thanks to Espressif to send me the ESP32-S2-Beta-DevKitC it's v1.2r05

I followed the steps described here:
https://esp32.com/viewtopic.php?f=13&t=11265

And so far I have the toolchain working but I see that it's still compiling with the old g++.

Code: Select all

$ idf.py -p /dev/ttyUSB0 flash
Checking Python dependencies...
Python requirements from /home/martin/esp/esp-idf/requirements.txt are satisfied.
Adding flash's dependency "all" to list of actions
Executing action: all (aliases: build)
Running cmake in directory /home/martin/esp/esp-idf/examples/get-started/blink/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 --warn-uninitialized /home/martin/esp/esp-idf/examples/get-started/blink"...
Warn about uninitialized values.
-- Found Git: /usr/bin/git (found version "2.17.1") 
-- IDF_TARGET not set, using default target: esp32
-- ccache will be used for faster builds
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/martin/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /home/martin/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /home/martin/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/martin/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++
As a short introduction although I mostly code my Firmware's in Arduino framework I use the ESP32 toolchain to build my own Mesh-Lamps. So to test this I switched my IDF branch to :
~/esp/esp-idf/examples/get-started/blink$ git status
On branch feature/esp32s2beta

In this example I run like describes the forum post:

Code: Select all

rm -rf sdkconfig build
idf.py -D IDF_TARGET=esp32s2beta menuconfig
idf.py build
And I flash it to the connected ESP32-S2
idf.py -p /dev/ttyUSB0 flash

At the end I got it working and it compiled. But it was hard to discover that the build directories and sdkconfig needs to be completely wiped out in order to run.
And also as a user, is a bit confusing that when you open the sdkconfig you see:

# CONFIG_IDF_TARGET_ESP32 is not set
CONFIG_IDF_TARGET="esp32s2beta"
CONFIG_IDF_TARGET_ESP32S2BETA=y

When the ESP32 target is set :)
Anyways so far working great. Looking forward running some benchmarking tests and even finding a way to compile a MESH Lamp and to set the WiFi per se (Since there is no Bluetooth)

Would like to know if it's possible to make this even easier so it has more user adoption. Looking forward how far I can go and to learn more of ESP-IDF

By the way I have a couple of questions:

- What is the LED GPIO of this, can I blink a LED?
- Where is the Board Schematic so I can discover more?

Thanks a lot in advance!
epdiy collaborator | http://fasani.de Fan of Espressif MCUs and electronic design

ESP_LBB
Posts: 108
Joined: Fri May 18, 2018 3:41 am

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby ESP_LBB » Fri Sep 06, 2019 7:56 am

Hi fasani,

Thanks for the suggestion, I'll forward to our develop team~

Here is the link for the pre-release version of ESP32-S2 datasheet for your reference: https://www.espressif.com/en/support/do ... s=ESP32-S2

For the schematic of the development board, I'll share you by private message.

For the mesh feature, it's supported in this S2beta branch, but not in MDF yet(MDF is still based on IDF3.2.x for now), we will port this soon.

User avatar
fasani
Posts: 195
Joined: Wed Jan 30, 2019 12:00 pm
Location: Barcelona
Contact:

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby fasani » Wed Sep 11, 2019 5:58 pm

Great work!
It would be possible to compile also an Arduino framework program using the new version of the toolchain?
I will try this weekend. So far if I try to upload any of my existing things with esptool 2.6 in platformio it won’t upload I guess since requires this new version of the toolchain.
epdiy collaborator | http://fasani.de Fan of Espressif MCUs and electronic design

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby ESP_Angus » Thu Sep 12, 2019 8:41 am

Hi fasani,
fasani wrote:
Wed Sep 11, 2019 5:58 pm
It would be possible to compile also an Arduino framework program using the new version of the toolchain?
No ETA for Arduino support on S2, I'm afraid. Quite a lot of the Arduino-ESP32 "HAL" support code will need to be updated/rewritten for S2.

Regarding the IDF_TARGET variable, we know it's a bit fiddly at the moment and can be prone to weird errors. We have some fixes in the pipeline to make target setting simpler.

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby rudi ;-) » Tue Sep 17, 2019 8:08 pm

@fasani, hi martin,

did you use the installer or did you download the parts ( toolchain, cmake, ninja, mconf..)

can you please run
in esp32s2beta toolchain bin folder ( or if you set the path right simple by ):
xtensa-esp32s2-elf-gcc.exe -v
which version you get back as feedback?
( last line )

edit:
i see you have not answered yet,
so i append a question for read:
do you call menuconfig by

Code: Select all

idf.py -D IDF_TARGET=esp32s2beta menuconfig

do you can setup comport and baudrate?
or do you see this:
menuconfig_without_serial_baudrate_and_comport.jpg
menuconfig_without_serial_baudrate_and_comport.jpg (23.45 KiB) Viewed 11559 times
txs
best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby ESP_Angus » Wed Sep 18, 2019 12:04 am

Hi rudi,
rudi ;-) wrote:
Tue Sep 17, 2019 8:08 pm
do you can setup comport and baudrate?
In the CMake build system we moved the serial port settings out of the project config (people frequently commented that changing the serial port shouldn't trigger a full project rebuild.)

If using idf.py, you can set them on the command line like this:

Code: Select all

idf.py -p PORT -b BAUD flash monitor
Alternatively, set the environment variables ESPPORT & ESPBAUD to change the default values (for both idf.py and if running cmake targets directly through another tool.)

More details can be found here: https://docs.espressif.com/projects/esp ... tml#idf-py

User avatar
fasani
Posts: 195
Joined: Wed Jan 30, 2019 12:00 pm
Location: Barcelona
Contact:

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby fasani » Wed Sep 18, 2019 2:14 am

Like ESP_Angus mentioned, I'm doing that, actually, on linux it's not even a need to pass the COM port since it detects it mostly automatic.
Actually, I don't know how to get the version of the toolchain, I'm simple on the esp32s2beta branch and I do a daily pull to see if there anything new.

esptool.py v2.7-dev
epdiy collaborator | http://fasani.de Fan of Espressif MCUs and electronic design

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby rudi ;-) » Wed Sep 18, 2019 7:04 am

ESP_Angus wrote:
Wed Sep 18, 2019 12:04 am

In the CMake build system we moved the serial port settings out of the project config
(people frequently commented that changing the serial port shouldn't trigger a full project rebuild.)

If using idf.py, you can set them on the command line like this:

Code: Select all

idf.py -p PORT -b BAUD flash monitor
Hi Angus
:) this was the info i was need, i did think i will missing something cause menuconfig did not show the parts
and i want search the missings and append this CONFIGS by hand :)
thank you!! now i am calmer :) cause it is a wanted step

honestly:
cmake is very very helpfull, yes
i use it sometimes more the more, but not allways.
it is a "jack of all trades"
too much comfort is the reason to forget
cmake does a lot of (thinking) work
and is very multifunctional with everything.
you have to give cmake the fullest confidence
this can not always be done that way (depending on the environment).
cmake can do everything (even unsolicited).

thank you for your help!!

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rudi ;-)
Posts: 1698
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby rudi ;-) » Wed Sep 18, 2019 7:16 am

fasani wrote:
Wed Sep 18, 2019 2:14 am

Actually, I don't know how to get the version of the toolchain, I'm simple on the esp32s2beta branch and I do a daily pull to see if there anything new.

Hi Martin
simply call the toolchain tools with argument -v
example:

Code: Select all

xtensa-esp32s2-elf-gcc -v
you find more possible option with --h
example

Code: Select all

xtensa-esp32s2-elf-gcc --h
example:

Code: Select all

$ xtensa-esp32s2-elf-gcc --h
Usage: xtensa-esp32s2-elf-gcc.exe [options] file...
Options:
  -pass-exit-codes         Exit with highest error code from a phase.
  --help                   Display this information.
  --target-help            Display target specific command line options.
  --help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
                           Display specific types of command line options.
  (Use '-v --help' to display command line options of sub-processes).
  --version                Display compiler version information.
  -dumpspecs               Display all of the built in spec strings.
  -dumpversion             Display the version of the compiler.
  -dumpmachine             Display the compiler's target processor.
  -print-search-dirs       Display the directories in the compiler's search path.
  -print-libgcc-file-name  Display the name of the compiler's companion library.
  -print-file-name=<lib>   Display the full path to library <lib>.
  -print-prog-name=<prog>  Display the full path to compiler component <prog>.
  -print-multiarch         Display the target's normalized GNU triplet, used as
                           a component in the library path.
  -print-multi-directory   Display the root directory for versions of libgcc.
  -print-multi-lib         Display the mapping between command line options and
                           multiple library search directories.
  -print-multi-os-directory Display the relative path to OS libraries.
  -print-sysroot           Display the target libraries directory.
  -print-sysroot-headers-suffix Display the sysroot suffix used to find headers.
  -Wa,<options>            Pass comma-separated <options> on to the assembler.
  -Wp,<options>            Pass comma-separated <options> on to the preprocessor.
  -Wl,<options>            Pass comma-separated <options> on to the linker.
  -Xassembler <arg>        Pass <arg> on to the assembler.
  -Xpreprocessor <arg>     Pass <arg> on to the preprocessor.
  -Xlinker <arg>           Pass <arg> on to the linker.
  -save-temps              Do not delete intermediate files.
  -save-temps=<arg>        Do not delete intermediate files.
  -no-canonical-prefixes   Do not canonicalize paths when building relative
                           prefixes to other gcc components.
  -pipe                    Use pipes rather than intermediate files.
  -time                    Time the execution of each subprocess.
  -specs=<file>            Override built-in specs with the contents of <file>.
  -std=<standard>          Assume that the input sources are for <standard>.
  --sysroot=<directory>    Use <directory> as the root directory for headers
                           and libraries.
  -B <directory>           Add <directory> to the compiler's search paths.
  -v                       Display the programs invoked by the compiler.
  -###                     Like -v but options quoted and commands not executed.
  -E                       Preprocess only; do not compile, assemble or link.
  -S                       Compile only; do not assemble or link.
  -c                       Compile and assemble, but do not link.
  -o <file>                Place the output into <file>.
  -pie                     Create a dynamically linked position independent
                           executable.
  -shared                  Create a shared library.
  -x <language>            Specify the language of the following input files.
                           Permissible languages include: c c++ assembler none
                           'none' means revert to the default behavior of
                           guessing the language based on the file's extension.

Options starting with -g, -f, -m, -O, -W, or --param are automatically
 passed on to the various sub-processes invoked by xtensa-esp32s2-elf-gcc.exe.  In order to pass
 other options on to these processes the -W<letter> options must be used.

For bug reporting instructions, please see:
<https://gcc.gnu.org/bugs/>.


if you call with --version
example

Code: Select all

xtensa-esp32s2-elf-gcc --version
you got a short info likewise this ( the XXXXX i did make - what is your version ?)

Code: Select all

 xtensa-esp32s2-elf-gcc --version
xtensa-esp32s2-elf-gcc.exe (crosstool-NG esp32s2-dev-XXXXXXXXXXX) XXXX
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
thank you
best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
fasani
Posts: 195
Joined: Wed Jan 30, 2019 12:00 pm
Location: Barcelona
Contact:

Re: ESP32-S2 toolchain installed. Works, suggestions to make it clearer for the user of existing IDF

Postby fasani » Wed Sep 18, 2019 9:56 am

This is the version :

xtensa-esp32s2-elf-gcc (crosstool-NG esp32s2-dev-4-g3a626e9) 8.2.0

What I really don't understand is why the version is relevant for you and in the second why in this ESP32 post where I was trying to make another point?
If you want to help, clone this, and let's pass it with more tests to ESP-IDF Framework instead of Arduino:
https://github.com/martinberlin/ESP32-benchmark
epdiy collaborator | http://fasani.de Fan of Espressif MCUs and electronic design

Who is online

Users browsing this forum: No registered users and 117 guests