Skip to content

Commit

Permalink
Add target ESP32-C2 (#149)
Browse files Browse the repository at this point in the history
* Add c2 (#70)

* Adjust components and build strategy

* enable rev 2 chips (preview)

---------

Co-authored-by: me-no-dev <hristo@espressif.com>
Co-authored-by: Jan Prochazka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 21, 2023
1 parent af683ec commit 9234dd9
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
target: [esp32, esp32s2, esp32s3, esp32c3, esp32c6, esp32h2]
target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2]
fail-fast: false
steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,20 @@ echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/
#targets_count=`jq -c '.targets[] | length' configs/builds.json`
for target_json in `jq -c '.targets[]' configs/builds.json`; do
target=$(echo "$target_json" | jq -c '.target' | tr -d '"')
target_skip=$(echo "$target_json" | jq -c '.skip // 0')

if [ "$TARGET" != "all" ] && [ "$TARGET" != "$target" ]; then
echo "* Skipping Target: $target"
continue
fi

# Skip chips that should not be a part of the final libs
# WARNING!!! this logic needs to be updated when cron builds are split into jobs
if [ "$TARGET" = "all" ] && [ $target_skip -eq 1 ]; then
echo "* Skipping Target: $target"
continue
fi

echo "* Target: $target"

# Build Main Configs List
Expand Down
19 changes: 17 additions & 2 deletions configs/builds.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"file":"libspi_flash.a",
"src":"build/esp-idf/spi_flash/libspi_flash.a",
"out":"lib/libspi_flash.a",
"targets":["esp32","esp32c3","esp32s2","esp32s3","esp32c6","esp32h2"]
"targets":["esp32","esp32c2","esp32c3","esp32s2","esp32s3","esp32c6","esp32h2"]
},
{
"file":"libesp_psram.a",
Expand Down Expand Up @@ -44,6 +44,21 @@
}
],
"targets":[
{
"target": "esp32c2",
"skip": 1,
"features":[],
"idf_libs":["qio","60m"],
"bootloaders":[
["qio","60m"],
["dio","60m"],
["qio","30m"],
["dio","30m"]
],
"mem_variants":[
["dio","60m"]
]
},
{
"target": "esp32h2",
"features":[],
Expand Down Expand Up @@ -133,4 +148,4 @@
]
}
]
}
}
1 change: 1 addition & 0 deletions configs/defconfig.30m
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ESPTOOLPY_FLASHFREQ_30M=y
1 change: 1 addition & 0 deletions configs/defconfig.60m
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_ESPTOOLPY_FLASHFREQ_60M=y
7 changes: 7 additions & 0 deletions configs/defconfig.esp32c2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_XTAL_FREQ_26=y
CONFIG_XTAL_FREQ=26
CONFIG_BT_BLE_BLUFI_ENABLE=y
CONFIG_RTC_CLK_CAL_CYCLES=576
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304
CONFIG_ESP32C2_REV2_DEVELOPMENT=y
2 changes: 2 additions & 0 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ config LIB_BUILDER_FLASHFREQ
default "120m" if ESPTOOLPY_FLASHFREQ_120M
default "80m" if ESPTOOLPY_FLASHFREQ_80M
default "64m" if ESPTOOLPY_FLASHFREQ_64M
default "60m" if ESPTOOLPY_FLASHFREQ_60M
default "40m" if ESPTOOLPY_FLASHFREQ_40M
default "32m" if ESPTOOLPY_FLASHFREQ_32M
default "30m" if ESPTOOLPY_FLASHFREQ_30M
default "26m" if ESPTOOLPY_FLASHFREQ_26M
default "20m" if ESPTOOLPY_FLASHFREQ_20M
default "16m" if ESPTOOLPY_FLASHFREQ_16M
Expand Down
4 changes: 4 additions & 0 deletions main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ dependencies:
version: "master"
git: /~https://github.com/espressif/esp32-camera.git
require: public
rules:
- if: "target in [esp32, esp32s2, esp32s3]"
espressif/esp-tflite-micro:
version: ">=1.2.0"
require: public
rules:
- if: "target not in [esp32c2]"
espressif/esp-dl:
version: "master"
git: /~https://github.com/espressif/esp-dl.git
Expand Down

2 comments on commit 9234dd9

@Jason2866
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@me-no-dev is it intended that the CI workflow is running against Arduino branch idf-release/v5.1? Or is it a left over before it was merged in branch master?

@me-no-dev
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that branch is created by the lib-builder. It makes sense if it exists, to be used. Just need to pull master into it and c2 will compile.

Please sign in to comment.