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

RFC: WiFi Buddy Interface Design #196

Merged
merged 3 commits into from
Jul 30, 2023
Merged

RFC: WiFi Buddy Interface Design #196

merged 3 commits into from
Jul 30, 2023

Conversation

hawkw
Copy link
Contributor

@hawkw hawkw commented Jul 29, 2023

This commit starts a new RFC for designing the hardware and software interfaces between MnemOS on the CPU and MnemOS on the WiFi Buddy. I've started by adding a summary of the background and a list of design questions that need to be answered as we determine how the WiFi Buddy and the CPU will communicate. This is intended as a jumping-off point for future conversations, and (eventually) to document the design.

@jamesmunns, I'd love your input on this --- feel free to add to the RFC doc directly, or leave comments on the PR, whatever you prefer!

This commit starts a new RFC for designing the hardware and software
interfaces between MnemOS on the CPU and MnemOS on the WiFi Buddy. I've
started by adding a summary of the background and a list of design
questions that need to be answered as we determine how the WiFi Buddy
and the CPU will communicate. This is intended as a jumping-off point
for future conversations, and (eventually) to document the design.

@jamesmunns, I'd love your input on this --- feel free to add to the RFC
doc directly, or leave comments on the PR, whatever you prefer!
The following pins are broken out by the WiFi Buddy hardware and can be used for
communication between the CPU and WiFi Buddy:

- One SPI interface (`MOSI`, `MISO`, and `SCK`)
Copy link
Contributor

Choose a reason for hiding this comment

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

There's also a chip select pin CSn.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't include chip select here because any of the 4 GPIOs could be the chip select pin, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

sort of. Short answer, yes it could be for now, but might be worth explicitly addressing as such.

Copy link
Contributor

@jamesmunns jamesmunns left a comment

Choose a reason for hiding this comment

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

Overall looks great to me, and I appreciate you writing this up @hawkw!

Based on the background information discussed above, we can begin to enumerate
design questions for the WiFi Buddy interface:

- **Is control path communication in-band or out of band?** If data path frames
Copy link
Contributor

Choose a reason for hiding this comment

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

Mentioned in chat, but I'd probably recommend just using SPI unless we come up with a good reason not to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we're aligned on this --- I wanted to enumerate both options but the proposed design will be SPI only (and IRQs)

between data and control messages. It also means that we don't necessarily
need to implement drivers for all the interfaces available on the ESP32-C3.

Downsides of in-band control messages include that we must introduce some
Copy link
Contributor

Choose a reason for hiding this comment

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

Mention in chat: I think using postcard as the wire format means that decoding/encoding is likely to be low overhead (CPU and bandwidth use wise), and allow for flexibility in the future if we add more message types.

the ability to indicate what data is an Ethernet frame and what is BLE,
anyway, so we'll already be introducing some overhead for tagging data.

- **Do we want the CPU to be able to receive `trace-proto` from WiFi Buddy?**
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we will want this, but it can also be deferred during early development since we'll have the additional USB link

what control messages will need to be exchanged in order to implement the
required functionality.

- **How does the WiFi Buddy signal that data is ready?** Since the CPU is the
Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely +1 that we need at least ONE GPIO signal line, even if it is optional. Possible useful lines are:

  • "Modem ready to receive data" (can also indicate "I am busy processing" or "buffers are full")
  • "Modem has data for host"


## Background

### Hardware
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth mentioning/discussing https://github.com/tosc-rs/mnemos/tree/main/hardware/esp32c3-wifi-dev, and particularly note that we'll be able to use:

  • 4-pin SPI
  • 2-pin UART
  • 2 signal GPIOs (could be 4, if we don't use UART)

For initial development.

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't forget to change the number of the file from 0000 to 0196 before merging

@hawkw hawkw merged commit 491c08d into main Jul 30, 2023
6 checks passed
@hawkw hawkw deleted the eliza/wifi-buddy-rfc branch July 30, 2023 01:09
@jamesmunns jamesmunns added the kind: RFC Requests for Comments as design proposals label Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: RFC Requests for Comments as design proposals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants