Skip to content

boards: seeed: xiao_esp32c6 external antenna support #90059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mariopaja
Copy link
Contributor

@mariopaja mariopaja commented May 16, 2025

This PR adds The RF switch node and support for the extenal antenna.

Based on: XIAO ESP32C6 Getting Started

@mariopaja mariopaja force-pushed the xiao_esp32c6_wifi_antenna_switch branch 5 times, most recently from 1826bde to d1744d6 Compare May 16, 2025 12:05
@mariopaja mariopaja force-pushed the xiao_esp32c6_wifi_antenna_switch branch 2 times, most recently from 22f751f to 676792e Compare May 16, 2025 12:08
@msalau
Copy link
Contributor

msalau commented May 16, 2025

Hello @mariopaja

There are hooks for board initialization:

To make the hooks functional they should be enabled in Kconfig:

config BOARD_XIAO_ESP32C6
+	select BOARD_EARLY_INIT_HOOK
+	select BOARD_LATE_INIT_HOOK

I think these hooks were added for scenarios like yours.

Best regards
Maksim

@mariopaja
Copy link
Contributor Author

@msalau Thank you for the input! I will have a look into it :)

return 0;
}

SYS_INIT(board_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
Copy link
Contributor

Choose a reason for hiding this comment

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

use board hook


config XIAO_ESP32C6_EXT_ANTENNA
bool "XIAO ESP32C6 External Antenna"
default n
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
default n

@@ -37,6 +37,17 @@
watchdog0 = &wdt0;
};

rf_switch {
compatible = "gpio-keys";
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK gpio-keys is meant for inputs not outputs.
I don't know about any generic GPIO output driver, so gpio-leds is the best candidate.
Other boards use it for generic outputs too.
E.g.
heltec_wifi_lora32_v2/heltec_wifi_lora32_v2_procpu.dts
heltec_wifi_lora32_v2/board_init.c

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually good point, you need to create a custom DTS binding, use of LED for this is not allowed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nordicjm would dts/bindings/output/gpio-switch.yaml be okay. I guess then this would have to be added in a separate PR

Copy link
Contributor

@msalau msalau May 19, 2025

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you :D

@mariopaja mariopaja force-pushed the xiao_esp32c6_wifi_antenna_switch branch 8 times, most recently from 7839e88 to ad8031d Compare May 21, 2025 08:57
decsny
decsny previously approved these changes Jun 5, 2025
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Aug 12, 2025
@mariopaja mariopaja force-pushed the xiao_esp32c6_wifi_antenna_switch branch from f869dea to 98fdd90 Compare August 12, 2025 06:52
@zephyrbot zephyrbot added the platform: Seeed Studio Seeed Studio platforms label Aug 12, 2025
@nordicjm nordicjm requested review from decsny and msalau August 12, 2025 07:11
@mariopaja mariopaja force-pushed the xiao_esp32c6_wifi_antenna_switch branch 2 times, most recently from 52b6cf0 to 3899893 Compare August 12, 2025 08:30
@github-actions github-actions bot removed the Stale label Aug 13, 2025
@mariopaja mariopaja force-pushed the xiao_esp32c6_wifi_antenna_switch branch from 3899893 to 62e8008 Compare August 13, 2025 05:15
@mariopaja mariopaja requested review from nordicjm and msalau August 13, 2025 07:23
Copy link
Contributor

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

unless this is going to be made a soc hook then remove the soc Kconfig

This PR adds adds The RF switch node and support for
the extenal antenna.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
@mariopaja mariopaja force-pushed the xiao_esp32c6_wifi_antenna_switch branch from 62e8008 to e845b8a Compare August 18, 2025 08:29
Copy link

@decsny decsny removed their request for review August 20, 2025 01:13
@kartben kartben merged commit 31fc280 into zephyrproject-rtos:main Aug 20, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants