arch.arm.ap: add AP register definition.
by
whitequark
4 years 1 month
arch.arm.dp: add DP register definitions, up to DPv2.
by
whitequark
4 years 2 months
arch.arm.jtag: add JTAG-DP IR/DR definitions.
by
whitequark
4 years 2 months
firmware, software: positively verify API compatibility.
Before this commit, firmware and software did not check USB protocol
compatibility in any way. Although this mostly worked because there
were few changes in USB protocol, there were still breaking changes,
the last one in commit 5a7d18a6 that caused a silent hang when wrong
firmware version was used. The community is larger now and this sort
of breakage is no longer acceptable.
After this commit, firmware exports an "API level" (functionally
similar to a semver major version) and software verifies that its own
API level matches that of the firmware. On mismatch, software reloads
the firmware, like it would handle a blank device. Each time firmware
is changed in an incompatible way (affecting e.g. control requests,
FIFO configuration, ...) the API level must be increased.
Miscellaneous cleanups:
* In device enumeration code, no more than one handle to a device
is now kept open at the same time. Although it doesn't matter on
Linux, on Windows opening a USB device is an exclusive operation.
* GlasgowHardwareDevice.{get_serial_list→enumerate_serials}
by
whitequark
4 years 1 month
software: simplify firmware management.
* Move firmware to glasgow/device/firmware.ihex.
* Teach GlasgowHardwareDevice to find firmware unassisted.
* Remove all code that accepted custom firmware filenames except
for `flash --firmware`. There is no loss of functionality; during
development, use `make -C firmware load`, which was always a more
reliable option anyway.
by
whitequark
4 years 1 month
support.arepl, cli: gracefully handle Ctrl+C in REPL.
Ctrl+C is turned into cancellation if the REPL is running user code,
and into KeyboardInterrupt on the main thread (i.e. the default
Python behavior) if the REPL is waiting for input.
by
whitequark
4 years 1 month
support.asignal: restore handler if future is cancelled.
by
whitequark
4 years 1 month
support.{pyrepl→arepl}: rewrite with native async/await.
As a part of the rewrite, inline code from code.InteractiveConsole
and asyncio.AsyncIOInteractiveConsole as necessary. This seems like
it would make things more complicated, but it turns out that the code
in InteractiveConsole is very old and has too much indirection, which
AsyncIOInteractiveConsole painstakingly works around.
by
whitequark
4 years 1 month
platform.rev_c1: explain difference from platform.rev_c0. NFC.
by
whitequark
4 years 1 month