diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38f885419..d0bd6ba56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -422,6 +422,7 @@ jobs: make ESP32_CHIP=esp32s2 esp32 make ESP32_CHIP=esp32s3 esp32 make ESP32_CHIP=esp32s3-spiram-octo esp32 + make ESP32_CHIP=esp32-eth-clk-out17 esp32 - name: Pack firmware artifacts shell: bash @@ -431,6 +432,7 @@ jobs: gzip --to-stdout build/esp32s2/firmware.envelope > build/firmware-esp32s2.gz gzip --to-stdout build/esp32s3/firmware.envelope > build/firmware-esp32s3.gz gzip --to-stdout build/esp32s3-spiram-octo/firmware.envelope > build/firmware-esp32s3-spiram-octo.gz + gzip --to-stdout build/esp32-eth-clk-out17/firmware.envelope > build/firmware-esp32-eth-clk-out17.gz - name: Upload firmware artifacts uses: actions/upload-artifact@v3 @@ -442,6 +444,7 @@ jobs: build/firmware-esp32s2.gz build/firmware-esp32s3.gz build/firmware-esp32s3-spiram-octo.gz + build/firmware-esp32-eth-clk-out17.gz - name: Upload ESP32 release firmware artifacts if: | @@ -498,6 +501,17 @@ jobs: tag: ${{ github.ref }} overwrite: true + - name: Upload ESP32-eth-clk-out17 release firmware artifacts + if: | + github.event_name == 'release' && + github.repository_owner == 'toitlang' + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/firmware-esp32-eth-clk-out17.gz + tag: ${{ github.ref }} + overwrite: true + # Really annoying that we need to duplicate so much. cross: runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index b2b2e1f2c..a3dbd1277 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ tedi_test.go /toolchains/esp32*/sdkconfig /toolchains/esp32*/sdkconfig.old +/toolchains/esp32*/dependencies.lock diff --git a/Makefile b/Makefile index 5b96ec842..fc65c6ba8 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,8 @@ ESP32_SYSTEM_ENTRY=system/extensions/esp32/boot.toit ifeq ($(ESP32_CHIP),esp32s3-spiram-octo) IDF_TARGET=esp32s3 +else ifeq ($(ESP32_CHIP),esp32-eth-clk-out17) + IDF_TARGET=esp32 else IDF_TARGET=$(ESP32_CHIP) endif diff --git a/toolchains/esp32-eth-clk-out17/CMakeLists.txt b/toolchains/esp32-eth-clk-out17/CMakeLists.txt new file mode 100644 index 000000000..393e96366 --- /dev/null +++ b/toolchains/esp32-eth-clk-out17/CMakeLists.txt @@ -0,0 +1,10 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.5) + +list(APPEND EXTRA_COMPONENT_DIRS "../idf/components") + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(toit) + +toit_postprocess() diff --git a/toolchains/esp32-eth-clk-out17/main/CMakeLists.txt b/toolchains/esp32-eth-clk-out17/main/CMakeLists.txt new file mode 100644 index 000000000..a971fcd20 --- /dev/null +++ b/toolchains/esp32-eth-clk-out17/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "toit.c" + INCLUDE_DIRS "") diff --git a/toolchains/esp32-eth-clk-out17/main/toit.c b/toolchains/esp32-eth-clk-out17/main/toit.c new file mode 100644 index 000000000..f4aefc09d --- /dev/null +++ b/toolchains/esp32-eth-clk-out17/main/toit.c @@ -0,0 +1,22 @@ +// Copyright (C) 2018 Toitware ApS. +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; version +// 2.1 only. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// The license can be found in the file `LICENSE` in the top level +// directory of this repository. + +// Toit ESP32 top level, derived from ESP-IDF Hello World example. + +extern void toit_start(); + +void app_main() { + toit_start(); +} diff --git a/toolchains/esp32-eth-clk-out17/partitions.csv b/toolchains/esp32-eth-clk-out17/partitions.csv new file mode 100644 index 000000000..71d4a8fac --- /dev/null +++ b/toolchains/esp32-eth-clk-out17/partitions.csv @@ -0,0 +1,27 @@ +# Copyright (C) 2021 Toitware ApS. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; version +# 2.1 only. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# The license can be found in the file `LICENSE` in the top level +# directory of this repository. + +# Partition Table for Toit. + +# Name, Type, SubType, Offset, Size +# bootloader,, , 0x001000, 0x007000 +# partitions,, , 0x008000, 0x000c00 +secure, 0x42, 0x00, 0x009000, 0x004000, +otadata, data, ota, 0x00d000, 0x002000, +phy_init, data, phy, 0x00f000, 0x001000, +ota_0, app, ota_0, 0x010000, 0x1a0000, +ota_1, app, ota_1, 0x1b0000, 0x1a0000, +nvs, data, nvs, 0x350000, 0x010000, +programs, 0x40, 0x00, 0x360000, 0x0a0000, encrypted diff --git a/toolchains/esp32-eth-clk-out17/sdkconfig.defaults b/toolchains/esp32-eth-clk-out17/sdkconfig.defaults new file mode 100644 index 000000000..e178ff3ed --- /dev/null +++ b/toolchains/esp32-eth-clk-out17/sdkconfig.defaults @@ -0,0 +1,97 @@ +# CONFIG_APP_COMPILE_TIME_DATE is not set +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y +CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_BLE_MAX_CONN=2 +CONFIG_BTDM_CTRL_PINNED_TO_CORE_1=y +# CONFIG_BTDM_CTRL_MODEM_SLEEP is not set +# CONFIG_BTDM_BLE_SCAN_DUPL is not set +CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM=50 +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_DEFAULT=y +CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y +CONFIG_BT_NIMBLE_MAX_CONNECTIONS=2 +CONFIG_BT_NIMBLE_MAX_BONDS=4 +CONFIG_BT_NIMBLE_MAX_CCCDS=3 +CONFIG_BT_NIMBLE_PINNED_TO_CORE_1=y +CONFIG_BT_NIMBLE_ROLE_PERIPHERAL=y +CONFIG_BT_NIMBLE_NVS_PERSIST=y +CONFIG_BT_NIMBLE_SVC_GAP_DEVICE_NAME="toit" +CONFIG_BT_NIMBLE_SVC_GAP_APPEARANCE=0x0 +CONFIG_BT_NIMBLE_ACL_BUF_COUNT=10 +# CONFIG_SPI_SLAVE_ISR_IN_IRAM is not set +CONFIG_UART_ISR_IN_IRAM=y +CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32_SPIRAM_SUPPORT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +CONFIG_SPIRAM_USE_CAPS_ALLOC=y +# CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM is not set +# CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM is not set +# CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM is not set +# CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM is not set +# CONFIG_ESP32_DEBUG_OCDAWARE is not set +# CONFIG_ESP32_BROWNOUT_DET is not set +CONFIG_ESP32_XTAL_FREQ_AUTO=y +# CONFIG_ADC_CAL_EFUSE_TP_ENABLE is not set +# CONFIG_ADC_CAL_LUT_ENABLE is not set +# CONFIG_ETH_RMII_CLK_INPUT is not set +CONFIG_ETH_RMII_CLK_OUTPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT_GPIO0 is not set +CONFIG_ETH_RMII_CLK_OUT_GPIO=17 +CONFIG_ETH_SPI_ETHERNET_DM9051=y +CONFIG_ETH_SPI_ETHERNET_W5500=y +CONFIG_ETH_USE_OPENETH=y +# CONFIG_ESP_ERR_TO_NAME_LOOKUP is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS is not set +CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y +CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 +# CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER is not set +# CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE is not set +# CONFIG_ESP_INT_WDT is not set +# CONFIG_ESP_TASK_WDT is not set +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=16 +# CONFIG_ESP32_WIFI_NVS_ENABLED is not set +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1=y +# CONFIG_FMB_CONTROLLER_SLAVE_ID_SUPPORT is not set +CONFIG_FMB_TIMER_PORT_ENABLED=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=3 +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024 +CONFIG_FREERTOS_ISR_STACKSIZE=2096 +CONFIG_FREERTOS_USE_TRACE_FACILITY=y +CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y +CONFIG_LOG_DEFAULT_LEVEL_ERROR=y +# CONFIG_LOG_COLORS is not set +CONFIG_LWIP_LOCAL_HOSTNAME="toit" +# CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES is not set +CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y +CONFIG_LWIP_TCP_SYNMAXRTX=6 +CONFIG_LWIP_TCP_MSS=1410 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5640 +CONFIG_LWIP_TCP_WND_DEFAULT=5640 +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=2560 +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=7800 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=3700 +# CONFIG_MBEDTLS_HARDWARE_MPI is not set +CONFIG_MBEDTLS_TLS_CLIENT_ONLY=y +CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK=y +# CONFIG_MBEDTLS_SSL_PROTO_TLS1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 is not set +CONFIG_MBEDTLS_SSL_PROTO_DTLS=n +CONFIG_MBEDTLS_POLY1305_C=y +CONFIG_MBEDTLS_CHACHA20_C=y +CONFIG_MBEDTLS_CHACHAPOLY_C=y +# CONFIG_MQTT_PROTOCOL_311 is not set +# CONFIG_MQTT_TRANSPORT_SSL is not set +# CONFIG_MQTT_TRANSPORT_WEBSOCKET is not set +CONFIG_OPENSSL_ASSERT_DO_NOTHING=y +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 +CONFIG_SPI_FLASH_VERIFY_WRITE=y +CONFIG_SPI_FLASH_LOG_FAILED_WRITE=y +CONFIG_SPI_FLASH_WARN_SETTING_ZERO_TO_ONE=y +# CONFIG_WIFI_PROV_BLE_BONDING is not set +CONFIG_FATFS_LFN_HEAP=y diff --git a/toolchains/esp32/sdkconfig.defaults b/toolchains/esp32/sdkconfig.defaults index 522591e09..dd34bddb8 100644 --- a/toolchains/esp32/sdkconfig.defaults +++ b/toolchains/esp32/sdkconfig.defaults @@ -39,10 +39,10 @@ CONFIG_SPIRAM_USE_CAPS_ALLOC=y CONFIG_ESP32_XTAL_FREQ_AUTO=y # CONFIG_ADC_CAL_EFUSE_TP_ENABLE is not set # CONFIG_ADC_CAL_LUT_ENABLE is not set -# CONFIG_ESP_ERR_TO_NAME_LOOKUP is not set CONFIG_ETH_SPI_ETHERNET_DM9051=y CONFIG_ETH_SPI_ETHERNET_W5500=y CONFIG_ETH_USE_OPENETH=y +# CONFIG_ESP_ERR_TO_NAME_LOOKUP is not set # CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS is not set CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y CONFIG_ESP_IPC_TASK_STACK_SIZE=1024