Arduino: Compiling Library Builder for ESP32C2 in Windows

Arduino: Compiling Library Builder for ESP32C2 in Windows

WSL (Windows Services for Linux):

Fresh UBUNTU install, default username: espuser

Windows:

Your Arduino path is c:\Users\{your windows account}\Documents\Arduino
-from WSL: /mnt/c/Users/{your windows account}/Documents/Arduino

Install Git GUI (Redirecting…)

Windows Services for Linux needs to be installed

IN WINDOWS:

Create the Arduino output folder

Go to `Documents\Arduino`, create:

Documents\Arduino\hardware\espressif

IN WSL:

Update the PATH

$ sudo nano /etc/profile

Go to the bottom of the file and add this line as the last line of the script: 

export PATH="/home/espuser/.local/bin:$PATH"

	`^O` to save, then exit (`^X`)  

EXIT THE WSL SESSION, THEN RESTART THE WSL SESSION

Install Python

Python 3.10.12 is already installed; check with python3 --version; if it is there, skip this win)

$ sudo apt install python3

Install PIP

$ curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python3 get-pip.py

Install Textual

$ pip install textual

Install Python3 Virtual Environment (do this before...)

$ sudo apt update && sudo apt upgrade -y
$ sudo apt install python3.10-venv

Install Requirements (...you do this!)

$ sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf cmake ninja-build ccache jq

EXIT THE WSL SESSION, THEN RESTART THE WSL SESSION

IN WINDOWS:

Install Arduino ESP32

Refer to the instructions (steps 1-4, use the details below) for "Windows (manual installation)": 

[https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html)

Git GUI Source Location: https://github.com/espressif/arduino-esp32.git
Git GUI Target Directory: C:\Users\{your windows account}\Documents\Arduino\hardware\espressif\esp32

*N**OTE*: Git GUI will create the esp32 folder

Using Git-BASH (*path is slightly different than WSL*):

$ cd /c/Users/{your windows account}/Documents/Arduino/hardware/espressif/esp32
$ git submodule update --init --recursive
$ cd tools
$ ./get.exe

Optional: You may browse C:\Users\{your windows account}\Documents\Arduino\hardware\espressif\esp32\tools in Windows and double-click get.exe

*N**OTE*: `c:\Users\{your windows account}\Documents\Arduino\hardware\espressif\esp32` will be populated with the Arduino ESP32 core.

*N**OTE*: If you launch Arduino IDE, you will see Tools->Board->"ESP32 Arduino (in sketchbook)"; "ESP32C2 Dev Module" will not be there yet, however.

*N**OTE*:  `\esp32\tools` will contain an `esp32-arduino-libs` folder with everything BUT the ESP32C2 MCU folder.  What you're going to do next is re-build the `esp32-arduino-libs`folder with ESP32C2.

IN WSL:

Get the ESP32 Arduino Lib Builder
Start here: /home/espuser

$ mkdir espressif
$ cd espressif
$ git clone https://github.com/espressif/esp32-arduino-lib-builder
$ cd esp32-arduino-lib-builder

Configure esp32-arduino-lib-builder
Start here: /home/espuser/espressif/esp32-arduino-lib-builder

$ cd tools
$ cd config_editor
$ python3 ./app.py

***Settings***	
  • Check ESP32C2 - you may leave the other MCUs checked or uncheck those you don't want to build

  • Switch on Copy to arduino-esp32 after compilation

  • Set Arduino-esp32 Path: /mnt/c/Users/{your user account in Windows}/Documents/Arduino/hardware/espressif/esp32

  • Click SAVE

    Sdkconfig Editor

  • Open builds.json

  • Remove line (49): "skip":1, which is under under "target":"esp32c2",

  • Click SAVE

    Compile Static Libraries

  • ESP-IDF 5.1 will be downloaded and configured automatically

  • Wait a few hours, depending upon how many MCUs you selected in Settings

  • ESP32S3 has a lot to build, be patient.

  • Win10 Intel(R) Celeron(R) N5105 @ 2.00GHz + 8GB + SSD: All MCUs, Start 7:44AM, end 12:29AM

    ESC/QUIT to Exit when the build has completed

WSL is no longer needed at this point, the session may be closed.

IN WINDOWS:

Enable ESP32C2 in boards.txt

**Go to:** `\Documents\Arduino\hardware\espressif\esp32`

**Edit** `boards.txt`  (notepad, etc.)

Line 48: `esp32c2.hide=true`

**Change** Line 48 to (or remove the line entirely): `### esp32c2.hide=true`

**Save** boards.txt

Wrapup

Examine /Documents/Arduino/hardware/espressif/esp32/tools/esp32-arduino-libs - look for the esp32c2 folder. If you don't see it, you can grab it from:

\\wsl.localhost\Ubuntu\home\espuser\espressif\esp32-arduino-lib-builder\out\tools\esp32-arduino-libs

I compiled all the MCUs and just dragged/dropped everying from WSL to Windows, overwriting the contents of esp32-arduino-libs.

Now, "ESP32C2 Dev Module" will be visible in "ESP32 Arduino (in sketchbook)" in Arduino IDE and you'll be able to compile for it.

模组规格

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值