Skip to content

Commit

Permalink
boards: initial support for ESP32-C6-DevKitC-1
Browse files Browse the repository at this point in the history
Signed-off-by: Stijn Tintel <[email protected]>
  • Loading branch information
stintel committed Mar 16, 2023
1 parent 41f7000 commit ac3f66d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 12 deletions.
33 changes: 33 additions & 0 deletions boards/esp32-c6-devkitc-1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"build": {
"arduino":{
"ldscript": "esp32c6_out.ld"
},
"core": "esp32",
"f_cpu": "160000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"extra_flags": "-DARDUINO_ESP32C6_DEV",
"mcu": "esp32c6",
"variant": "esp32c6"
},
"connectivity": [
"wifi"
],
"debug": {
"openocd_target": "esp32c6.cfg"
},
"frameworks": [
"espidf"
],
"name": "Espressif ESP32-C6-DevKitC-1",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 460800
},
"url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c6/hw-reference/esp32c6/user-guide-devkitc-1.html",
"vendor": "Espressif"
}
6 changes: 3 additions & 3 deletions builder/frameworks/_embed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ def transform_to_asm(target, source, env):
" ".join(
[
"riscv32-esp-elf-objcopy"
if mcu == "esp32c3"
if mcu in ("esp32c3", "esp32c6")
else "xtensa-%s-elf-objcopy" % mcu,
"--input-target",
"binary",
"--output-target",
"elf32-littleriscv" if mcu == "esp32c3" else "elf32-xtensa-le",
"elf32-littleriscv" if mcu in ("esp32c3","esp32c6") else "elf32-xtensa-le",
"--binary-architecture",
"riscv" if mcu == "esp32c3" else "xtensa",
"riscv" if mcu in ("esp32c3","esp32c6") else "xtensa",
"--rename-section",
".data=.rodata.embedded",
"$SOURCE",
Expand Down
10 changes: 5 additions & 5 deletions builder/frameworks/espidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
IDF5 = platform.get_package_version("framework-espidf").split(".")[1].startswith("5")
FRAMEWORK_DIR = platform.get_package_dir("framework-espidf")
TOOLCHAIN_DIR = platform.get_package_dir(
"toolchain-%s" % ("riscv32-esp" if mcu == "esp32c3" else ("xtensa-%s" % mcu))
"toolchain-%s" % ("riscv32-esp" if mcu in ("esp32c3","esp32c6") else ("xtensa-%s" % mcu))
)


Expand Down Expand Up @@ -232,7 +232,7 @@ def populate_idf_env_vars(idf_env):
os.path.dirname(get_python_exe()),
]

if mcu != "esp32c3":
if mcu not in ("esp32c3", "esp32c6"):
additional_packages.append(
os.path.join(platform.get_package_dir("toolchain-esp32ulp"), "bin"),
)
Expand Down Expand Up @@ -478,7 +478,7 @@ def extract_linker_script_fragments(framework_components_dir, sdk_config):
sys.stderr.write("Error: Failed to extract paths to linker script fragments\n")
env.Exit(1)

if mcu == "esp32c3":
if mcu in ("esp32c3", "esp32c6"):
result.append(os.path.join(framework_components_dir, "riscv", "linker.lf"))

# Add extra linker fragments
Expand Down Expand Up @@ -1451,7 +1451,7 @@ def _skip_prj_source_files(node):
(
board.get(
"upload.bootloader_offset",
"0x0" if mcu in ("esp32c3", "esp32s3") else "0x1000",
"0x0" if mcu in ("esp32c3", "esp32c6", "esp32s3") else "0x1000",
),
os.path.join("$BUILD_DIR", "bootloader.bin"),
),
Expand Down Expand Up @@ -1530,7 +1530,7 @@ def _skip_prj_source_files(node):
#

ulp_dir = os.path.join(PROJECT_DIR, "ulp")
if os.path.isdir(ulp_dir) and os.listdir(ulp_dir) and mcu != "esp32c3":
if os.path.isdir(ulp_dir) and os.listdir(ulp_dir) and mcu not in ("esp32c3", "esp32c6"):
env.SConscript("ulp.py", exports="env sdk_config project_config idf_variant")

#
Expand Down
2 changes: 1 addition & 1 deletion builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __fetch_fs_size(target, source, env):
mcu = board.get("build.mcu", "esp32")
toolchain_arch = "xtensa-%s" % mcu
filesystem = board.get("build.filesystem", "spiffs")
if mcu == "esp32c3":
if mcu in ("esp32c3", "esp32c6"):
toolchain_arch = "riscv32-esp"

if "INTEGRATION_EXTRA_DATA" not in env:
Expand Down
6 changes: 3 additions & 3 deletions platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def configure_default_packages(self, variables, targets):
else:
self.packages.pop("toolchain-xtensa-%s" % available_mcu, None)

if mcu in ("esp32s2", "esp32s3", "esp32c3"):
# RISC-V based toolchain for ESP32C3, ESP32S2, ESP32S3 ULP
if mcu in ("esp32s2", "esp32s3", "esp32c3", "esp32c6"):
# RISC-V based toolchain for ESP32C3, ESP32C6 ESP32S2, ESP32S3 ULP
self.packages["toolchain-riscv32-esp"]["optional"] = False

if build_core == "mbcwb":
Expand Down Expand Up @@ -178,7 +178,7 @@ def _add_dynamic_options(self, board):
"tumpa",
]

if board.get("build.mcu", "") in ("esp32c3", "esp32s3"):
if board.get("build.mcu", "") in ("esp32c3", "esp32c6", "esp32s3"):
supported_debug_tools.append("esp-builtin")

upload_protocol = board.manifest.get("upload", {}).get("protocol")
Expand Down

0 comments on commit ac3f66d

Please sign in to comment.