Tools: new mcu: esp32s3

This commit is contained in:
Nicholas Kruzan 2023-05-15 16:47:38 +00:00 committed by Tom Pittenger
parent 5d7eb8a709
commit e1f50fadd7
2 changed files with 12 additions and 4 deletions

View File

@ -551,7 +551,11 @@ def add_dynamic_boards_esp32():
continue
hwdef = os.path.join(dirname, d, 'hwdef.dat')
if os.path.exists(hwdef):
newclass = type(d, (esp32,), {'name': d})
mcu_esp32s3 = True if (d[0:7] == "esp32s3") else False
if mcu_esp32s3:
newclass = type(d, (esp32s3,), {'name': d})
else:
newclass = type(d, (esp32,), {'name': d})
def get_boards_names():
add_dynamic_boards_chibios()
@ -894,6 +898,9 @@ class esp32(Board):
def get_name(self):
return self.__class__.__name__
class esp32s3(esp32):
abstract = True
toolchain = 'xtensa-esp32s3-elf'
class chibios(Board):
abstract = True

View File

@ -18,8 +18,8 @@ import pickle
import subprocess
def configure(cfg):
target = "esp32"
mcu_esp32s3 = True if (cfg.variant[0:7] == "esp32s3") else False
target = "esp32s3" if mcu_esp32s3 else "esp32"
bldnode = cfg.bldnode.make_node(cfg.variant)
def srcpath(path):
return cfg.srcnode.make_node(path).abspath()
@ -37,7 +37,7 @@ def configure(cfg):
env.ESP_IDF_PREFIX_REL = 'esp-idf'
prefix_node = bldnode.make_node(env.ESP_IDF_PREFIX_REL)
env.ESP32_TARGET = target
env.BUILDROOT = bldpath('')
env.SRCROOT = srcpath('')
env.APJ_TOOL = srcpath('Tools/scripts/apj_tool.py')
@ -64,6 +64,7 @@ def pre_build(self):
lib_vars['ARDUPILOT_CMD'] = self.cmd
lib_vars['ARDUPILOT_LIB'] = self.bldnode.find_or_declare('lib/').abspath()
lib_vars['ARDUPILOT_BIN'] = self.bldnode.find_or_declare('lib/bin').abspath()
target = self.env.ESP32_TARGET
esp_idf = self.cmake(
name='esp-idf',
cmake_vars=lib_vars,