Skip to content

Commit

Permalink
Espressif master (#28)
Browse files Browse the repository at this point in the history
* Enable configuring target variants (espressif#7019)

This change enables picking the right board configuration from the
variants/ folder. Previously, we would always pick the default
configuration (e.g., "esp32" instead of "heltec_wifi_lora_32_V2").

* Update .gitignore (espressif#7021)

Add entries to gitignore

* Update esptool to version 4.2.1 (espressif#7127)

* Update esptool to version 4.2.1

* Fix esptool for MacOS

* Esptool v4.2.1 for CI Platformio (espressif#7147)

to complete the test.

Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com>

* Update get.py to support python 3.10+ (espressif#7166)

* Update get.py to support python 3.10+

* Use try/except to remove version check

* fixed names on the VID and PID for boards (espressif#7144)

somehow had duplicated the same name across all my boards. the PID's and VID's were correct, but the name was the same for all of them. that is fixed now.

* Compile error if CONFIG_FREERTOS_HZ != 1000 (espressif#6955)

* Compile error if CONFIG_FREERTOS_HZ != 1000
* add a check at the CMake level, per feedback
* Set CONFIG_FREERTOS_HZ=1000 in CI test of Arduino-as-component

* Adding u-blox NORA-W10 series (ESP32-S3) (espressif#7191)

* Create pins_arduino.h

* Update boards.txt

* Update boards.txt

* Fixed espressif/esp-rainmaker#152 (espressif#7171)

* Update PlatformIO build scripts (espressif#7200)

This update includes the following:

- Implemented an additional build step that produces an adjusted bootloader image with updated headers
  according to  selected flash mode and size values. This step is only executed for debugging or uploading
  via debug probes.

- Implemented a basic mechanism to dynamically add an extra UF2 bootloader image if corresponding
  partition is selected (e.g. for Adafruit targets)

- Minor code formatting

Co-authored-by: Dr. Christian Kohlschütter <christian@kohlschutter.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: Paul Price <56952812+strid3r21@users.noreply.github.com>
Co-authored-by: Daniel Egnor <egnor@ofb.net>
Co-authored-by: Michael Ammann <mazgch@users.noreply.github.com>
Co-authored-by: Sanket Wadekar <67091512+sanketwadekar@users.noreply.github.com>
Co-authored-by: Valerii Koval <valeros@users.noreply.github.com>
  • Loading branch information
8 people authored Sep 6, 2022
1 parent c944566 commit 63aacba
Show file tree
Hide file tree
Showing 13 changed files with 584 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/on-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ else
replace_script+="data['packages']['toolchain-xtensa-esp32']['optional']=True;"
replace_script+="data['packages']['toolchain-xtensa-esp32s3']['optional']=False;"
replace_script+="data['packages']['tool-esptoolpy']['owner']='tasmota';"
replace_script+="data['packages']['tool-esptoolpy']['version']='https://github.com/tasmota/esptool/releases/download/v3.3/esptool-3.3.zip';"
replace_script+="data['packages']['tool-esptoolpy']['version']='https://github.com/tasmota/esptool/releases/download/v4.2.1/esptool-4.2.1.zip';"
replace_script+="fp.seek(0);fp.truncate();json.dump(data, fp, indent=2);fp.close()"
python -c "$replace_script"

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,5 @@ jobs:
run: |
. ${IDF_PATH}/export.sh
idf.py create-project test
echo CONFIG_FREERTOS_HZ=1000 > test/sdkconfig.defaults
idf.py -C test -DEXTRA_COMPONENT_DIRS=$PWD/components build
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ tools/esptool.exe
tools/mkspiffs
tools/mklittlefs
tools/mkfatfs.exe

# Ignore editor backup files and macOS system metadata
.DS_Store
.*.swp
.*.swo
*~

# Ignore build folder
/build

#Ignore files built by Visual Studio/Visual Micro
# Ignore files built by Visual Studio/Visual Micro
[Dd]ebug*/
[Rr]elease*/
.vs/
Expand Down
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ set(BLE_SRCS
)

set(includedirs
variants/${IDF_TARGET}/
variants/${CONFIG_ARDUINO_VARIANT}/
cores/esp32/
libraries/ArduinoOTA/src
libraries/AsyncUDP/src
Expand Down Expand Up @@ -202,13 +202,19 @@ set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support openssl b

idf_component_register(INCLUDE_DIRS ${includedirs} PRIV_INCLUDE_DIRS ${priv_includes} SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires})

string(TOUPPER ${CONFIG_IDF_TARGET} idf_target_caps)
if(NOT CONFIG_FREERTOS_HZ EQUAL 1000 AND NOT "$ENV{ARDUINO_SKIP_TICK_CHECK}")
# See delay() in cores/esp32/esp32-hal-misc.c.
message(FATAL_ERROR "esp32-arduino requires CONFIG_FREERTOS_HZ=1000 "
"(currently ${CONFIG_FREERTOS_HZ})")
endif()

string(TOUPPER ${CONFIG_ARDUINO_VARIANT} idf_target_caps)
target_compile_options(${COMPONENT_TARGET} PUBLIC
-DARDUINO=10812
-DARDUINO_${idf_target_caps}_DEV
-DARDUINO_ARCH_ESP32
-DARDUINO_BOARD="${idf_target_caps}_DEV"
-DARDUINO_VARIANT="${CONFIG_IDF_TARGET}"
-DARDUINO_VARIANT="${CONFIG_ARDUINO_VARIANT}"
-DESP32)

if(CONFIG_AUTOSTART_ARDUINO)
Expand Down
9 changes: 9 additions & 0 deletions Kconfig.projbuild
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
menu "Arduino Configuration"

config ARDUINO_VARIANT
string "Arduino target variant (board)"
default IDF_TARGET
help
The name of a target variant (e.g., a specific board) in the variants/
folder, e.g. "heltec_wifi_lora_32_V2". The name is case sensitive.
Specifying a variant name different from the target enables additional
customization, for example the definition of GPIO pins.

config ENABLE_ARDUINO_DEPENDS
bool
select LWIP_SO_RCVBUF
Expand Down
216 changes: 210 additions & 6 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4831,6 +4831,210 @@ nina_w10.menu.EraseFlash.all.upload.erase_cmd=-e

##############################################################

nora_w10.name=u-blox NORA-W10 series (ESP32-S3)
nora_w10.vid.0=0x303a
nora_w10.pid.0=0x1001

nora_w10.bootloader.tool=esptool_py
nora_w10.bootloader.tool.default=esptool_py

nora_w10.upload.tool=esptool_py
nora_w10.upload.tool.default=esptool_py
nora_w10.upload.tool.network=esp_ota

nora_w10.upload.maximum_size=1310720
nora_w10.upload.maximum_data_size=327680
nora_w10.upload.flags=
nora_w10.upload.extra_flags=
nora_w10.upload.use_1200bps_touch=false
nora_w10.upload.wait_for_upload_port=false

nora_w10.serial.disableDTR=false
nora_w10.serial.disableRTS=false

nora_w10.build.tarch=xtensa
nora_w10.build.bootloader_addr=0x0
nora_w10.build.target=esp32s3
nora_w10.build.mcu=esp32s3
nora_w10.build.core=esp32
nora_w10.build.variant=nora_w10
nora_w10.build.board=UBLOX_NORA_W10

nora_w10.build.usb_mode=1
nora_w10.build.cdc_on_boot=0
nora_w10.build.msc_on_boot=0
nora_w10.build.dfu_on_boot=0
nora_w10.build.f_cpu=240000000L
nora_w10.build.flash_size=4MB
nora_w10.build.flash_freq=80m
nora_w10.build.flash_mode=dio
nora_w10.build.boot=qio
nora_w10.build.boot_freq=80m
nora_w10.build.partitions=default
nora_w10.build.defines=
nora_w10.build.loop_core=
nora_w10.build.event_core=
nora_w10.build.psram_type=qspi
nora_w10.build.memory_type={build.boot}_{build.psram_type}

nora_w10.menu.PSRAM.disabled=Disabled
nora_w10.menu.PSRAM.disabled.build.defines=
nora_w10.menu.PSRAM.disabled.build.psram_type=qspi
nora_w10.menu.PSRAM.enabled=QSPI PSRAM
nora_w10.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM
nora_w10.menu.PSRAM.enabled.build.psram_type=qspi
nora_w10.menu.PSRAM.opi=OPI PSRAM
nora_w10.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM
nora_w10.menu.PSRAM.opi.build.psram_type=opi

nora_w10.menu.FlashMode.qio=QIO 80MHz
nora_w10.menu.FlashMode.qio.build.flash_mode=dio
nora_w10.menu.FlashMode.qio.build.boot=qio
nora_w10.menu.FlashMode.qio.build.boot_freq=80m
nora_w10.menu.FlashMode.qio.build.flash_freq=80m
nora_w10.menu.FlashMode.qio120=QIO 120MHz
nora_w10.menu.FlashMode.qio120.build.flash_mode=dio
nora_w10.menu.FlashMode.qio120.build.boot=qio
nora_w10.menu.FlashMode.qio120.build.boot_freq=120m
nora_w10.menu.FlashMode.qio120.build.flash_freq=80m
nora_w10.menu.FlashMode.dio=DIO 80MHz
nora_w10.menu.FlashMode.dio.build.flash_mode=dio
nora_w10.menu.FlashMode.dio.build.boot=dio
nora_w10.menu.FlashMode.dio.build.boot_freq=80m
nora_w10.menu.FlashMode.dio.build.flash_freq=80m
nora_w10.menu.FlashMode.opi=OPI 80MHz
nora_w10.menu.FlashMode.opi.build.flash_mode=dout
nora_w10.menu.FlashMode.opi.build.boot=opi
nora_w10.menu.FlashMode.opi.build.boot_freq=80m
nora_w10.menu.FlashMode.opi.build.flash_freq=80m

nora_w10.menu.FlashSize.4M=4MB (32Mb)
nora_w10.menu.FlashSize.4M.build.flash_size=4MB
nora_w10.menu.FlashSize.8M=8MB (64Mb)
nora_w10.menu.FlashSize.8M.build.flash_size=8MB
nora_w10.menu.FlashSize.8M.build.partitions=default_8MB
#nora_w10.menu.FlashSize.16M=16MB (128Mb)
#nora_w10.menu.FlashSize.16M.build.flash_size=16MB
#nora_w10.menu.FlashSize.32M=32MB (256Mb)
#nora_w10.menu.FlashSize.32M.build.flash_size=32MB

nora_w10.menu.LoopCore.1=Core 1
nora_w10.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1
nora_w10.menu.LoopCore.0=Core 0
nora_w10.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0

nora_w10.menu.EventsCore.1=Core 1
nora_w10.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1
nora_w10.menu.EventsCore.0=Core 0
nora_w10.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0

nora_w10.menu.USBMode.hwcdc=Hardware CDC and JTAG
nora_w10.menu.USBMode.hwcdc.build.usb_mode=1
nora_w10.menu.USBMode.default=USB-OTG (TinyUSB)
nora_w10.menu.USBMode.default.build.usb_mode=0

nora_w10.menu.CDCOnBoot.default=Disabled
nora_w10.menu.CDCOnBoot.default.build.cdc_on_boot=0
nora_w10.menu.CDCOnBoot.cdc=Enabled
nora_w10.menu.CDCOnBoot.cdc.build.cdc_on_boot=1

nora_w10.menu.MSCOnBoot.default=Disabled
nora_w10.menu.MSCOnBoot.default.build.msc_on_boot=0
nora_w10.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode)
nora_w10.menu.MSCOnBoot.msc.build.msc_on_boot=1

nora_w10.menu.DFUOnBoot.default=Disabled
nora_w10.menu.DFUOnBoot.default.build.dfu_on_boot=0
nora_w10.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode)
nora_w10.menu.DFUOnBoot.dfu.build.dfu_on_boot=1

nora_w10.menu.UploadMode.default=UART0 / Hardware CDC
nora_w10.menu.UploadMode.default.upload.use_1200bps_touch=false
nora_w10.menu.UploadMode.default.upload.wait_for_upload_port=false
nora_w10.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB)
nora_w10.menu.UploadMode.cdc.upload.use_1200bps_touch=true
nora_w10.menu.UploadMode.cdc.upload.wait_for_upload_port=true

nora_w10.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
nora_w10.menu.PartitionScheme.default.build.partitions=default
nora_w10.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
nora_w10.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
nora_w10.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT)
nora_w10.menu.PartitionScheme.default_8MB.build.partitions=default_8MB
nora_w10.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336
nora_w10.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
nora_w10.menu.PartitionScheme.minimal.build.partitions=minimal
nora_w10.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
nora_w10.menu.PartitionScheme.no_ota.build.partitions=no_ota
nora_w10.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
nora_w10.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
nora_w10.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
nora_w10.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
nora_w10.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
nora_w10.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
nora_w10.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
nora_w10.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
nora_w10.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
nora_w10.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
nora_w10.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
nora_w10.menu.PartitionScheme.huge_app.build.partitions=huge_app
nora_w10.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
nora_w10.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
nora_w10.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
nora_w10.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
#nora_w10.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT)
#nora_w10.menu.PartitionScheme.fatflash.build.partitions=ffat
#nora_w10.menu.PartitionScheme.fatflash.upload.maximum_size=2097152
#nora_w10.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS)
#nora_w10.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB
#nora_w10.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
nora_w10.menu.PartitionScheme.rainmaker=RainMaker
nora_w10.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
nora_w10.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728

nora_w10.menu.CPUFreq.240=240MHz (WiFi)
nora_w10.menu.CPUFreq.240.build.f_cpu=240000000L
nora_w10.menu.CPUFreq.160=160MHz (WiFi)
nora_w10.menu.CPUFreq.160.build.f_cpu=160000000L
nora_w10.menu.CPUFreq.80=80MHz (WiFi)
nora_w10.menu.CPUFreq.80.build.f_cpu=80000000L
nora_w10.menu.CPUFreq.40=40MHz
nora_w10.menu.CPUFreq.40.build.f_cpu=40000000L
nora_w10.menu.CPUFreq.20=20MHz
nora_w10.menu.CPUFreq.20.build.f_cpu=20000000L
nora_w10.menu.CPUFreq.10=10MHz
nora_w10.menu.CPUFreq.10.build.f_cpu=10000000L

nora_w10.menu.UploadSpeed.921600=921600
nora_w10.menu.UploadSpeed.921600.upload.speed=921600
nora_w10.menu.UploadSpeed.115200=115200
nora_w10.menu.UploadSpeed.115200.upload.speed=115200
nora_w10.menu.UploadSpeed.256000.windows=256000
nora_w10.menu.UploadSpeed.256000.upload.speed=256000
nora_w10.menu.UploadSpeed.230400.windows.upload.speed=256000
nora_w10.menu.UploadSpeed.230400=230400
nora_w10.menu.UploadSpeed.230400.upload.speed=230400
nora_w10.menu.UploadSpeed.460800.linux=460800
nora_w10.menu.UploadSpeed.460800.macosx=460800
nora_w10.menu.UploadSpeed.460800.upload.speed=460800
nora_w10.menu.UploadSpeed.512000.windows=512000
nora_w10.menu.UploadSpeed.512000.upload.speed=512000

nora_w10.menu.DebugLevel.none=None
nora_w10.menu.DebugLevel.none.build.code_debug=0
nora_w10.menu.DebugLevel.error=Error
nora_w10.menu.DebugLevel.error.build.code_debug=1
nora_w10.menu.DebugLevel.warn=Warn
nora_w10.menu.DebugLevel.warn.build.code_debug=2
nora_w10.menu.DebugLevel.info=Info
nora_w10.menu.DebugLevel.info.build.code_debug=3
nora_w10.menu.DebugLevel.debug=Debug
nora_w10.menu.DebugLevel.debug.build.code_debug=4
nora_w10.menu.DebugLevel.verbose=Verbose
nora_w10.menu.DebugLevel.verbose.build.code_debug=5

##############################################################

widora-air.name=Widora AIR

widora-air.bootloader.tool=esptool_py
Expand Down Expand Up @@ -17114,8 +17318,8 @@ department_of_alchemy_minimain_esp32s2.menu.EraseFlash.all.upload.erase_cmd=-e
##############################################################

Bee_Motion_S3.name=Bee Motion S3
Bee_Motion_Mini.vid.0=0x303a
Bee_Motion_Mini.pid.0=0x8113
Bee_Motion_S3.vid.0=0x303a
Bee_Motion_S3.pid.0=0x8113

Bee_Motion_S3.bootloader.tool=esptool_py
Bee_Motion_S3.bootloader.tool.default=esptool_py
Expand Down Expand Up @@ -17223,8 +17427,8 @@ Bee_Motion_S3.menu.EraseFlash.all.upload.erase_cmd=-e
########################################################################

Bee_Motion.name=Bee Motion
Bee_Motion_Mini.vid.0=0x303a
Bee_Motion_Mini.pid.0=0x810D
Bee_Motion.vid.0=0x303a
Bee_Motion.pid.0=0x810D

Bee_Motion.bootloader.tool=esptool_py
Bee_Motion.bootloader.tool.default=esptool_py
Expand Down Expand Up @@ -17440,8 +17644,8 @@ Bee_Motion_Mini.menu.EraseFlash.all.upload.erase_cmd=-e
###############################################################

Bee_S3.name=Bee S3
Bee_Motion_Mini.vid.0=0x303a
Bee_Motion_Mini.pid.0=0x8110
Bee_S3.vid.0=0x303a
Bee_S3.pid.0=0x8110

Bee_S3.bootloader.tool=esptool_py
Bee_S3.bootloader.tool.default=esptool_py
Expand Down
3 changes: 1 addition & 2 deletions docs/source/esp-idf_component.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ If you are writing code that does not require Arduino to compile and you want yo
FreeRTOS Tick Rate (Hz)
-----------------------

You might notice that Arduino-esp32's `delay()` function will only work in multiples of 10ms. That is because, by default, esp-idf handles task events 100 times per second.
To fix that behavior, you need to set FreeRTOS tick rate to 1000Hz in `make menuconfig` -> `Component config` -> `FreeRTOS` -> `Tick rate`.
The Arduino component requires the FreeRTOS tick rate `CONFIG_FREERTOS_HZ` set to 1000Hz in `make menuconfig` -> `Component config` -> `FreeRTOS` -> `Tick rate`.

Compilation Errors
------------------
Expand Down
Loading

0 comments on commit 63aacba

Please sign in to comment.