Skip to content
Merged

sync #182

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ESP32C5/sdkconfig* text eol=lf
*.sh text eol=lf
6 changes: 3 additions & 3 deletions .github/scripts/container_build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

IMAGE="${IDF_DOCKER_IMAGE:-espressif/idf:v6.0-beta1}"
IMAGE="${IDF_DOCKER_IMAGE:-espressif/idf:release-v6.0}"
USE_DOCKER="${USE_DOCKER:-1}"

SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
Expand All @@ -14,8 +14,8 @@ usage() {
cat <<'EOF'
Usage: container_build.sh [--no-docker]

Builds ESP32C5 firmware using esp-idf release/v6.0.
Defaults to running inside Docker (espressif/idf:v6.0-beta1).
Builds ESP32C5 firmware using esp-idf release-v6.0.
Defaults to running inside Docker (espressif/idf:release-v6.0).

Options:
--no-docker Run idf.py directly (for GitHub Actions container job or host with esp-idf installed)
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/esp32c5-build-master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ESP32C5 Build (IDF 6.0-beta1)
name: ESP32C5 Build (IDF 6.0)

on:
workflow_dispatch:
Expand Down Expand Up @@ -34,12 +34,12 @@ jobs:
uses: actions/cache@v5
with:
path: /root/.espressif
key: espidf-6.0-${{ runner.os }}-${{ hashFiles('ESP32C5/sdkconfig', 'ESP32C5/dependencies.lock') }}
key: espidf-release-v6.0-${{ runner.os }}-${{ hashFiles('ESP32C5/sdkconfig', 'ESP32C5/dependencies.lock') }}
restore-keys: |
espidf-6.0-${{ runner.os }}-
espidf-6.0-
espidf-release-v6.0-${{ runner.os }}-
espidf-release-v6.0-

- name: Build JanOS (IDF 6.0)
- name: Build JanOS (IDF 6.0 stable)
run: IDF_PY_FLAGS="--preview" bash .github/scripts/container_build.sh --no-docker

- name: Stamp JanOS with JANOS_VERSION
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/esp32c5-build-release-no-discord.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
contents: write
runs-on: ubuntu-24.04
container:
image: espressif/idf:v6.0-beta1
image: espressif/idf:release-v6.0
outputs:
fw_version: ${{ steps.version.outputs.version }}
steps:
Expand All @@ -25,12 +25,12 @@ jobs:
uses: actions/cache@v5
with:
path: /root/.espressif
key: espidf-6.0-${{ runner.os }}-${{ hashFiles('ESP32C5/sdkconfig', 'ESP32C5/dependencies.lock') }}
key: espidf-release-v6.0-${{ runner.os }}-${{ hashFiles('ESP32C5/sdkconfig', 'ESP32C5/dependencies.lock') }}
restore-keys: |
espidf-6.0-${{ runner.os }}-
espidf-6.0-
espidf-release-v6.0-${{ runner.os }}-
espidf-release-v6.0-

- name: Build JanOS (IDF 6.0)
- name: Build JanOS (IDF 6.0 stable)
run: IDF_PY_FLAGS="--preview" bash .github/scripts/container_build.sh --no-docker

- name: Stamp JanOS with JANOS_VERSION
Expand Down
Binary file modified ESP32C5/binaries-esp32c5/bootloader.bin
Binary file not shown.
Binary file modified ESP32C5/binaries-esp32c5/projectZero.bin
Binary file not shown.
10 changes: 5 additions & 5 deletions ESP32C5/dependencies.lock
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
dependencies:
espressif/cjson:
component_hash: 9372811fb197926f522c467627cf4a8e72b681e0366e17879631da801103aef3
component_hash: e788323270d90738662d66fffa910bfe1fba019bba087f01557e70c40485b469
dependencies:
- name: idf
require: private
version: '>=5.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 1.7.19
version: 1.7.19~2
espressif/led_strip:
component_hash: 223998f10cae6d81f2ad2dd3c1103c2221be298c708e37917482b0153f3ec64e
component_hash: 28621486f77229aaf81c71f5e15d6fbf36c2949cf11094e07090593e659e7639
dependencies:
- name: idf
require: private
version: '>=5.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 3.0.1~1
version: 3.0.3
idf:
source:
type: idf
Expand All @@ -35,6 +35,6 @@ direct_dependencies:
- espressif/led_strip
- idf
- lvgl/lvgl
manifest_hash: 89e75097ea075918e3fbc38d77518f549464abde71bb4b324ee57eab5d7eca45
manifest_hash: ff5887322bf4426c782eb34c881d82e15c72c6f33497e602ba96ff772d05560e
target: esp32c5
version: 3.0.0
2 changes: 1 addition & 1 deletion ESP32C5/main/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ dependencies:
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
espressif/led_strip: '>=3.0.0,<4.0.0'
espressif/led_strip: '3.0.3'
espressif/cjson: '>=1.7.19,<2.0.0'
lvgl/lvgl: "9.2.0"
34 changes: 31 additions & 3 deletions ESP32C5/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,20 @@
#include "esp_random.h"
#include "mbedtls/ecp.h"
#include "mbedtls/bignum.h"
#include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/base64.h"
#if defined(__has_include)
#if __has_include("mbedtls/ctr_drbg.h")
#include "mbedtls/ctr_drbg.h"
#define HAS_MBEDTLS_CTR_DRBG 1
#elif __has_include("mbedtls/private/ctr_drbg.h")
#include "mbedtls/private/ctr_drbg.h"
#define HAS_MBEDTLS_CTR_DRBG 1
#else
#define HAS_MBEDTLS_CTR_DRBG 0
#endif
#else
#define HAS_MBEDTLS_CTR_DRBG 0
#endif
#include "esp_timer.h"
#include "esp_app_format.h"

Expand Down Expand Up @@ -1524,7 +1536,9 @@ static int64_t start_time = 0;
static mbedtls_ecp_group ecc_group; // grupa ECC (secp256r1)
static mbedtls_ecp_point ecc_element; // bieżący element (punkt ECC)
static mbedtls_mpi ecc_scalar; // bieżący skalar
#if HAS_MBEDTLS_CTR_DRBG
static mbedtls_ctr_drbg_context ctr_drbg;
#endif

/* Router BSSID */
static uint8_t bssid[6] = { 0x30, 0xAA, 0xE4, 0x3C, 0x3F, 0x68};
Expand Down Expand Up @@ -17327,8 +17341,8 @@ static int trng_random_callback(void *ctx, unsigned char *output, size_t len) {

static int crypto_init(void) {
int ret;
#if HAS_MBEDTLS_CTR_DRBG
const char *pers = "dragon_drain";

mbedtls_ctr_drbg_init(&ctr_drbg);

// TRNG as entropy source
Expand All @@ -17341,6 +17355,7 @@ static int crypto_init(void) {
ESP_LOGE(TAG, "mbedtls_ctr_drbg_seed failed: %d", ret);
return ret;
}
#endif

mbedtls_ecp_group_init(&ecc_group);
mbedtls_ecp_point_init(&ecc_element);
Expand All @@ -17360,7 +17375,12 @@ static int crypto_init(void) {
* Random MAC for client overflow attack.
*/
static void update_spoofed_src_random(void) {
esp_err_t ret = mbedtls_ctr_drbg_random(&ctr_drbg, spoofed_src, 6);
int ret;
#if HAS_MBEDTLS_CTR_DRBG
ret = mbedtls_ctr_drbg_random(&ctr_drbg, spoofed_src, 6);
#else
ret = trng_random_callback(NULL, spoofed_src, 6);
#endif
if (ret != 0) {
ESP_LOGE(TAG, "Unable to generate random MAC: %d", ret);
return;
Expand Down Expand Up @@ -17460,7 +17480,11 @@ void inject_sae_commit_frame() {
size_t scalar_size = 32;

do {
#if HAS_MBEDTLS_CTR_DRBG
ret = mbedtls_mpi_fill_random(&ecc_scalar, scalar_size, mbedtls_ctr_drbg_random, &ctr_drbg);
#else
ret = mbedtls_mpi_fill_random(&ecc_scalar, scalar_size, trng_random_callback, NULL);
#endif
if (ret != 0) {
ESP_LOGE(TAG, "mbedtls_mpi_fill_random failed: %d", ret);
return;
Expand All @@ -17475,7 +17499,11 @@ void inject_sae_commit_frame() {
}
pos += scalar_size;

#if HAS_MBEDTLS_CTR_DRBG
ret = mbedtls_ecp_mul(&ecc_group, &ecc_element, &ecc_scalar, &ecc_group.G, mbedtls_ctr_drbg_random, &ctr_drbg);
#else
ret = mbedtls_ecp_mul(&ecc_group, &ecc_element, &ecc_scalar, &ecc_group.G, trng_random_callback, NULL);
#endif
if (ret != 0) {
ESP_LOGE(TAG, "mbedtls_ecp_mul failed: %d", ret);
return;
Expand Down
56 changes: 45 additions & 11 deletions ESP32C5/sdkconfig
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ CONFIG_SOC_APM_SUPPORTED=y
# default:
CONFIG_SOC_PMU_SUPPORTED=y
# default:
CONFIG_SOC_PMU_PVT_SUPPORTED=y
# default:
CONFIG_SOC_PAU_SUPPORTED=y
# default:
CONFIG_SOC_RTC_TIMER_V2_SUPPORTED=y
Expand Down Expand Up @@ -523,23 +525,17 @@ CONFIG_SOC_SPI_MEM_SUPPORT_CHECK_SUS=y
# default:
CONFIG_SOC_SPI_MEM_SUPPORT_WRAP=y
# default:
CONFIG_SOC_SPI_MEM_SUPPORT_WB_MODE_INDEPENDENT_CONTROL=y
# default:
CONFIG_SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP=y
# default:
CONFIG_SOC_SPI_MEM_SUPPORT_TIMING_TUNING=y
# default:
CONFIG_SOC_SPI_MEM_SUPPORT_TSUS_TRES_SEPERATE_CTR=y
# default:
CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY=y
# default:
CONFIG_SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED=y
CONFIG_SOC_SPI_MEM_FLASH_SUPPORT_HPM=y
# default:
CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y
# default:
CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y
CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY=y
# default:
CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y
CONFIG_SOC_MEMSPI_ENCRYPTION_ALIGNMENT=16
# default:
CONFIG_SOC_SYSTIMER_COUNTER_NUM=2
# default:
Expand Down Expand Up @@ -575,6 +571,8 @@ CONFIG_SOC_TWAI_MASK_FILTER_NUM=3
# default:
CONFIG_SOC_TWAI_RANGE_FILTER_NUM=1
# default:
CONFIG_SOC_TWAI_SUPPORT_SLEEP_RETENTION=y
# default:
CONFIG_SOC_EFUSE_DIS_PAD_JTAG=y
# default:
CONFIG_SOC_EFUSE_DIS_USB_JTAG=y
Expand Down Expand Up @@ -631,8 +629,14 @@ CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_256=y
# default:
CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_SUPPORT_PSEUDO_ROUND=y
# default:
CONFIG_SOC_FLASH_ENCRYPTION_PAGE_CONFIGURABLE=y
# default:
CONFIG_SOC_PSRAM_ENCRYPTION_XTS_AES_128=y
# default:
CONFIG_SOC_PSRAM_ENCRYPTION_SEPARATE_KEY=y
# default:
CONFIG_SOC_PSRAM_ENCRYPTION_PAGE_CONFIGURABLE=y
# default:
CONFIG_SOC_RECOVERY_BOOTLOADER_SUPPORTED=y
# default:
CONFIG_SOC_BOOTLOADER_ANTI_ROLLBACK_SUPPORTED=y
Expand Down Expand Up @@ -803,6 +807,8 @@ CONFIG_SOC_WIFI_NAN_SUPPORT=y
# default:
CONFIG_SOC_BLE_SUPPORTED=y
# default:
CONFIG_SOC_BLE_MESH_SUPPORTED=y
# default:
CONFIG_SOC_ESP_NIMBLE_CONTROLLER=y
# default:
CONFIG_SOC_BLE_50_SUPPORTED=y
Expand Down Expand Up @@ -868,6 +874,11 @@ CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y
# CONFIG_APP_NO_BLOBS is not set
# end of Build type

#
# App Update config
#
# end of App Update config

#
# Bootloader config
#
Expand Down Expand Up @@ -1398,6 +1409,8 @@ CONFIG_BT_NIMBLE_TRANSPORT_EVT_COUNT=30
CONFIG_BT_NIMBLE_TRANSPORT_EVT_DISCARD_COUNT=8
# default:
CONFIG_BT_NIMBLE_L2CAP_COC_SDU_BUFF_COUNT=1
# default:
# CONFIG_BT_NIMBLE_MEMPOOL_RUNTIME_ALLOC is not set
# end of Memory Settings

#
Expand Down Expand Up @@ -1833,6 +1846,8 @@ CONFIG_BT_LE_DFT_SYNC_SCHED_PRIO_LEVEL=1
# CONFIG_BT_LE_CTRL_SLV_FAST_RX_CONN_DATA_EN is not set
# default:
# CONFIG_BT_LE_CTRL_DL_ITVL_PHY_SYNC_EN is not set
# default:
# CONFIG_BT_LE_CTRL_ADV_FAST_TX_EN is not set
# end of Controller Options

#
Expand Down Expand Up @@ -2261,6 +2276,8 @@ CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
# CONFIG_ESP_HTTP_CLIENT_ENABLE_GET_CONTENT_RANGE is not set
# default:
CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000
# default:
# CONFIG_ESP_HTTP_CLIENT_SAVE_RESPONSE_HEADERS is not set
# end of ESP HTTP client

#
Expand Down Expand Up @@ -2472,6 +2489,8 @@ CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y
# default:
CONFIG_ESP_CLK_RC32K_NOT_TO_USE=y
# default:
CONFIG_ESP_ENABLE_PVT=y
# default:
CONFIG_ESP_INTR_IN_IRAM=y
# end of Hardware Settings

Expand Down Expand Up @@ -3009,6 +3028,8 @@ CONFIG_ESP_WIFI_TX_HETB_QUEUE_NUM=3
CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y
# default:
# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set
# default:
# CONFIG_ESP_WIFI_PASSIVE_HIDDEN_AP_SUPPORT is not set
# end of Wi-Fi

#
Expand Down Expand Up @@ -3306,11 +3327,11 @@ CONFIG_IEEE802154_PENDING_TABLE_SIZE=20
# default:
# CONFIG_IEEE802154_MULTI_PAN_ENABLE is not set
# default:
CONFIG_IEEE802154_INTERFACE_NUM=1
# default:
CONFIG_IEEE802154_TIMING_OPTIMIZATION=y
# default:
# CONFIG_IEEE802154_DEBUG is not set
# default:
# CONFIG_IEEE802154_DEBUG_ASSERT_MONITOR is not set
# end of IEEE 802.15.4

#
Expand Down Expand Up @@ -4111,6 +4132,8 @@ CONFIG_MBEDTLS_PKCS1_V21=y
# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set
# default:
# CONFIG_NVS_BDL_STACK is not set
# default:
# CONFIG_NVS_FLASH_VERIFY_ERASE is not set
# end of NVS

#
Expand Down Expand Up @@ -4398,6 +4421,8 @@ CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y
CONFIG_VFS_SUPPORT_TERMIOS=y
# default:
CONFIG_VFS_MAX_COUNT=8
# default:
# CONFIG_VFS_SUPPRESS_CTX_DEPRECATION is not set

#
# Host File System I/O (Semihosting)
Expand All @@ -4421,6 +4446,15 @@ CONFIG_WL_SECTOR_SIZE_4096=y
CONFIG_WL_SECTOR_SIZE=4096
# end of Wear Levelling

#
# cJSON
#
# default:
CONFIG_CJSON_NESTING_LIMIT=1000
# default:
CONFIG_CJSON_CIRCULAR_LIMIT=10000
# end of cJSON

#
# LVGL configuration
#
Expand Down
Loading
Loading