Skip to content
Open
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
51 changes: 51 additions & 0 deletions seeed_xiao_esp32c5.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"build": {
"arduino": {
"ldscript": "esp32c5_out.ld",
"partitions": "default_8MB.csv",
"memory_type": "qio_qspi"
},
Comment on lines +3 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the linker script, partition table, and board variant exist in the Arduino ESP32 core.

echo "=== Linker script ==="
fd "esp32c5_out.ld" --type f

echo "=== Partition table ==="
fd "default_8MB.csv" --type f

echo "=== Variant directory ==="
fd "XIAO_ESP32C5" --type d

echo "=== Other ESP32-C5 board JSON files for comparison ==="
rg -l "esp32c5" --type json -g "*.json"

Repository: pioarduino/platform-espressif32

Length of output: 360


🏁 Script executed:

#!/bin/bash
# Check what the other ESP32-C5 boards reference

echo "=== Comparing ldscript references in ESP32-C5 boards ==="
for f in boards/esp32-c5-devkitc*.json seeed_xiao_esp32c5.json; do
  echo "--- $f ---"
  rg '"ldscript"' "$f" -A 0
done

echo ""
echo "=== Comparing partitions references in ESP32-C5 boards ==="
for f in boards/esp32-c5-devkitc*.json seeed_xiao_esp32c5.json; do
  echo "--- $f ---"
  rg '"partitions"' "$f" -A 0
done

echo ""
echo "=== All .ld files in repository ==="
fd "\.ld$" --type f

echo ""
echo "=== All .csv files in repository ==="
fd "\.csv$" --type f | head -20

Repository: pioarduino/platform-espressif32

Length of output: 1184


🏁 Script executed:

#!/bin/bash
# Understand how ldscript and partitions are resolved

echo "=== Search for ldscript handling in platform.py ==="
rg -i "ldscript" --type py | head -20

echo ""
echo "=== Search for partitions handling in platform.py ==="
rg -i "partitions" --type py | head -20

echo ""
echo "=== Check Arduino core directory structure ==="
fd "esp32" --type d -g "*arduino*" | head -10

echo ""
echo "=== Look for esp32c5 in builder files ==="
rg "esp32c5" --type py

Repository: pioarduino/platform-espressif32

Length of output: 2636


🏁 Script executed:

#!/bin/bash
# Find Arduino framework handling of ldscript

echo "=== Search Arduino framework builder for ldscript ==="
find builder -name "*.py" -type f | xargs grep -l "ldscript" 2>/dev/null

echo ""
echo "=== Content of Arduino framework builder if it exists ==="
ls -la builder/frameworks/ | grep -i arduino

echo ""
echo "=== Check espidf.py for Arduino ldscript handling ==="
rg "build\.ldscript|build\.arduino\.ldscript" --type py -B 2 -A 2

echo ""
echo "=== Check main.py for ldscript handling ==="
rg "ldscript" builder/main.py -B 2 -A 2

Repository: pioarduino/platform-espressif32

Length of output: 721


🏁 Script executed:

#!/bin/bash
# Examine Arduino framework builder

echo "=== First 100 lines of arduino.py ==="
head -100 builder/frameworks/arduino.py

echo ""
echo "=== Search for ldscript in arduino.py ==="
rg "ldscript" builder/frameworks/arduino.py -B 3 -A 3

echo ""
echo "=== Search for how Arduino gets core directory ==="
rg "FRAMEWORK_DIR|arduino.*core" builder/frameworks/arduino.py -B 2 -A 2 | head -40

Repository: pioarduino/platform-espressif32

Length of output: 4064


🏁 Script executed:

#!/bin/bash
# Check all board files for ldscript usage

echo "=== ESP32 boards that define ldscript ==="
rg '"ldscript"' boards/*.json --type json

echo ""
echo "=== Count: boards with ldscript vs without ==="
echo "Boards WITH ldscript:"
rg -l '"ldscript"' boards/*.json --type json | wc -l
echo "Total boards:"
ls boards/*.json | wc -l

echo ""
echo "=== Search for esp32c5_out.ld anywhere in repo ==="
rg "esp32c5_out" .

echo ""
echo "=== Check if this is from Seeed's reference definition ==="
# Look at git log to see where this came from
git log --oneline --all -S "esp32c5_out.ld" 2>/dev/null | head -5

Repository: pioarduino/platform-espressif32

Length of output: 161


🏁 Script executed:

#!/bin/bash
# Simpler check of board files

echo "=== ESP32 boards that define ldscript ==="
rg '"ldscript"' boards/*.json --type json 2>/dev/null | cut -d: -f1 | sort -u

echo ""
echo "=== Total boards with ldscript ==="
rg -l '"ldscript"' boards/*.json --type json 2>/dev/null | wc -l

echo ""
echo "=== Search for esp32c5_out in entire repo ==="
rg "esp32c5_out" . 2>/dev/null

echo ""
echo "=== Check the actual seeed_xiao_esp32c5.json file ==="
cat seeed_xiao_esp32c5.json | head -30

Repository: pioarduino/platform-espressif32

Length of output: 932


🏁 Script executed:

#!/bin/bash
# Check if Arduino framework builder uses build.arduino.ldscript

echo "=== Entire arduino.py file size and search for ldscript/variant ==="
wc -l builder/frameworks/arduino.py
echo ""
rg -i "build\.(arduino\.)?ldscript|build\.variant" builder/frameworks/arduino.py

echo ""
echo "=== Check how variants and ldscripts are used in espidf vs arduino ==="
echo "ESP-IDF framework:"
rg "build\.ldscript|build\.esp-idf\.ldscript" builder/frameworks/espidf.py -B 1 -A 1

echo ""
echo "=== Check if build.arduino.* is used anywhere in builders ==="
rg "build\.arduino\." builder/frameworks/ --type py

Repository: pioarduino/platform-espressif32

Length of output: 704


🏁 Script executed:

#!/bin/bash
# Check how other ESP32-C5 boards are configured

echo "=== Full content of a working ESP32-C5 devkit board for comparison ==="
cat boards/esp32-c5-devkitc-1.json

echo ""
echo "=== Check which frameworks use ldscript in espidf.py ==="
rg -B 5 "build\.ldscript" builder/frameworks/espidf.py | head -20

echo ""
echo "=== Verify: does Arduino framework even check for build.arduino.ldscript? ==="
rg "build\.arduino" builder/frameworks/arduino.py

Repository: pioarduino/platform-espressif32

Length of output: 1038


🏁 Script executed:

#!/bin/bash
# Verify Arduino framework actually uses ldscript and check variant

echo "=== Check entire arduino.py for any ldscript usage ==="
grep -i "ldscript" builder/frameworks/arduino.py

echo ""
echo "=== Check if XIAO_ESP32C5 variant or esp32c5 variant directory exists ==="
find . -type d -name "*XIAO*" 2>/dev/null
find . -type d -name "*esp32c5*" 2>/dev/null

echo ""
echo "=== Confirm: arduino.py only uses build.arduino.memory_type, NOT ldscript ==="
grep "build\.arduino\." builder/frameworks/arduino.py

echo ""
echo "=== For comparison, check how ESP-IDF framework handles ldscript ==="
head -1 boards/esp32-c5-devkitc-1.json | grep -c "frameworks.*espidf" || echo "Checking frameworks in devkit board..."
cat boards/esp32-c5-devkitc-1.json | grep -A 2 "frameworks"

Repository: pioarduino/platform-espressif32

Length of output: 440


🏁 Script executed:

#!/bin/bash
# Understand where partitions come from

echo "=== How espidf.py resolves partitions (the only framework that uses them) ==="
rg "partitions_csv|PARTITIONS_TABLE_CSV" builder/frameworks/espidf.py -B 2 -A 2

echo ""
echo "=== Confirm: does arduino.py use partitions at all? ==="
grep -i "partition" builder/frameworks/arduino.py

echo ""
echo "=== Check if default_8MB.csv is used by other boards successfully ==="
rg "default_8MB.csv" boards/*.json

Repository: pioarduino/platform-espressif32

Length of output: 3994


🏁 Script executed:

#!/bin/bash
# Check structure of boards that use partitions and memory_type

echo "=== A board using default_8MB.csv to see correct structure ==="
cat boards/seeed_xiao_esp32s3.json | head -40

echo ""
echo "=== Verify board.get() doesn't traverse nested keys ==="
grep -A 5 "board.get.*build\." builder/frameworks/espidf.py | head -20

Repository: pioarduino/platform-espressif32

Length of output: 1676


🏁 Script executed:

#!/bin/bash
# Check exact location where partitions and ldscript are accessed in espidf.py

echo "=== CRITICAL: Check exact build.* keys accessed in espidf.py ==="
rg "board\.get\(\"build\." builder/frameworks/espidf.py | head -30

echo ""
echo "=== Verify: does seeed_xiao_esp32s3.json work if partitions is nested under arduino? ==="
echo "Checking if espidf.py looks for build.arduino.partitions:"
rg "board\.get.*build\.arduino" builder/frameworks/espidf.py

echo ""
echo "=== Confirm where partitions is nested in seeed_xiao_esp32s3.json ==="
rg -A 6 '"arduino"' boards/seeed_xiao_esp32s3.json | grep -A 2 partitions
</parameter>

Repository: pioarduino/platform-espressif32

Length of output: 2046


🏁 Script executed:

#!/bin/bash
# Check nesting structure of partitions across boards

echo "=== How many boards have build.partitions (flat) vs build.arduino.partitions (nested)? ==="
echo "Flat structure (build.partitions):"
rg '"build".*{' boards/*.json -A 20 | rg '"partitions"' | grep -v arduino | wc -l

echo ""
echo "Nested under arduino (build.arduino.partitions):"
rg '"build".*{' boards/*.json -A 20 | rg -B 5 '"partitions"' | grep -B 5 arduino | wc -l

echo ""
echo "=== Show examples of FLAT structure (partitions NOT under arduino) ==="
for f in boards/*.json; do
  if grep -q '"partitions"' "$f" && ! (grep -B 3 '"partitions"' "$f" | grep -q "arduino"); then
    echo "=== $f ==="
    grep -B 3 -A 1 '"partitions"' "$f" | head -8
    break
  fi
done

echo ""
echo "=== Show examples of NESTED structure (partitions UNDER arduino) ==="
for f in boards/seeed*.json; do
  if grep -q '"partitions"' "$f"; then
    echo "=== $f ==="
    grep -B 3 -A 1 '"partitions"' "$f" | head -8
  fi
done

Repository: pioarduino/platform-espressif32

Length of output: 722


🏁 Script executed:

#!/bin/bash
# Simpler check of board structure

echo "=== Check seeed_xiao_esp32s3.json build section ==="
cat boards/seeed_xiao_esp32s3.json | grep -A 15 '"build"' | head -20

echo ""
echo "=== Check seeed_xiao_esp32c5.json build section ==="
cat seeed_xiao_esp32c5.json | grep -A 15 '"build"' | head -20

echo ""
echo "=== How espidf.py accesses partitions ==="
grep "partitions_csv.*board.get" builder/frameworks/espidf.py

echo ""
echo "=== Verify: espidf.py looks for build.partitions (NOT build.arduino.partitions) ==="
grep -A 2 'partitions_csv = board.get' builder/frameworks/espidf.py

Repository: pioarduino/platform-espressif32

Length of output: 1346


🏁 Script executed:

#!/bin/bash
# Check if both boards have espidf framework and if PlatformIO handles nested keys

echo "=== Does seeed_xiao_esp32s3.json use espidf framework? ==="
grep -A 20 '"frameworks"' boards/seeed_xiao_esp32s3.json

echo ""
echo "=== Does seeed_xiao_esp32c5.json use espidf framework? ==="
grep -A 20 '"frameworks"' seeed_xiao_esp32c5.json

echo ""
echo "=== Check if PlatformIO board.get() handles nested keys ==="
# PlatformIO uses dot notation for nested access, let me check
grep -r "\.get\(" builder/frameworks/espidf.py | grep build | head -5

echo ""
echo "=== Check if there are any boards with FLAT partitions structure ==="
find boards -name "*.json" -exec grep -l '"partitions"' {} \; | head -3 | xargs -I {} sh -c 'echo "=== {} ==="; grep -B 5 "partitions" {} | tail -7'

Repository: pioarduino/platform-espressif32

Length of output: 5125


Move partition table and memory_type definitions to build. (flat) structure; remove unused ldscript.*

The ldscript key under build.arduino is unused by the Arduino framework builder and will cause ESP-IDF builds to fail—this is the only board in the repository that defines it, and no other board needs it. Move partitions and memory_type to the flat build.* level (not nested under build.arduino) to match both the expected framework resolution paths and the configuration pattern used by seeed_xiao_esp32s3.json:

Suggested structure
"build": {
    "partitions": "default_8MB.csv",
    "memory_type": "qio_qspi",
    "core": "esp32",
    ...
}

Remove the build.arduino.ldscript key entirely.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@seeed_xiao_esp32c5.json` around lines 3 - 7, Remove the unused
build.arduino.ldscript entry and move the partitions and memory_type keys out of
build.arduino into the top-level build object (use keys "partitions" and
"memory_type" under "build"), matching the pattern used in
seeed_xiao_esp32s3.json; ensure build.arduino no longer contains ldscript and
that build.partitions and build.memory_type are present at the flat build.*
level so the ESP-IDF and Arduino framework resolution work correctly.

"core": "esp32",
"extra_flags": [
"-DARDUINO_XIAO_ESP32C5",
"-DBOARD_HAS_PSRAM",
"-DARDUINO_USB_MODE=1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you set USB_MODE to the fixed value 1 in the board manifest?
You should leave this up to the user in the platformio.ini file.
This requires the user to disable it in the platformio.ini file (build_unflags = -DUSB_MODE) in order to set USB_MODE to 0, which is not a good user experience.
Suggestion: Omit this line and allow the user to set this setting to 0 or 1 in platformio.ini.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sivar2311 Is correct the board has only the CDC/JTAG port.

"-DARDUINO_USB_CDC_ON_BOOT=1"
],
"f_cpu": "240000000L",
"f_flash": "80000000L",
"flash_mode": "qio",
"psram_type": "qspi",
"hwids": [
[
"0x303a",
"0x1001"
]
],
"mcu": "esp32c5",
"variant": "XIAO_ESP32C5"
},
"connectivity": [
"wifi",
"bluetooth",
"zigbee",
"thread"
],
"debug": {
"openocd_target": "esp32c5.cfg"
},
"frameworks": [
"arduino",
"espidf"
],
"name": "Seeed Studio XIAO ESP32C5",
"upload": {
"flash_size": "8MB",
"maximum_ram_size": 327680,
"maximum_size": 8388608,
"require_upload_port": true,
"speed": 460800
},
"url": "https://wiki.seeedstudio.com/SeeedStudio_XIAO_Series_Introduction/",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

URL points to the generic XIAO series page instead of the XIAO ESP32-C5–specific wiki.

The board's URL should link directly to the C5 getting-started guide for PlatformIO users who follow it from the IDE.

💡 Suggested correction
-  "url": "https://wiki.seeedstudio.com/SeeedStudio_XIAO_Series_Introduction/",
+  "url": "https://wiki.seeedstudio.com/xiao_esp32c5_getting_started/",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"url": "https://wiki.seeedstudio.com/SeeedStudio_XIAO_Series_Introduction/",
"url": "https://wiki.seeedstudio.com/xiao_esp32c5_getting_started/",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@seeed_xiao_esp32c5.json` at line 49, The "url" field currently points to the
generic XIAO series wiki; update the "url" value in seeed_xiao_esp32c5.json (the
"url" key) to the SeeedStudio XIAO ESP32-C5–specific getting-started/wiki page
(the PlatformIO/ESP32-C5 guide) so users are taken directly to the C5 board
documentation.

"vendor": "Seeed Studio"
}