Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1ee032a

Browse files
committedApr 5, 2021
Add support for CMake, ESP32-S2 and IDF master
1 parent fe8eeb0 commit 1ee032a

29 files changed

+5053
-1308
lines changed
 

‎.github/workflows/cron.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ jobs:
2020

2121
strategy:
2222
matrix:
23-
idf_branch: [release/v3.3]
24-
#idf_branch: [release/v3.3, release/v4.0]
23+
idf_branch: [master, release/v3.3]
2524
steps:
2625
- uses: actions/checkout@v1
2726
- name: Install dependencies
28-
run: bash ./tools/prepare-ci.sh
27+
run: sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache
28+
- name: Install Python Wheel
29+
run: pip install wheel
2930
- name: Build
3031
env:
3132
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}

‎.github/workflows/push.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v1
1616
- name: Install dependencies
17-
run: bash ./tools/prepare-ci.sh
17+
run: sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache
18+
- name: Install Python Wheel
19+
run: pip install wheel
1820
- name: Build Arduino Libs
1921
run: bash ./build.sh
2022
- name: Upload archive

‎.github/workflows/repository_dispatch.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ jobs:
99
steps:
1010
- uses: actions/checkout@v1
1111
- name: Install dependencies
12-
run: bash ./tools/prepare-ci.sh
12+
run: sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache
13+
- name: Install Python Wheel
14+
run: pip install wheel
1315
- name: Handle Event
1416
env:
1517
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}

‎.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
sdkconfig.old
21
.DS_Store
2+
.vscode
33
components/arduino/
44
components/esp-face/
55
components/esp32-camera/
6+
components/esp_littlefs/
7+
components/esp-rainmaker/
8+
components/esp-dsp/
69
esp-idf/
710
out/
811
build/
9-
xtensa-esp32-elf/
1012
dist/
13+
env.sh
14+
sdkconfig
15+
sdkconfig.old
16+
version.txt
17+
components/arduino_tinyusb/tinyusb/

‎CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# The following lines of boilerplate have to be in your project's
2+
# CMakeLists in this exact order for cmake to work correctly
3+
cmake_minimum_required(VERSION 3.5)
4+
5+
if(IDF_TARGET STREQUAL "esp32")
6+
set(EXTRA_COMPONENT_DIRS ${CMAKE_SOURCE_DIR}/components/esp-rainmaker/components)
7+
endif()
8+
9+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
10+
project(arduino-lib-builder)
11+
12+
add_custom_command(
13+
OUTPUT "idf_libs"
14+
COMMAND ${CMAKE_SOURCE_DIR}/tools/prepare-libs.sh ${IDF_TARGET}
15+
DEPENDS gen_project_binary bootloader partition_table
16+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
17+
VERBATIM
18+
)
19+
add_custom_target(idf-libs ALL DEPENDS "idf_libs")

‎Makefile

Lines changed: 0 additions & 17 deletions
This file was deleted.

‎build.sh

Lines changed: 17 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,6 @@ if ! [ -x "$(command -v git)" ]; then
1010
exit 1
1111
fi
1212

13-
if ! [ -x "$(command -v make)" ]; then
14-
echo "ERROR: Make is not installed! Please install Make first."
15-
exit 1
16-
fi
17-
18-
if ! [ -x "$(command -v flex)" ]; then
19-
echo "ERROR: flex is not installed! Please install flex first."
20-
exit 1
21-
fi
22-
23-
if ! [ -x "$(command -v bison)" ]; then
24-
echo "ERROR: bison is not installed! Please install bison first."
25-
exit 1
26-
fi
27-
28-
if ! [ -x "$(command -v gperf)" ]; then
29-
echo "ERROR: gperf is not installed! Please install gperf first."
30-
exit 1
31-
fi
32-
33-
if ! [ -x "$(command -v stat)" ]; then
34-
echo "ERROR: stat is not installed! Please install stat first."
35-
exit 1
36-
fi
37-
38-
awk="awk"
39-
if [[ "$OSTYPE" == "darwin"* ]]; then
40-
awk="gawk"
41-
fi
42-
43-
if ! [ -x "$(command -v $awk)" ]; then
44-
echo "ERROR: $awk is not installed! Please install $awk first."
45-
exit 1
46-
fi
47-
4813
mkdir -p dist
4914

5015
# update components from git
@@ -55,17 +20,27 @@ if [ $? -ne 0 ]; then exit 1; fi
5520
source ./tools/install-esp-idf.sh
5621
if [ $? -ne 0 ]; then exit 1; fi
5722

58-
# build and prepare libs
59-
./tools/build-libs.sh
60-
if [ $? -ne 0 ]; then exit 1; fi
23+
TARGETS="esp32s2 esp32"
6124

62-
# bootloader
63-
./tools/build-bootloaders.sh
64-
if [ $? -ne 0 ]; then exit 1; fi
25+
echo $(git -C $AR_COMPS/arduino describe --all --long) > version.txt
26+
27+
rm -rf out build sdkconfig sdkconfig.old
28+
29+
for target in $TARGETS; do
30+
# configure the build for the target
31+
rm -rf build sdkconfig sdkconfig.old
32+
cp "sdkconfig.$target" sdkconfig
33+
# build and prepare libs
34+
idf.py build
35+
if [ $? -ne 0 ]; then exit 1; fi
36+
cp sdkconfig "sdkconfig.$target"
37+
# build bootloaders
38+
./tools/build-bootloaders.sh
39+
if [ $? -ne 0 ]; then exit 1; fi
40+
done
6541

6642
# archive the build
6743
./tools/archive-build.sh
6844
if [ $? -ne 0 ]; then exit 1; fi
6945

70-
# POST Build
7146
#./tools/copy-to-arduino.sh
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
idf_component_register(REQUIRES esp_rom freertos soc PRIV_REQUIRES arduino main)
2+
3+
if(CONFIG_TINYUSB_ENABLED)
4+
5+
### variables ###
6+
#################
7+
set(compile_options
8+
"-DCFG_TUSB_MCU=OPT_MCU_ESP32S2"
9+
"-DCFG_TUSB_DEBUG=${CONFIG_TINYUSB_DEBUG_LEVEL}"
10+
"-Wno-type-limits" # needed for the vanila tinyusb with turned off classes
11+
)
12+
idf_component_get_property(FREERTOS_ORIG_INCLUDE_PATH freertos
13+
ORIG_INCLUDE_PATH)
14+
set(includes_private
15+
# tusb:
16+
"${COMPONENT_DIR}/tinyusb/hw/bsp/"
17+
"${COMPONENT_DIR}/tinyusb/src/"
18+
"${COMPONENT_DIR}/tinyusb/src/device"
19+
)
20+
21+
set(includes_public
22+
# tusb:
23+
"${FREERTOS_ORIG_INCLUDE_PATH}"
24+
"${COMPONENT_DIR}/tinyusb/src/"
25+
# espressif:
26+
"${COMPONENT_DIR}/include")
27+
set(srcs
28+
# espressif:
29+
"${COMPONENT_DIR}/src/dcd_esp32s2.c"
30+
# tusb:
31+
#"${COMPONENT_DIR}/tinyusb/src/portable/espressif/esp32s2/dcd_esp32s2.c"
32+
"${COMPONENT_DIR}/tinyusb/src/class/cdc/cdc_device.c"
33+
"${COMPONENT_DIR}/tinyusb/src/class/hid/hid_device.c"
34+
"${COMPONENT_DIR}/tinyusb/src/class/midi/midi_device.c"
35+
"${COMPONENT_DIR}/tinyusb/src/class/msc/msc_device.c"
36+
"${COMPONENT_DIR}/tinyusb/src/class/dfu/dfu_rt_device.c"
37+
"${COMPONENT_DIR}/tinyusb/src/class/vendor/vendor_device.c"
38+
"${COMPONENT_DIR}/tinyusb/src/common/tusb_fifo.c"
39+
"${COMPONENT_DIR}/tinyusb/src/device/usbd_control.c"
40+
"${COMPONENT_DIR}/tinyusb/src/device/usbd.c"
41+
"${COMPONENT_DIR}/tinyusb/src/tusb.c")
42+
43+
### tinyusb lib ###
44+
###################
45+
add_library(arduino_tinyusb STATIC ${srcs})
46+
target_include_directories(
47+
arduino_tinyusb
48+
PUBLIC ${includes_public}
49+
PRIVATE ${includes_private})
50+
target_compile_options(arduino_tinyusb PRIVATE ${compile_options})
51+
target_link_libraries(${COMPONENT_TARGET} INTERFACE arduino_tinyusb)
52+
53+
endif()
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
menu "Arduino TinyUSB"
2+
3+
config TINYUSB_ENABLED
4+
bool "Enable TinyUSB driver"
5+
default y
6+
depends on IDF_TARGET_ESP32S2
7+
select FREERTOS_SUPPORT_STATIC_ALLOCATION
8+
select FREERTOS_USE_AUTHENTIC_INCLUDE_PATHS
9+
help
10+
Adds support for TinyUSB
11+
12+
menu "Serial (CDC) driver"
13+
depends on TINYUSB_ENABLED
14+
15+
config TINYUSB_CDC_ENABLED
16+
bool "Enable USB Serial (CDC) TinyUSB driver"
17+
default y
18+
help
19+
Enable USB Serial (CDC) TinyUSB driver.
20+
21+
config TINYUSB_DESC_CDC_STRING
22+
string "CDC Device String"
23+
default "Espressif CDC Device"
24+
depends on TINYUSB_CDC_ENABLED
25+
help
26+
Specify name of the CDC device
27+
28+
config TINYUSB_CDC_RX_BUFSIZE
29+
int "CDC FIFO size of RX"
30+
default 64
31+
depends on TINYUSB_CDC_ENABLED
32+
help
33+
CDC FIFO size of RX
34+
35+
config TINYUSB_CDC_TX_BUFSIZE
36+
int "CDC FIFO size of TX"
37+
default 64
38+
depends on TINYUSB_CDC_ENABLED
39+
help
40+
CDC FIFO size of TX
41+
42+
endmenu
43+
44+
menu "Mass Storage (MSC) driver"
45+
depends on TINYUSB_ENABLED
46+
47+
config TINYUSB_MSC_ENABLED
48+
bool "Enable USB Mass Storage (MSC) TinyUSB driver"
49+
default y
50+
help
51+
Enable USB Mass Storage (MSC) TinyUSB driver.
52+
53+
config TINYUSB_DESC_MSC_STRING
54+
string "MSC Device String"
55+
default "Espressif MSC Device"
56+
depends on TINYUSB_MSC_ENABLED
57+
help
58+
Specify name of the MSC device
59+
60+
config TINYUSB_MSC_BUFSIZE
61+
int "MSC Buffer size"
62+
default 64
63+
depends on TINYUSB_MSC_ENABLED
64+
help
65+
MSC Buffer size
66+
67+
endmenu
68+
69+
menu "Human Interface (HID) driver"
70+
depends on TINYUSB_ENABLED
71+
72+
config USB_HID_ENABLED
73+
bool "Enable USB Human Interface (HID) TinyUSB driver"
74+
default y
75+
help
76+
Enable USB Human Interface (HID) TinyUSB driver.
77+
78+
config TINYUSB_DESC_HID_STRING
79+
string "HID Device String"
80+
default "Espressif HID Device"
81+
depends on TINYUSB_HID_ENABLED
82+
help
83+
Specify name of the HID device
84+
85+
config TINYUSB_HID_BUFSIZE
86+
int "HID Buffer size"
87+
default 64
88+
depends on TINYUSB_HID_ENABLED
89+
help
90+
HID Buffer size. Should be sufficient to hold ID (if any) + Data
91+
92+
endmenu
93+
94+
menu "MIDI driver"
95+
depends on TINYUSB_ENABLED && (!TINYUSB_VENDOR_ENABLED || !TINYUSB_MSC_ENABLED || !TINYUSB_HID_ENABLED || !TINYUSB_CDC_ENABLED)
96+
97+
config TINYUSB_MIDI_ENABLED
98+
bool "Enable USB MIDI TinyUSB driver"
99+
default n
100+
help
101+
Enable USB MIDI TinyUSB driver.
102+
103+
config TINYUSB_DESC_MIDI_STRING
104+
string "MIDI Device String"
105+
default "Espressif MIDI Device"
106+
depends on TINYUSB_MIDI_ENABLED
107+
help
108+
Specify name of the MIDI device
109+
110+
config TINYUSB_MIDI_RX_BUFSIZE
111+
int "MIDI FIFO size of RX"
112+
default 64
113+
depends on TINYUSB_MIDI_ENABLED
114+
help
115+
MIDI FIFO size of RX
116+
117+
config TINYUSB_MIDI_TX_BUFSIZE
118+
int "MIDI FIFO size of TX"
119+
default 64
120+
depends on TINYUSB_MIDI_ENABLED
121+
help
122+
MIDI FIFO size of TX
123+
124+
endmenu
125+
126+
menu "DFU Runtime driver"
127+
depends on TINYUSB_ENABLED
128+
129+
config TINYUSB_DFU_RT_ENABLED
130+
bool "Enable USB DFU Runtime TinyUSB driver"
131+
default y
132+
help
133+
Enable USB DFU Runtime TinyUSB driver.
134+
135+
config TINYUSB_DESC_DFU_RT_STRING
136+
string "DFU_RT Device String"
137+
default "Espressif DFU_RT Device"
138+
depends on TINYUSB_DFU_RT_ENABLED
139+
help
140+
Specify name of the DFU_RT device
141+
142+
endmenu
143+
144+
menu "VENDOR driver"
145+
depends on TINYUSB_ENABLED
146+
147+
config TINYUSB_VENDOR_ENABLED
148+
bool "Enable USB VENDOR TinyUSB driver"
149+
default y
150+
help
151+
Enable USB VENDOR TinyUSB driver.
152+
153+
config TINYUSB_DESC_VENDOR_STRING
154+
string "VENDOR Device String"
155+
default "Espressif VENDOR Device"
156+
depends on TINYUSB_VENDOR_ENABLED
157+
help
158+
Specify name of the VENDOR device
159+
160+
config TINYUSB_VENDOR_RX_BUFSIZE
161+
int "VENDOR FIFO size of RX"
162+
default 64
163+
depends on TINYUSB_VENDOR_ENABLED
164+
help
165+
VENDOR FIFO size of RX
166+
167+
config TINYUSB_VENDOR_TX_BUFSIZE
168+
int "VENDOR FIFO size of TX"
169+
default 64
170+
depends on TINYUSB_VENDOR_ENABLED
171+
help
172+
VENDOR FIFO size of TX
173+
174+
endmenu
175+
176+
config TINYUSB_DEBUG_LEVEL
177+
int "TinyUSB log level (0-3)"
178+
default 0
179+
range 0 3
180+
depends on TINYUSB_ENABLED
181+
help
182+
Define amount of log output from TinyUSB
183+
184+
endmenu
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2019 Ha Thach (tinyusb.org),
5+
* Additions Copyright (c) 2020, Espressif Systems (Shanghai) PTE LTD
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*
25+
*/
26+
27+
#pragma once
28+
#include "tusb_option.h"
29+
#include "sdkconfig.h"
30+
31+
#ifdef __cplusplus
32+
extern "C" {
33+
#endif
34+
35+
/* */
36+
/* KCONFIG */
37+
/* */
38+
39+
#ifndef CONFIG_TINYUSB_CDC_ENABLED
40+
# define CONFIG_TINYUSB_CDC_ENABLED 0
41+
#endif
42+
43+
#ifndef CONFIG_TINYUSB_MSC_ENABLED
44+
# define CONFIG_TINYUSB_MSC_ENABLED 0
45+
#endif
46+
47+
#ifndef CONFIG_TINYUSB_HID_ENABLED
48+
# define CONFIG_TINYUSB_HID_ENABLED 0
49+
#endif
50+
51+
#ifndef CONFIG_TINYUSB_MIDI_ENABLED
52+
# define CONFIG_TINYUSB_MIDI_ENABLED 0
53+
#endif
54+
55+
#ifndef CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED
56+
# define CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED 0
57+
#endif
58+
59+
#ifndef CONFIG_TINYUSB_DFU_RT_ENABLED
60+
# define CONFIG_TINYUSB_DFU_RT_ENABLED 0
61+
#endif
62+
63+
#ifndef CONFIG_TINYUSB_VENDOR_ENABLED
64+
# define CONFIG_TINYUSB_VENDOR_ENABLED 0
65+
#endif
66+
67+
/* */
68+
/* COMMON CONFIGURATION */
69+
/* */
70+
71+
#define CFG_TUSB_MCU OPT_MCU_ESP32S2
72+
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
73+
#define CFG_TUSB_OS OPT_OS_FREERTOS
74+
75+
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
76+
* Tinyusb use follows macros to declare transferring memory so that they can be put
77+
* into those specific section.
78+
* e.g
79+
* - CFG_TUSB_MEM SECTION : __attribute__ (( section(".usb_ram") ))
80+
* - CFG_TUSB_MEM_ALIGN : __attribute__ ((aligned(4)))
81+
*/
82+
#ifndef CFG_TUSB_MEM_SECTION
83+
# define CFG_TUSB_MEM_SECTION
84+
#endif
85+
86+
#ifndef CFG_TUSB_MEM_ALIGN
87+
# define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
88+
#endif
89+
90+
/* */
91+
/* DRIVER CONFIGURATION */
92+
/* */
93+
94+
#define CFG_TUD_MAINTASK_SIZE 4096
95+
#define CFG_TUD_ENDOINT0_SIZE 64
96+
97+
// Enabled Drivers
98+
#define CFG_TUD_CDC CONFIG_TINYUSB_CDC_ENABLED
99+
#define CFG_TUD_MSC CONFIG_TINYUSB_MSC_ENABLED
100+
#define CFG_TUD_HID CONFIG_TINYUSB_HID_ENABLED
101+
#define CFG_TUD_MIDI CONFIG_TINYUSB_MIDI_ENABLED
102+
#define CFG_TUD_CUSTOM_CLASS CONFIG_TINYUSB_CUSTOM_CLASS_ENABLED
103+
#define CFG_TUD_DFU_RUNTIME CONFIG_TINYUSB_DFU_RT_ENABLED
104+
#define CFG_TUD_VENDOR CONFIG_TINYUSB_VENDOR_ENABLED
105+
106+
// CDC FIFO size of TX and RX
107+
#define CFG_TUD_CDC_RX_BUFSIZE CONFIG_TINYUSB_CDC_RX_BUFSIZE
108+
#define CFG_TUD_CDC_TX_BUFSIZE CONFIG_TINYUSB_CDC_TX_BUFSIZE
109+
110+
// MSC Buffer size of Device Mass storage:
111+
#define CFG_TUD_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE
112+
113+
// HID buffer size Should be sufficient to hold ID (if any) + Data
114+
#define CFG_TUD_HID_BUFSIZE CONFIG_TINYUSB_HID_BUFSIZE
115+
116+
// MIDI FIFO size of TX and RX
117+
#define CFG_TUD_MIDI_RX_BUFSIZE CONFIG_TINYUSB_MIDI_RX_BUFSIZE
118+
#define CFG_TUD_MIDI_TX_BUFSIZE CONFIG_TINYUSB_MIDI_TX_BUFSIZE
119+
120+
// VENDOR FIFO size of TX and RX
121+
#define CFG_TUD_VENDOR_RX_BUFSIZE CONFIG_TINYUSB_VENDOR_RX_BUFSIZE
122+
#define CFG_TUD_VENDOR_TX_BUFSIZE CONFIG_TINYUSB_VENDOR_TX_BUFSIZE
123+
124+
#ifdef __cplusplus
125+
}
126+
#endif

‎components/arduino_tinyusb/src/dcd_esp32s2.c

Lines changed: 862 additions & 0 deletions
Large diffs are not rendered by default.

‎main/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
idf_component_register(SRCS "sketch.cpp" "arduino-lib-builder-gcc.c" "arduino-lib-builder-cpp.cpp" "arduino-lib-builder-as.S" INCLUDE_DIRS ".")

‎main/arduino-lib-builder-as.S

Whitespace-only changes.

‎main/arduino-lib-builder-cpp.cpp

Whitespace-only changes.

‎main/arduino-lib-builder-gcc.c

Whitespace-only changes.

‎main/sketch.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#include "Arduino.h"
22

3-
void setup(){
4-
3+
void setup() {
4+
Serial.begin(115200);
55
}
66

7-
void loop(){
8-
7+
void loop() {
8+
Serial.println("Hello World!");
9+
delay(1000);
910
}

‎sdkconfig

Lines changed: 0 additions & 962 deletions
This file was deleted.

‎sdkconfig.esp32

Lines changed: 1727 additions & 0 deletions
Large diffs are not rendered by default.

‎sdkconfig.esp32s2

Lines changed: 1481 additions & 0 deletions
Large diffs are not rendered by default.

‎tools/build-bootloaders.sh

Lines changed: 64 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,92 +3,107 @@ source ./tools/config.sh
33
TARGET_PATH=$AR_SDK/bin
44
mkdir -p $TARGET_PATH || exit 1
55

6-
$SED -i '/CONFIG_ESP32_DEFAULT_CPU_FREQ_80/c\CONFIG_ESP32_DEFAULT_CPU_FREQ_80=' ./sdkconfig
7-
$SED -i '/CONFIG_ESP32_DEFAULT_CPU_FREQ_160/c\CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y' ./sdkconfig
8-
$SED -i '/CONFIG_ESP32_DEFAULT_CPU_FREQ_240/c\CONFIG_ESP32_DEFAULT_CPU_FREQ_240=' ./sdkconfig
9-
$SED -i '/CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ/c\CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160' ./sdkconfig
6+
if [ "$IDF_TARGET" = "esp32" ]; then
7+
$SED -i '/CONFIG_ESP32_DEFAULT_CPU_FREQ_80/c\# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set' ./sdkconfig
8+
$SED -i '/CONFIG_ESP32_DEFAULT_CPU_FREQ_160/c\CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y' ./sdkconfig
9+
$SED -i '/CONFIG_ESP32_DEFAULT_CPU_FREQ_240/c\# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set' ./sdkconfig
10+
$SED -i '/CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ/c\CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160' ./sdkconfig
11+
12+
echo "CONFIG_BOOTLOADER_SPI_WP_PIN=7" >> ./sdkconfig
13+
echo "CONFIG_SPIRAM_OCCUPY_HSPI_HOST=y" >> ./sdkconfig
14+
echo "# CONFIG_SPIRAM_OCCUPY_VSPI_HOST is not set" >> ./sdkconfig
15+
echo "# CONFIG_SPIRAM_OCCUPY_NO_HOST is not set" >> ./sdkconfig
16+
elif [ "$IDF_TARGET" = "esp32s2" ]; then
17+
$SED -i '/CONFIG_ESP32S2_DEFAULT_CPU_FREQ_80/c\# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_80 is not set' ./sdkconfig
18+
$SED -i '/CONFIG_ESP32S2_DEFAULT_CPU_FREQ_160/c\CONFIG_ESP32S2_DEFAULT_CPU_FREQ_160 is not set' ./sdkconfig
19+
$SED -i '/CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240/c\# CONFIG_ESP32S2_DEFAULT_CPU_FREQ_240=y' ./sdkconfig
20+
$SED -i '/CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ/c\CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ=240' ./sdkconfig
21+
fi
22+
23+
$SED -i '/CONFIG_SPIRAM_SPEED_40M/c\# CONFIG_SPIRAM_SPEED_40M is not set' ./sdkconfig
24+
$SED -i '/CONFIG_SPIRAM_SPEED_80M/c\CONFIG_SPIRAM_SPEED_80M=y' ./sdkconfig
25+
echo "CONFIG_SPIRAM_SPEED_80M=y" >> ./sdkconfig
1026

1127
$SED -i '/CONFIG_ESPTOOLPY_FLASHFREQ_80M/c\CONFIG_ESPTOOLPY_FLASHFREQ_80M=y' ./sdkconfig
12-
$SED -i '/CONFIG_ESPTOOLPY_FLASHFREQ_40M/c\CONFIG_ESPTOOLPY_FLASHFREQ_40M=' ./sdkconfig
13-
14-
$SED -i '/CONFIG_SPIRAM_SPEED_40M/c\CONFIG_SPIRAM_SPEED_40M=' ./sdkconfig
15-
echo "CONFIG_SPIRAM_SPEED_80M=y" >> ./sdkconfig
16-
echo "CONFIG_BOOTLOADER_SPI_WP_PIN=7" >> ./sdkconfig
17-
echo "CONFIG_SPIRAM_OCCUPY_HSPI_HOST=y" >> ./sdkconfig
18-
echo "CONFIG_SPIRAM_OCCUPY_VSPI_HOST=" >> ./sdkconfig
19-
echo "CONFIG_SPIRAM_OCCUPY_NO_HOST=" >> ./sdkconfig
28+
$SED -i '/CONFIG_ESPTOOLPY_FLASHFREQ_40M/c\# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set' ./sdkconfig
2029

2130
$SED -i '/CONFIG_FLASHMODE_QIO/c\CONFIG_FLASHMODE_QIO=y' ./sdkconfig
22-
$SED -i '/CONFIG_FLASHMODE_QOUT/c\CONFIG_FLASHMODE_QOUT=' ./sdkconfig
23-
$SED -i '/CONFIG_FLASHMODE_DIO/c\CONFIG_FLASHMODE_DIO=' ./sdkconfig
24-
$SED -i '/CONFIG_FLASHMODE_DOUT/c\CONFIG_FLASHMODE_DOUT=' ./sdkconfig
31+
$SED -i '/CONFIG_FLASHMODE_QOUT/c\# CONFIG_FLASHMODE_QOUT is not set' ./sdkconfig
32+
$SED -i '/CONFIG_FLASHMODE_DIO/c\# CONFIG_FLASHMODE_DIO is not set' ./sdkconfig
33+
$SED -i '/CONFIG_FLASHMODE_DOUT/c\# CONFIG_FLASHMODE_DOUT is not set' ./sdkconfig
2534
echo "******** BUILDING BOOTLOADER QIO 80MHz *******"
26-
make -j8 bootloader || exit 1
35+
idf.py bootloader || exit 1
2736
cp build/bootloader/bootloader.bin $TARGET_PATH/bootloader_qio_80m.bin
2837

29-
$SED -i '/CONFIG_FLASHMODE_QIO/c\CONFIG_FLASHMODE_QIO=' ./sdkconfig
38+
$SED -i '/CONFIG_FLASHMODE_QIO/c\# CONFIG_FLASHMODE_QIO is not set' ./sdkconfig
3039
$SED -i '/CONFIG_FLASHMODE_QOUT/c\CONFIG_FLASHMODE_QOUT=y' ./sdkconfig
31-
$SED -i '/CONFIG_FLASHMODE_DIO/c\CONFIG_FLASHMODE_DIO=' ./sdkconfig
32-
$SED -i '/CONFIG_FLASHMODE_DOUT/c\CONFIG_FLASHMODE_DOUT=' ./sdkconfig
40+
$SED -i '/CONFIG_FLASHMODE_DIO/c\# CONFIG_FLASHMODE_DIO is not set' ./sdkconfig
41+
$SED -i '/CONFIG_FLASHMODE_DOUT/c\# CONFIG_FLASHMODE_DOUT is not set' ./sdkconfig
3342
echo "******** BUILDING BOOTLOADER QOUT 80MHz *******"
34-
make -j8 bootloader || exit 1
43+
idf.py bootloader || exit 1
3544
cp build/bootloader/bootloader.bin $TARGET_PATH/bootloader_qout_80m.bin
3645

37-
echo "CONFIG_SPIRAM_SPIWP_SD3_PIN=7" >> ./sdkconfig
46+
if [ "$IDF_TARGET" = "esp32" ]; then
47+
echo "CONFIG_SPIRAM_SPIWP_SD3_PIN=7" >> ./sdkconfig
48+
fi
3849

39-
$SED -i '/CONFIG_FLASHMODE_QIO/c\CONFIG_FLASHMODE_QIO=' ./sdkconfig
40-
$SED -i '/CONFIG_FLASHMODE_QOUT/c\CONFIG_FLASHMODE_QOUT=' ./sdkconfig
50+
$SED -i '/CONFIG_FLASHMODE_QIO/c\# CONFIG_FLASHMODE_QIO is not set' ./sdkconfig
51+
$SED -i '/CONFIG_FLASHMODE_QOUT/c\# CONFIG_FLASHMODE_QOUT is not set' ./sdkconfig
4152
$SED -i '/CONFIG_FLASHMODE_DIO/c\CONFIG_FLASHMODE_DIO=y' ./sdkconfig
42-
$SED -i '/CONFIG_FLASHMODE_DOUT/c\CONFIG_FLASHMODE_DOUT=' ./sdkconfig
53+
$SED -i '/CONFIG_FLASHMODE_DOUT/c\# CONFIG_FLASHMODE_DOUT is not set' ./sdkconfig
4354
echo "******** BUILDING BOOTLOADER DIO 80MHz *******"
44-
make -j8 bootloader || exit 1
55+
idf.py bootloader || exit 1
4556
cp build/bootloader/bootloader.bin $TARGET_PATH/bootloader_dio_80m.bin
4657

47-
$SED -i '/CONFIG_FLASHMODE_QIO/c\CONFIG_FLASHMODE_QIO=' ./sdkconfig
48-
$SED -i '/CONFIG_FLASHMODE_QOUT/c\CONFIG_FLASHMODE_QOUT=' ./sdkconfig
49-
$SED -i '/CONFIG_FLASHMODE_DIO/c\CONFIG_FLASHMODE_DIO=' ./sdkconfig
58+
$SED -i '/CONFIG_FLASHMODE_QIO/c\# CONFIG_FLASHMODE_QIO is not set' ./sdkconfig
59+
$SED -i '/CONFIG_FLASHMODE_QOUT/c\# CONFIG_FLASHMODE_QOUT is not set' ./sdkconfig
60+
$SED -i '/CONFIG_FLASHMODE_DIO/c\# CONFIG_FLASHMODE_DIO is not set' ./sdkconfig
5061
$SED -i '/CONFIG_FLASHMODE_DOUT/c\CONFIG_FLASHMODE_DOUT=y' ./sdkconfig
5162
echo "******** BUILDING BOOTLOADER DOUT 80MHz *******"
52-
make -j8 bootloader || exit 1
63+
idf.py bootloader || exit 1
5364
cp build/bootloader/bootloader.bin $TARGET_PATH/bootloader_dout_80m.bin
5465

55-
$SED -i '/CONFIG_ESPTOOLPY_FLASHFREQ_80M/c\CONFIG_ESPTOOLPY_FLASHFREQ_80M=' ./sdkconfig
66+
$SED -i '/CONFIG_ESPTOOLPY_FLASHFREQ_80M/c\# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set' ./sdkconfig
5667
$SED -i '/CONFIG_ESPTOOLPY_FLASHFREQ_40M/c\CONFIG_ESPTOOLPY_FLASHFREQ_40M=y' ./sdkconfig
5768

58-
echo "CONFIG_BOOTLOADER_SPI_WP_PIN=7" >> ./sdkconfig
59-
echo "CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V=" >> ./sdkconfig
69+
if [ "$IDF_TARGET" = "esp32" ]; then
70+
echo "CONFIG_BOOTLOADER_SPI_WP_PIN=7" >> ./sdkconfig
71+
echo "# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set" >> ./sdkconfig
72+
fi
6073

6174
$SED -i '/CONFIG_FLASHMODE_QIO/c\CONFIG_FLASHMODE_QIO=y' ./sdkconfig
62-
$SED -i '/CONFIG_FLASHMODE_QOUT/c\CONFIG_FLASHMODE_QOUT=' ./sdkconfig
63-
$SED -i '/CONFIG_FLASHMODE_DIO/c\CONFIG_FLASHMODE_DIO=' ./sdkconfig
64-
$SED -i '/CONFIG_FLASHMODE_DOUT/c\CONFIG_FLASHMODE_DOUT=' ./sdkconfig
75+
$SED -i '/CONFIG_FLASHMODE_QOUT/c\# CONFIG_FLASHMODE_QOUT is not set' ./sdkconfig
76+
$SED -i '/CONFIG_FLASHMODE_DIO/c\# CONFIG_FLASHMODE_DIO is not set' ./sdkconfig
77+
$SED -i '/CONFIG_FLASHMODE_DOUT/c\# CONFIG_FLASHMODE_DOUT is not set' ./sdkconfig
6578
echo "******** BUILDING BOOTLOADER QIO 40MHz *******"
66-
make -j8 bootloader || exit 1
79+
idf.py bootloader || exit 1
6780
cp build/bootloader/bootloader.bin $TARGET_PATH/bootloader_qio_40m.bin
6881

69-
$SED -i '/CONFIG_FLASHMODE_QIO/c\CONFIG_FLASHMODE_QIO=' ./sdkconfig
82+
$SED -i '/CONFIG_FLASHMODE_QIO/c\# CONFIG_FLASHMODE_QIO is not set' ./sdkconfig
7083
$SED -i '/CONFIG_FLASHMODE_QOUT/c\CONFIG_FLASHMODE_QOUT=y' ./sdkconfig
71-
$SED -i '/CONFIG_FLASHMODE_DIO/c\CONFIG_FLASHMODE_DIO=' ./sdkconfig
72-
$SED -i '/CONFIG_FLASHMODE_DOUT/c\CONFIG_FLASHMODE_DOUT=' ./sdkconfig
84+
$SED -i '/CONFIG_FLASHMODE_DIO/c\# CONFIG_FLASHMODE_DIO is not set' ./sdkconfig
85+
$SED -i '/CONFIG_FLASHMODE_DOUT/c\# CONFIG_FLASHMODE_DOUT is not set' ./sdkconfig
7386
echo "******** BUILDING BOOTLOADER QOUT 40MHz *******"
74-
make -j8 bootloader || exit 1
87+
idf.py bootloader || exit 1
7588
cp build/bootloader/bootloader.bin $TARGET_PATH/bootloader_qout_40m.bin
7689

77-
echo "CONFIG_SPIRAM_SPIWP_SD3_PIN=7" >> ./sdkconfig
90+
if [ "$IDF_TARGET" = "esp32" ]; then
91+
echo "CONFIG_SPIRAM_SPIWP_SD3_PIN=7" >> ./sdkconfig
92+
fi
7893

79-
$SED -i '/CONFIG_FLASHMODE_QIO/c\CONFIG_FLASHMODE_QIO=' ./sdkconfig
80-
$SED -i '/CONFIG_FLASHMODE_QOUT/c\CONFIG_FLASHMODE_QOUT=' ./sdkconfig
94+
$SED -i '/CONFIG_FLASHMODE_QIO/c\# CONFIG_FLASHMODE_QIO is not set' ./sdkconfig
95+
$SED -i '/CONFIG_FLASHMODE_QOUT/c\# CONFIG_FLASHMODE_QOUT is not set' ./sdkconfig
8196
$SED -i '/CONFIG_FLASHMODE_DIO/c\CONFIG_FLASHMODE_DIO=y' ./sdkconfig
82-
$SED -i '/CONFIG_FLASHMODE_DOUT/c\CONFIG_FLASHMODE_DOUT=' ./sdkconfig
97+
$SED -i '/CONFIG_FLASHMODE_DOUT/c\# CONFIG_FLASHMODE_DOUT is not set' ./sdkconfig
8398
echo "******** BUILDING BOOTLOADER DIO 40MHz *******"
84-
make -j8 bootloader || exit 1
99+
idf.py bootloader || exit 1
85100
cp build/bootloader/bootloader.bin $TARGET_PATH/bootloader_dio_40m.bin
86101

87-
$SED -i '/CONFIG_FLASHMODE_QIO/c\CONFIG_FLASHMODE_QIO=' ./sdkconfig
88-
$SED -i '/CONFIG_FLASHMODE_QOUT/c\CONFIG_FLASHMODE_QOUT=' ./sdkconfig
89-
$SED -i '/CONFIG_FLASHMODE_DIO/c\CONFIG_FLASHMODE_DIO=' ./sdkconfig
102+
$SED -i '/CONFIG_FLASHMODE_QIO/c\# CONFIG_FLASHMODE_QIO is not set' ./sdkconfig
103+
$SED -i '/CONFIG_FLASHMODE_QOUT/c\# CONFIG_FLASHMODE_QOUT is not set' ./sdkconfig
104+
$SED -i '/CONFIG_FLASHMODE_DIO/c\# CONFIG_FLASHMODE_DIO is not set' ./sdkconfig
90105
$SED -i '/CONFIG_FLASHMODE_DOUT/c\CONFIG_FLASHMODE_DOUT=y' ./sdkconfig
91106
echo "******** BUILDING BOOTLOADER DOUT 40MHz *******"
92-
make -j8 bootloader || exit 1
107+
idf.py bootloader || exit 1
93108
cp build/bootloader/bootloader.bin $TARGET_PATH/bootloader_dout_40m.bin
94109

‎tools/build-libs.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎tools/config.sh

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
#!/bin/bash
22

33
IDF_COMPS="$IDF_PATH/components"
4-
IDF_TOOLCHAIN="xtensa-esp32-elf"
5-
IDF_TOOLCHAIN_LINUX_ARMEL="https://dl.espressif.com/dl/xtensa-esp32-elf-linux-armel-1.22.0-96-g2852398-5.2.0.tar.gz"
6-
IDF_TOOLCHAIN_LINUX32="https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-1.22.0-96-g2852398-5.2.0.tar.gz"
7-
IDF_TOOLCHAIN_LINUX64="https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-96-g2852398-5.2.0.tar.gz"
8-
IDF_TOOLCHAIN_WIN32="https://dl.espressif.com/dl/xtensa-esp32-elf-win32-1.22.0-96-g2852398-5.2.0.zip"
9-
IDF_TOOLCHAIN_MACOS="https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-96-g2852398-5.2.0.tar.gz"
104

115
if [ -z $IDF_BRANCH ]; then
12-
IDF_BRANCH="release/v3.3"
6+
IDF_BRANCH="master"
137
fi
148

159
if [ -z $AR_PR_TARGET_BRANCH ]; then
16-
AR_PR_TARGET_BRANCH="release/v1.0"
10+
AR_PR_TARGET_BRANCH="master"
1711
fi
1812

13+
if [ -z $IDF_TARGET ]; then
14+
if [ -f sdkconfig ]; then
15+
IDF_TARGET=`cat sdkconfig | grep CONFIG_IDF_TARGET= | cut -d'"' -f2`
16+
if [ "$IDF_TARGET" = "" ]; then
17+
IDF_TARGET="esp32"
18+
fi
19+
else
20+
IDF_TARGET="esp32"
21+
fi
22+
fi
23+
24+
IDF_TOOLCHAIN="xtensa-$IDF_TARGET-elf"
25+
1926
# Owner of the target ESP32 Arduino repository
2027
AR_USER="espressif"
2128

2229
# The full name of the repository
2330
AR_REPO="$AR_USER/arduino-esp32"
2431

25-
IDF_REPO_URL="https://github.com/espressif/esp-idf.git"
26-
CAMERA_REPO_URL="https://github.com/espressif/esp32-camera.git"
27-
FACE_REPO_URL="https://github.com/espressif/esp-face.git"
2832
AR_REPO_URL="https://github.com/$AR_REPO.git"
29-
3033
if [ -n $GITHUB_TOKEN ]; then
3134
AR_REPO_URL="https://$GITHUB_TOKEN@github.com/$AR_REPO.git"
3235
fi
@@ -36,13 +39,12 @@ AR_COMPS="$AR_ROOT/components"
3639
AR_OUT="$AR_ROOT/out"
3740
AR_TOOLS="$AR_OUT/tools"
3841
AR_PLATFORM_TXT="$AR_OUT/platform.txt"
39-
AR_PLATFORMIO_PY="$AR_TOOLS/platformio-build.py"
4042
AR_ESPTOOL_PY="$AR_TOOLS/esptool.py"
4143
AR_GEN_PART_PY="$AR_TOOLS/gen_esp32part.py"
42-
AR_SDK="$AR_TOOLS/sdk"
43-
OSBITS=`uname -m`
44+
AR_SDK="$AR_TOOLS/sdk/$IDF_TARGET"
4445

4546
function get_os(){
47+
OSBITS=`arch`
4648
if [[ "$OSTYPE" == "linux"* ]]; then
4749
if [[ "$OSBITS" == "i686" ]]; then
4850
echo "linux32"
@@ -66,16 +68,13 @@ function get_os(){
6668
}
6769

6870
AR_OS=`get_os`
69-
echo "OSTYPE: $OSTYPE, OSBITS: $OSBITS, OS: $AR_OS"
7071

71-
export AWK="awk"
7272
export SED="sed"
7373
export SSTAT="stat -c %s"
7474

7575
if [[ "$AR_OS" == "macos" ]]; then
7676
export SED="gsed"
7777
export SSTAT="stat -f %z"
78-
export AWK="gawk"
7978
fi
8079

8180
function git_commit_exists(){ #git_commit_exists <repo-path> <commit-message>

‎tools/copy-to-arduino.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ if ! [ -d "$ESP32_ARDUINO" ]; then
1414
exit 1
1515
fi
1616

17-
rm -rf $ESP32_ARDUINO/tools/sdk
18-
cp -Rf $AR_SDK $ESP32_ARDUINO/tools/sdk
19-
cp -f $AR_ESPTOOL_PY $ESP32_ARDUINO/tools/esptool.py
20-
cp -f $AR_GEN_PART_PY $ESP32_ARDUINO/tools/gen_esp32part.py
21-
cp -f $AR_PLATFORMIO_PY $ESP32_ARDUINO/tools/platformio-build.py
22-
cp -f $AR_PLATFORM_TXT $ESP32_ARDUINO/platform.txt
17+
echo "Installing new libraries to $ESP32_ARDUINO"
18+
19+
rm -rf $ESP32_ARDUINO/tools/sdk $ESP32_ARDUINO/tools/esptool.py $ESP32_ARDUINO/tools/gen_esp32part.py $ESP32_ARDUINO/tools/platformio-build-*.py $ESP32_ARDUINO/platform.txt
20+
21+
cp -f $AR_OUT/platform.txt $ESP32_ARDUINO/
22+
cp -Rf $AR_TOOLS/sdk $ESP32_ARDUINO/tools/
23+
cp -f $AR_TOOLS/esptool.py $ESP32_ARDUINO/tools/
24+
cp -f $AR_TOOLS/gen_esp32part.py $ESP32_ARDUINO/tools/
25+
cp -f $AR_TOOLS/platformio-build-*.py $ESP32_ARDUINO/tools/

‎tools/install-esp-idf.sh

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#/bin/bash
22

33
source ./tools/config.sh
44

@@ -11,6 +11,7 @@ fi
1111
# CLONE ESP-IDF
1212
#
1313

14+
IDF_REPO_URL="https://github.com/espressif/esp-idf.git"
1415
if [ -z "$IDF_PATH" ]; then
1516
echo "ESP-IDF is not installed! Installing local copy"
1617
idf_was_installed="1"
@@ -93,49 +94,10 @@ fi
9394
#
9495

9596
if [ -x $idf_was_installed ]; then
96-
git -C $IDF_PATH fetch origin && git -C $IDF_PATH pull origin $IDF_BRANCH
97-
git -C $IDF_PATH submodule update --init --recursive
97+
echo "ESP-IDF is already installed at: $IDF_PATH"
9898
else
9999
git -C $IDF_PATH submodule update --init --recursive
100100
cd $IDF_PATH && python -m pip install -r requirements.txt && cd "$AR_ROOT"
101101
fi
102-
103-
#
104-
# INSTALL TOOLCHAIN
105-
#
106-
107-
if ! [ -x "$(command -v $IDF_TOOLCHAIN-gcc)" ]; then
108-
echo "GCC toolchain is not installed! Installing local copy"
109-
110-
if ! [ -d "$IDF_TOOLCHAIN" ]; then
111-
TC_EXT="tar.gz"
112-
if [[ "$AR_OS" == "win32" ]]; then
113-
TC_EXT="zip"
114-
fi
115-
if ! [ -f $IDF_TOOLCHAIN.$TC_EXT ]; then
116-
if [[ "$AR_OS" == "linux32" ]]; then
117-
TC_LINK="$IDF_TOOLCHAIN_LINUX32"
118-
elif [[ "$AR_OS" == "linux64" ]]; then
119-
TC_LINK="$IDF_TOOLCHAIN_LINUX64"
120-
elif [[ "$AR_OS" == "linux-armel" ]]; then
121-
TC_LINK="$IDF_TOOLCHAIN_LINUX_ARMEL"
122-
elif [[ "$AR_OS" == "macos" ]]; then
123-
TC_LINK="$IDF_TOOLCHAIN_MACOS"
124-
elif [[ "$AR_OS" == "win32" ]]; then
125-
TC_LINK="$IDF_TOOLCHAIN_WIN32"
126-
else
127-
echo "Unsupported OS $OSTYPE"
128-
exit 1
129-
fi
130-
echo "Downloading $TC_LINK"
131-
curl -k -o $IDF_TOOLCHAIN.$TC_EXT $TC_LINK || exit 1
132-
fi
133-
if [[ "$AR_OS" == "win32" ]]; then
134-
unzip $IDF_TOOLCHAIN.$TC_EXT || exit 1
135-
else
136-
tar zxf $IDF_TOOLCHAIN.$TC_EXT || exit 1
137-
fi
138-
rm -rf $IDF_TOOLCHAIN.$TC_EXT
139-
fi
140-
export PATH="$AR_ROOT/$IDF_TOOLCHAIN/bin:$PATH"
141-
fi
102+
$IDF_PATH/install.sh
103+
source $IDF_PATH/export.sh

‎tools/prepare-ci.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎tools/prepare-libs.sh

Lines changed: 383 additions & 114 deletions
Large diffs are not rendered by default.

‎tools/push-to-arduino.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ if [ $AR_HAS_COMMIT == "0" ]; then
2020

2121
# make changes to the files
2222
echo "Patching files in branch '$AR_NEW_BRANCH_NAME'..."
23-
rm -rf $AR_COMPS/arduino/tools/sdk
24-
cp -Rf $AR_SDK $AR_COMPS/arduino/tools/sdk
25-
cp -f $AR_ESPTOOL_PY $AR_COMPS/arduino/tools/esptool.py
26-
cp -f $AR_GEN_PART_PY $AR_COMPS/arduino/tools/gen_esp32part.py
27-
cp -f $AR_PLATFORMIO_PY $AR_COMPS/arduino/tools/platformio-build.py
28-
cp -f $AR_PLATFORM_TXT $AR_COMPS/arduino/platform.txt
23+
ESP32_ARDUINO="$AR_COMPS/arduino" ./tools/copy-to-arduino.sh
2924

3025
# did any of the files change?
3126
if [ -n "$(git status --porcelain)" ]; then

‎tools/repository_dispatch.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ payload=`echo "$EVENT_JSON" | jq -r '.client_payload'`
1111
branch=`echo "$payload" | jq -r '.branch'`
1212
commit=`echo "$payload" | jq -r '.commit'`
1313
builder=`echo "$payload" | jq -r '.builder'`
14+
arduino=`echo "$payload" | jq -r '.arduino'`
1415

1516
echo "Action: $action, Branch: $branch, Commit: $commit, Builder: $builder"
1617

@@ -34,6 +35,10 @@ if [ ! "$builder" == "" ] && [ ! "$builder" == "null" ]; then
3435
git checkout "$builder"
3536
fi
3637

38+
if [ ! "$arduino" == "" ] && [ ! "$arduino" == "null" ]; then
39+
export AR_BRANCH="$arduino"
40+
fi
41+
3742
source ./build.sh
3843

3944
if [ "$action" == "deploy" ]; then

‎tools/update-components.sh

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
#!/bin/bash
1+
#/bin/bash
22

33
source ./tools/config.sh
44

5+
CAMERA_REPO_URL="https://github.com/espressif/esp32-camera.git"
6+
FACE_REPO_URL="https://github.com/espressif/esp-face.git"
7+
RMAKER_REPO_URL="https://github.com/espressif/esp-rainmaker.git"
8+
DSP_REPO_URL="https://github.com/espressif/esp-dsp.git"
9+
LITTLEFS_REPO_URL="https://github.com/joltwallet/esp_littlefs.git"
10+
TINYUSB_REPO_URL="https://github.com/hathach/tinyusb.git"
11+
512
#
613
# CLONE/UPDATE ARDUINO
714
#
8-
ARDUINO_BRANCH="master"
9-
ARDUINO_HAS_BRANCH=`git_branch_exists "$AR_COMPS/arduino" "idf-$IDF_BRANCH"`
10-
if [ "$ARDUINO_HAS_BRANCH" == "1" ]; then
11-
ARDUINO_BRANCH="idf-$IDF_BRANCH"
15+
16+
if [ -z $AR_BRANCH ]; then
17+
has_ar_branch=`git_branch_exists "$AR_COMPS/arduino" "idf-$IDF_BRANCH"`
18+
if [ "$has_ar_branch" == "1" ]; then
19+
export AR_BRANCH="idf-$IDF_BRANCH"
20+
fi
1221
fi
1322

1423
if [ ! -d "$AR_COMPS/arduino" ]; then
15-
git clone $AR_REPO_URL "$AR_COMPS/arduino" -b $ARDUINO_BRANCH
16-
else
17-
git -C "$AR_COMPS/arduino" checkout $ARDUINO_BRANCH && \
18-
git -C "$AR_COMPS/arduino" fetch origin && \
19-
git -C "$AR_COMPS/arduino" pull origin $ARDUINO_BRANCH
24+
git clone $AR_REPO_URL "$AR_COMPS/arduino"
25+
if [ "$AR_BRANCH" ]; then
26+
git -C "$AR_COMPS/arduino" checkout "$AR_BRANCH"
27+
fi
2028
fi
2129
if [ $? -ne 0 ]; then exit 1; fi
22-
git -C "$AR_COMPS/arduino" submodule update --init --recursive
2330

2431
#
2532
# CLONE/UPDATE ESP32-CAMERA
@@ -28,8 +35,12 @@ git -C "$AR_COMPS/arduino" submodule update --init --recursive
2835
if [ ! -d "$AR_COMPS/esp32-camera" ]; then
2936
git clone $CAMERA_REPO_URL "$AR_COMPS/esp32-camera"
3037
else
31-
git -C "$AR_COMPS/esp32-camera" fetch origin && \
32-
git -C "$AR_COMPS/esp32-camera" pull origin master
38+
git -C "$AR_COMPS/esp32-camera" fetch && \
39+
git -C "$AR_COMPS/esp32-camera" pull --ff-only
40+
fi
41+
#this is a temp measure to fix build issue in recent IDF master
42+
if [ -f "$AR_COMPS/esp32-camera/idf_component.yml" ]; then
43+
rm -rf "$AR_COMPS/esp32-camera/idf_component.yml"
3344
fi
3445
if [ $? -ne 0 ]; then exit 1; fi
3546

@@ -40,7 +51,56 @@ if [ $? -ne 0 ]; then exit 1; fi
4051
if [ ! -d "$AR_COMPS/esp-face" ]; then
4152
git clone $FACE_REPO_URL "$AR_COMPS/esp-face"
4253
else
43-
git -C "$AR_COMPS/esp-face" fetch origin && \
44-
git -C "$AR_COMPS/esp-face" pull origin master
54+
git -C "$AR_COMPS/esp-face" fetch && \
55+
git -C "$AR_COMPS/esp-face" pull --ff-only
56+
fi
57+
if [ $? -ne 0 ]; then exit 1; fi
58+
59+
#
60+
# CLONE/UPDATE ESP-LITTLEFS
61+
#
62+
63+
if [ ! -d "$AR_COMPS/esp_littlefs" ]; then
64+
git clone $LITTLEFS_REPO_URL "$AR_COMPS/esp_littlefs" && \
65+
git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive
66+
else
67+
git -C "$AR_COMPS/esp_littlefs" fetch && \
68+
git -C "$AR_COMPS/esp_littlefs" pull --ff-only && \
69+
git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive
70+
fi
71+
if [ $? -ne 0 ]; then exit 1; fi
72+
73+
#
74+
# CLONE/UPDATE ESP-RAINMAKER
75+
#
76+
77+
if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then
78+
git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker"
79+
git -C "$AR_COMPS/esp-rainmaker" checkout f1b82c71c4536ab816d17df016d8afe106bd60e3
80+
fi
81+
if [ $? -ne 0 ]; then exit 1; fi
82+
83+
#
84+
# CLONE/UPDATE ESP-DSP
85+
#
86+
87+
if [ ! -d "$AR_COMPS/esp-dsp" ]; then
88+
git clone $DSP_REPO_URL "$AR_COMPS/esp-dsp"
89+
else
90+
git -C "$AR_COMPS/esp-dsp" fetch && \
91+
git -C "$AR_COMPS/esp-dsp" pull --ff-only
4592
fi
4693
if [ $? -ne 0 ]; then exit 1; fi
94+
95+
#
96+
# CLONE/UPDATE TINYUSB
97+
#
98+
99+
if [ ! -d "$AR_COMPS/arduino_tinyusb/tinyusb" ]; then
100+
git clone $TINYUSB_REPO_URL "$AR_COMPS/arduino_tinyusb/tinyusb"
101+
else
102+
git -C "$AR_COMPS/arduino_tinyusb/tinyusb" fetch && \
103+
git -C "$AR_COMPS/arduino_tinyusb/tinyusb" pull --ff-only
104+
fi
105+
if [ $? -ne 0 ]; then exit 1; fi
106+

0 commit comments

Comments
 (0)
Please sign in to comment.