Skip to content

Add buffered UART exercise #159

Open
@jonathanpallant

Description

@jonathanpallant

I'd like to see an exercise for building a fully buffered, interrupt-driven UART, as an extension to the UART exercise.

We should probably do this on a Cortex-M target, as interrupt handling on Cortex-R is not as well handled (the interrupt controllers aren't standardised, and we don't have good drivers for them).

  1. Make a blocking UART (existing exercise)
  2. Make it global (needs to be Mutex<RefCell<Option<Uart>>>)
  3. Give it a one-byte buffer (an Option<u8>) and make it interrupt driven.
  4. Replace the Option<u8> with some kind of heapless queue
  5. Use a bbqueue and DMA the data into the UART rather than copying a byte at a time
  6. Set up a second UART

QEMU probably makes sense (assuming the simulated UART has working interrupts and FIFO and DMA)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions