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

espradio: implement support for wifi/BLE on the ESP32-C3 #650

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented Jan 27, 2024

This is a work in progress. It does not yet work. It supersedes #320.

It is based on the work done by Rust people: https://github.com/esp-rs/esp-wifi/tree/main/esp-wifi-sys

To compile, use:

tinygo flash -target=xiao-esp32c3 -monitor  ./examples/espradio/

Right now it doesn't quite work yet:

Connected to /dev/ttyACM0. Press Ctrl-C to exit.
entry 0x4038a4dc
initializing radio...
espradio pp: pp rom version: (null)
espradio net80211: net80211 rom version: (null)
panic: espradio: todo: _task_create_pinned_to_core

This is a work in progress. It does not yet work.
This commit now requires tinygo_task_current which I've patched in my
local TinyGo build.
@aykevl
Copy link
Member Author

aykevl commented Jan 28, 2024

Update: I got a bit further.

Connected to /dev/ttyACM0. Press Ctrl-C to exit.
entry 0x4038a5b8
initializing radio...
espradio pp: pp rom version: (null)
espradio net80211: net80211 rom version: (null)
I (1002) wifi:wifi driver task: 3fc8b2d4, prio:253, stack:6656, core=0
W (1012) wifi:pp q full: 6-3fc8baf4

W (1012) wifi:ioctl: failed to post WiFi task 38
W (1022) wifi:pp q full: 15-0

espradio TODO: delete task 0x3fc8b2d4
could not enable radio: espradio: unknown wifi error

So apparently a send on a queue timed out (pp q full and failed to post WiFi task 38).
I think the next step is implementing the various interrupt handlers and setting up the system timer (it probably times out because it expects one of those interrupts to trigger). This requires a change in gen-device-svd because it doesn't list some required interrupts in the generated Go file (while they exist in the SVD file).

EDIT: actually the interrupts aren't present in the SVD file, they need an update: cmsis-svd/cmsis-svd-data#3

@deadprogram
Copy link
Member

@aykevl the SVD file was updated, so this PR should be unblocked. 😸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants