Page 1 of 2

Compiling ESP32-C2 Arduino lib

Posted: Thu Sep 19, 2024 3:35 am
by themindfactory
I am compiling the ESP32-C2 library for Arduino, once compiled I am unsure where all the files are I need to move into my Arduino folders.

I am compiling in Linux, and moving them to a Windows 10 machine.

I see a folder called out that has tools in it, I see also a folder called components/Arduino that looks like we need them, however where is the RISC-V GCC compiler added?

Anyone have instructions on such a data move?\

I am also using 'python3 app.py' to do the setup and compiling.

Richard.

Re: Compiling ESP32-C2 Arduino lib

Posted: Thu Sep 19, 2024 6:19 pm
by lbernstone
You need the entirety of the tools/esp32-arduino-libs folder. You should ensure that you are compiling the exact same version of arduino-esp32 as what is in your Arduino sketch folder, so that when you run get.py (or exe) your gcc binaries will match.
In recent versions of the code, I think C2 is included, but hidden.

Re: Compiling ESP32-C2 Arduino lib

Posted: Thu Sep 19, 2024 8:42 pm
by themindfactory
OK interesting, now I have un-hidden it, and I see the C2 module, now when it compiles I get:

Code: Select all

Traceback (most recent call last):
  File "esptool.py", line 37, in <module>
  File "esptool\__init__.py", line 1064, in _main
  File "esptool\__init__.py", line 888, in main
  File "esptool\cmds.py", line 977, in elf2image
  File "esptool\bin_image.py", line 1083, in __init__
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Richard\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\esp32-arduino-libs\\idf-release_v5.1-b6b4727c58\\esp32c2\\bin\\bootloader_qio_60m.elf'
[2320] Failed to execute script 'esesptool.py v4.6
ptool' due to unhandled exception!
exit status 1

Compilation error: exit status 1
When I look into that folder I find the esp32c2 folder under C:\Users\Richard\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.1-b6b4727c58 is missing.

Re: Compiling ESP32-C2 Arduino lib

Posted: Fri Sep 20, 2024 12:07 am
by lbernstone
If you are not familiar with building frameworks, you should use the lib builder with the -t and -c options.
I would recommend using the manual install instead of board manager so your changes don't get overwritten.

Re: Compiling ESP32-C2 Arduino lib

Posted: Fri Sep 20, 2024 12:31 am
by themindfactory
lbernstone wrote:
Fri Sep 20, 2024 12:07 am
If you are not familiar with building frameworks, you should use the lib builder with the -t and -c options.
I would recommend using the manual install instead of board manager so your changes don't get overwritten.
I did use lib-builder, I will see what the -t and -c entail... when it ran ./build.py it used what ever args it needed at the time I will revisit this and see....

R.

Re: Compiling ESP32-C2 Arduino lib

Posted: Fri Sep 20, 2024 12:35 am
by themindfactory
It did a -t esp32c2 and a -D default

also it was build.sh not .py :-)

-c where should you point this to? I think when I installed Arduino to the windows machine the Arduino folder in Documents was empty and I think the same for the $HOME/Arduino on Linux....

R.

Re: Compiling ESP32-C2 Arduino lib

Posted: Fri Sep 20, 2024 4:33 pm
by lbernstone
From manual installation instructions:
Screenshot from 2024-09-20 06-32-23.png
Screenshot from 2024-09-20 06-32-23.png (71.36 KiB) Viewed 2174 times

Re: Compiling ESP32-C2 Arduino lib

Posted: Tue Sep 24, 2024 4:19 pm
by themindfactory
I cloned with git as it states in the docs, I make the c2 not hidden, I can see the new hardware directory show up in Arduino IDE.. however still get the error.

No such file or directory: 'C:\\Users\\Richard\\Documents\\Arduino\\hardware\\espressif\\esp32\\tools\\esp32-arduino-libs\\esp32c2\\bin\\bootloader_qio_60m.elf'

All ESPs are there in C:\Users\Richard\Documents\Arduino\hardware\espressif\esp32\tools\esp32-arduino-libs

see attached image

but no C2

R

Re: Compiling ESP32-C2 Arduino lib

Posted: Tue Sep 24, 2024 4:50 pm
by themindfactory
Thanks to all that helped I have now figured it all out and its compiling just fine!

R.

Re: Compiling ESP32-C2 Arduino lib

Posted: Tue Sep 24, 2024 4:55 pm
by lbernstone
I was incorrect. You will indeed need to compile the sdk libraries for esp32c2. You can then move your compiled esp32c2 folder into the location you showed in the previous post. Note that it is important that your idf/arduino versions match up (v3.0.5/ 5.1.4)- it is best to get to the exact versions used by the arduino-esp32 team.