Skip to content

S08.03 slice 2: CMSDK UART + newlib retargeting #290

Description

@DavidCozens

Slice 2 of S08.03 (parent: #268).

Scope

Replace the QEMU mps2-an385 HelloWorld's semihosting transport with a CMSDK UART0 polled driver and newlib retargeting, so that printf/getchar in the FreeRTOS example route through qemu -serial stdio. This is the foundation for slice 3+, where Example/Common/ExampleInteractive.c's send N / quit contract drives the FreeRTOS image identically to Linux/Windows.

Out of scope (deferred)

  • FreeRTOS-Plus-TCP wiring and the LAN9118 NIC bring-up (slice 3)
  • Example/FreeRtos/SingleTask/main.c and NullSender (slice 3)
  • quit / round-trip stdin handling (slice 3 — falls out of Example/Common/ExampleInteractive.c)
  • BDD harness target switch and feature un-WIP'ing (slices 4..N)

Why UART, not semihosting

Semihosting reads/writes execute via BKPT traps; QEMU pauses the entire VM while the host services each call. With the IP stack and Service task running concurrently in slice 3+, that stalls every concurrent activity for the duration of every read/write. CMSDK UART0 is plain MMIO — the CPU polls a status register, the IP stack and tasks keep running, Behave drives the example over qemu -serial stdio exactly as it drives the Linux/Windows binaries today.

Acceptance

  • CMSDK UART0 driver host-TDD'd under Tests/FreeRtos/ (mirrors slice-1 SolidSyslogFreeRtosDatagram pattern: source recompiled in the test executable against an in-memory fake register block).
  • Newlib _write (and minimum stub set) routes stdout/stderr to the CMSDK UART driver. --specs=rdimon.specs removed; initialise_monitor_handles replaced.
  • Example/FreeRtos/HelloWorld ELF still emits its banner under QEMU, but via -serial stdio rather than -semihosting-config.
  • CI build-freertos-target job updated: drops -semihosting-config, adds -serial stdio; banner-grep unchanged.
  • build-freertos-host-tdd runs the new CmsdkUartTest automatically (via the existing debug preset).

Metadata

Metadata

Assignees

No one assigned

    Labels

    storyStory issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions