Skip to content
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

IEEE 802.15.4 support for ESP32-C6 #82876

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

martinjaeger
Copy link
Member

@martinjaeger martinjaeger commented Dec 11, 2024

Code builds for xiao_esp32c6, but ot scan on the shell does not yet succeed.

@zephyrbot
Copy link
Collaborator

zephyrbot commented Dec 11, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_espressif zephyrproject-rtos/hal_espressif@51bf6d7 (zephyr) zephyrproject-rtos/hal_espressif#379 zephyrproject-rtos/hal_espressif#379/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@zephyrbot zephyrbot added manifest manifest-hal_espressif DNM This PR should not be merged (Do Not Merge) labels Dec 11, 2024
@martinjaeger
Copy link
Member Author

Rebased and fixed some bugs so that the firmware doesn't get stuck anymore and we reach the shell.

@martinjaeger martinjaeger force-pushed the ieee802154-esp32c6 branch 2 times, most recently from 78413d0 to a85597e Compare January 13, 2025 17:52
@MaikVermeulen
Copy link
Contributor

MaikVermeulen commented Jan 14, 2025

Hi @martinjaeger, I see you're actively working on this, thank you!

My team is beginning development of an OpenThread application prototype on an ESP32-C6-Mini based custom board soon. Personally I would love for it to be Zephyr based. What hurdles are there still to take? Can we support you?

Copy link

@marekmatej marekmatej left a comment

Choose a reason for hiding this comment

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

One more thing, please move west.yml changes as the first commit in this PR.

@@ -71,3 +72,7 @@
&wdt0 {
status = "okay";
};

&ieee802154 {

Choose a reason for hiding this comment

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

This 'enable' should go into a samples/.../shell/socs/esp32c6.overlay

Copy link
Member Author

@martinjaeger martinjaeger Jan 14, 2025

Choose a reason for hiding this comment

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

No, I don't think so. It is also enabled in the board file of nrf52840dk and many other boards. The sample should just enable OpenThread via Kconfig.

drivers/ieee802154/Kconfig.esp32 Outdated Show resolved Hide resolved
drivers/ieee802154/Kconfig.esp32 Outdated Show resolved Hide resolved
@@ -21,6 +21,7 @@
zephyr,shell-uart = &uart0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,ieee802154 = &ieee802154;

Choose a reason for hiding this comment

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

this should probably go to the sample overlay.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't thinks so. See previous comment.

@martinjaeger
Copy link
Member Author

martinjaeger commented Jan 14, 2025

One more thing, please move west.yml changes as the first commit in this PR.

Why do you think that's necessary? The first commit in this PR is unrelated and tries to address the issues with the interrupt controller, so it will be removed for the final version of the PR and the west.yml change will automatically be the first commit.

Please ignore any style issues for now. This PR is still in draft mode. We should focus on getting the driver to work first. I will clean it up at the end.

UART does not work reliably anymore if assigned to this IRQ.

Signed-off-by: Martin Jäger <[email protected]>
PRELIMINARY: Pointing to related PR head.

Signed-off-by: Martin Jäger <[email protected]>
Draft implementation of the IEEE 802.15.4 driver using Espressif HAL.

Signed-off-by: Martin Jäger <[email protected]>
Enable IEEE 802.15.4 driver for esp32c6_devkitc and xiao_esp32c6
boards.

Signed-off-by: Martin Jäger <[email protected]>
@martinjaeger
Copy link
Member Author

My team is beginning development of an OpenThread application prototype on an ESP32-C6-Mini based custom board soon. Personally I would love for it to be Zephyr based. What hurdles are there still to take? Can we support you?

Hi @MaikVermeulen thanks for offering support.

The driver is compiling and we have successfully received and transmitted some packets (verified with a sniffer based on a nRF52840 board). However, ot scan on the shell does not work and can't discover/join existing Thread networks, yet.

From the log output it seems that we are receiving packages from the scan after the scan has finished and Done is printed on the console, so it looks like the interrupt is delayed for some reason.

In general there seems to be a major issue with the interrupt allocator for the ESP32C6. We have observed similar issues with interrupts being fired too late (sometimes several hundreds of milliseconds) in the UART driver. Modifying the reserved interrupts in intc_esp32c3.c (see first commit) sometimes fixes some issues randomly, but it's not reliable. The issues with the interrupt allocator have to be understood first. Once that's fixed, there should not be much left to get this driver working.

You can try it out by using the branch of this PR and running samples/net/openthread/shell. We are happy about any kind of support with debugging and testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DNM This PR should not be merged (Do Not Merge) manifest manifest-hal_espressif
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants