Commit graph

1074 commits

Author SHA1 Message Date
bunnie
bad5259f43 base64 should be an optional dependency in std
otherwise the loader breaks
2025-04-29 03:32:59 +08:00
bunnie
a5fec5a1d1 fix formatting 2025-04-29 03:19:49 +08:00
bunnie
cb35696200 Merge branch 'main' of github.com:betrusted-io/xous-core into cram-dev 2025-04-29 03:18:57 +08:00
bunnie
26464d4266 fix vertical scrollbar drawing offet bug 2025-04-29 03:10:41 +08:00
bunnie
ae5ff3addd add strings for bip39 entry in small screen mode 2025-04-29 03:02:09 +08:00
bunnie
14740d0cc1 add a numeric-priority mode to the OSK
if the pre-populated field looks numeric, prioritize numbers
over letters for the OSK.
2025-04-29 03:01:29 +08:00
bunnie
0e5410eb36 add more convenience apis 2025-04-29 03:01:10 +08:00
bunnie
9512defd2d add base64 dep for showing bip39 seeds 2025-04-29 03:00:44 +08:00
bunnie
9b5510985f initial take at bip39 entry 2025-04-29 03:00:30 +08:00
bunnie
da7efec6a6 add clone operation for gfx 2025-04-28 19:02:27 +08:00
bunnie
e55630fd57 allow for centering of list items
and make OSK entries centered

this makes the list a little nicer to navigate
2025-04-28 19:01:59 +08:00
bunnie
8be197a2b5 initial slider implementation 2025-04-28 19:01:31 +08:00
bunnie
3b0543a5f0 add supporting changes for textentry 2025-04-28 18:19:36 +08:00
bunnie
e690da3f77 add textentry implementation
includes a simple on-screen keyboard element
2025-04-28 18:18:57 +08:00
bunnie
87b4b18210 cleanup an api change in gfx visibility 2025-04-28 15:18:54 +08:00
bunnie
500df9714e an initial take at a checkbox implementation 2025-04-28 15:18:38 +08:00
bunnie
0d3563412e add more APIs to scrolling list widget
these facilitate checkbox implementation
2025-04-28 15:18:10 +08:00
bunnie
c90c449d32 make pane height adjustable
this allows for top/bottom text on modals...
2025-04-28 03:18:07 +08:00
bunnie
1ac5a55d25 cleanup height calculations 2025-04-28 03:17:50 +08:00
bunnie
a40279ef1e remove errant clear 2025-04-28 03:17:27 +08:00
bunnie
10044579aa initial take at radiobuttons 2025-04-28 02:27:41 +08:00
bunnie
39b0fb9e12 remove lifetime from builder pattern
this causes integration issues with the enum_dispatch macro
2025-04-28 02:27:16 +08:00
bunnie
c657d4db54 fix typo 2025-04-28 02:03:23 +08:00
bunnie
ac19def8df add scrollbars 2025-04-28 02:01:24 +08:00
bunnie
e56acbd243 first take at a 2-d scrolling widget 2025-04-28 01:18:25 +08:00
bunnie
bb6820419f sanity check AXP2101 e-fuse settings 2025-04-27 15:12:07 +08:00
bunnie
e22997874d add DCDC5 configuration 2025-04-21 02:42:40 +08:00
bunnie
1484453100 add scroll widget stub 2025-04-21 00:38:25 +08:00
bunnie
31dcab40aa add a test target with limited scope
this is for SoC testing with i.e. no peripherals or simulated
peripherals in a simulated environment
2025-04-20 07:48:29 -07:00
bunnie
2f467d6f23 Merge remote-tracking branch 'origin/cram-dev' into cram-dev 2025-04-20 04:06:41 -07:00
bunnie
1bad10fb21 work-arounds for DMA on BIO
- writes need at least a "pipe cleaner" to set the pipe in the correct
state
- may also need a "double-write" to commit the data - this is to be
explored with a smaller test case
- DMA write only works over all corners at 700MHz when
  FCLK=ACLK (i.e. FCLK is at half rate)
2025-04-20 03:28:40 -07:00
bunnie
7bd545e95c minimize character output during tests
this significantly improves runtime in GLS mode
2025-04-20 03:28:40 -07:00
bunnie
66ec140cf3 limit spi debug output 2025-04-20 03:28:40 -07:00
bunnie
b390a824d4 fix slew and drive rating for SPI interface
this is necessary to meet 50MHz timing on NTO
2025-04-20 03:28:40 -07:00
bunnie
72763dc3c7 modify fast dma test for clocking option 2025-04-20 03:28:40 -07:00
bunnie
019f342c98 update bio tests for clkmode option 2025-04-20 03:28:40 -07:00
bunnie
5e7a687c8b found the offending Debug deriver that was causing fp library bloat
this one derive was causing the bootloader to be about 20% bigger.
2025-03-05 22:42:56 +08:00
bunnie
f394ccab42
Merge branch 'main' into cram-dev 2025-03-05 20:56:36 +08:00
bunnie
c49c41699b cleanup warning 2025-03-05 20:54:03 +08:00
bunnie
57a4f24a02 restrict ObjectList to std targets only 2025-03-04 19:11:23 +08:00
bunnie
63a9a2b0a0 implement notification models for small screens 2025-03-04 19:06:41 +08:00
bunnie
1e9e02435b add missing model boilerplate
a lot of routines were left blank in the initial port to get
through the core graphics primitives porting. This commit
fills in those missing bits in a fashion that optimizes the
modals for drawing on small displays.
2025-03-04 19:05:41 +08:00
bunnie
3c5975715d kind of hack to make font rendering work on oled displays
so, there is a fundamental abstraction mismatch in the blitstr
library. In Precursor, I created a rule that you can't draw text
on black backgrounds without some special permissions in highly
trusted contexts.

For baosec, this restriction is removed because the whole OS
can run inside a single chip (i.e. we have eliminated most
easy RAM modification attacks, requires probing/glitching; but
as a trade-off, we don't have as much RAM so we can't afford the
extra abstractions).

The compromise is for OLED-type platforms where inverse drawing
is very common to save power, all text ops are assumed to be XOR
operations (so you're always flipping pixels instead of drawing
at a defined color).
2025-03-04 19:02:45 +08:00
bunnie
15f41a5f5b object list API elements 2025-03-04 19:01:47 +08:00
bunnie
5d4d009e64 add object list draw routine
this can accelerate drawing of complicated objects, such as
QR codes, that are composed of many rectangles.

there are some warts...in theory, this should be able to seralize
arbitrary-sized lists, but there must be some bug somewhere
that is preventing it from happening. For now, the list length
is clipped to the capacity of a page of memory.
2025-03-04 19:00:33 +08:00
bunnie
8602af4d18 add modals adapter code
initial take just lifted directly from the gam version;
layout details needs adapting for small screen still
2025-03-04 02:07:17 +08:00
bunnie
c67cb7666c fixup feature dependencies 2025-03-04 01:26:03 +08:00
bunnie
06d8760209 add routine to set pwm mode on axp2101 2025-03-04 01:24:41 +08:00
bunnie
da5c215477 fix type defaults for trait
part of the i16->isize transition
2025-03-03 02:12:57 +08:00
bunnie
433d632926 add a clear, modals & text bounds api calls
the text bounds api call is needed in v2 because there is no gam
to mediate this call

clear allows for a fast clear operation that may have hardware
dependent consequences

acquire/release of modals mode is added to the graphics server
as well to implement a feature previously handled by the gam
2025-03-03 02:11:23 +08:00
bunnie
b1ce74faa0 add handler for unspecified clipping areas in v2 targets 2025-03-03 02:10:50 +08:00
bunnie
2957cce789 add some v2 graphics api adapters and opcodes 2025-03-03 02:10:24 +08:00
bunnie
02bc28be4a
Merge branch 'main' into cram-dev 2025-02-28 17:44:58 +08:00
bunnie
e84daa0179 fixup more emulation issues 2025-02-28 17:42:30 +08:00
bunnie
b6ed2c7398 fix cursor overlay in sh1107 display mode 2025-02-28 17:30:17 +08:00
bunnie
db4d21c54c fix emulation bugs 2025-02-28 17:29:43 +08:00
bunnie
67e501328d mirror code structure from hosted mode 2025-02-28 16:33:31 +08:00
bunnie
317bc6a9fd related to previous commit 2025-02-28 16:33:14 +08:00
bunnie
e0ef852d06 fix routine so we're passing by reference, not by copy
this is just an "old code" problem, written before I fully understood
these subtleties
2025-02-28 16:32:32 +08:00
bunnie
8f48572b9c restrict font choices in baosec target
we have a smaller font map, so don't resolve glyphs to fonts
that we don't have.
2025-02-28 16:32:03 +08:00
bunnie
48009c710a regenerate logo according to new framebuffer layout 2025-02-27 21:35:10 +08:00
bunnie
b29d885000 fix various driver bugs & harmonize wih precursor color "standard" 2025-02-27 21:33:31 +08:00
bunnie
3d0d727094 fix bits vs bytes 2025-02-27 21:33:10 +08:00
bunnie
f3fccf9135 fix unnecessary mutability in trait 2025-02-27 03:12:41 +08:00
bunnie
9abc920bb2 refactor sh1107 driver so pixels in fb line up with bits in u32 2025-02-27 03:12:15 +08:00
bunnie
6e26db411a
Merge branch 'main' into cram-dev 2025-02-26 14:57:55 +08:00
bunnie
f5473868b1 fix return calls to use scalar5 instead of scalar2 2025-02-26 14:37:20 +08:00
bunnie
4096b35fef refactor shared implementation to use reply and receive next api 2025-02-26 14:36:50 +08:00
bunnie
2a97d9a827 fix location of font offsets 2025-02-24 02:28:34 +08:00
bunnie
ffceea0389 fix blit_screen routine 2025-02-24 00:57:53 +08:00
bunnie
a9c9d8d67b commit generated logo 2025-02-24 00:57:03 +08:00
bunnie
d281332b16 fixup conversion to simplify the image blit operation 2025-02-24 00:56:33 +08:00
bunnie
55cbe7a962 add module ref to handlers 2025-02-23 18:06:45 +08:00
bunnie
d50d228984 move baseline graphics handlers to a shared library 2025-02-23 18:06:25 +08:00
bunnie
e1a606f0bb add routines to create a clone of the display itself
this is an unsafe bit of code that is necessary because the
panic handler needs to run in its own thread with a hardware
handle to the frame buffer. this allows panics in the main
graphics thread to not cause the panic handler to fail.
2025-02-23 16:54:04 +08:00
bunnie
b7ef119a04 split pin numbers from pin setting
this allows us to probe pins/clone them without having to re-allocate
them.
2025-02-23 16:53:28 +08:00
bunnie
0d5a4e8e91
Merge branch 'main' into cram-dev 2025-02-23 12:15:37 +08:00
bunnie
9f890d3dbd add camera irq opcode to main graphics handler opcode list 2025-02-23 12:04:17 +08:00
bunnie
f37df2b1cb add hardware primitives missing for graphics layer compatibility 2025-02-23 12:02:37 +08:00
bunnie
35fe7ed73f add bitmaps for logos 2025-02-23 11:56:57 +08:00
bunnie
7e57af5841 add documentation target for library
this helps cargo doc to run
2025-02-22 01:07:12 +08:00
bunnie
56123fea8d fix doc warnings 2025-02-22 01:07:01 +08:00
bunnie
b8b1bfed03 fix doc warnings 2025-02-22 01:06:46 +08:00
bunnie
cc8a0a57a7 fixup apis to use traits 2025-02-21 23:42:01 +08:00
bunnie
8acb9e7521 add platform implementations of the frame buffer trait 2025-02-21 23:41:44 +08:00
bunnie
b352ecb667 remove platform-specific operation and replace with a trait 2025-02-21 23:41:19 +08:00
bunnie
d9d48262ac expand FrameBuffer trait to interop with precursor details 2025-02-21 23:09:45 +08:00
bunnie
efb627bf4f remove slice size specifier from blitstr2
this makes the api portable
2025-02-21 17:46:28 +08:00
bunnie
0770d5437f bring chat lib up to date with new ux-api layer 2025-02-21 17:46:11 +08:00
bunnie
27e4b77792 cleanup compile warning in cramium-api 2025-02-21 17:45:27 +08:00
bunnie
19f3221417 final changes to make ux-api platform-independent 2025-02-21 17:44:54 +08:00
bunnie
30c5876ad4 add missing apis/derives to minigfx to make it precursor-compatible 2025-02-21 17:43:50 +08:00
bunnie
07563c44db add precursor as a platform to ux-api 2025-02-21 17:43:23 +08:00
bunnie
5e258916da migrate graphics library API to a platform-neutral service crate
this kicks off an enormous set of refactoring changes...
2025-02-21 17:42:39 +08:00
bunnie
2ad0a58a56 remove redundant constants 2025-02-20 20:48:00 +08:00
bunnie
385e4198f2 accommodate movement of the opcode api 2025-02-20 20:39:28 +08:00
bunnie
fc8e7060a3 migrate opcodes out to an agnostic platform crate 2025-02-20 20:39:04 +08:00
bunnie
558c61ada7
Merge branch 'main' into cram-dev 2025-02-20 15:10:47 +08:00
bunnie
affe4e6c54 move APIs out of cramium-hal
So the organization of the code is now the following tiers:

libs/cramium-api: contains hardware-abstracted API code to the hardware
layers (traits, some constants, enums, etc.). For example, "here is
an IO trait that lets you configure and set GPIO pins", which could
then be implemented in hardware or emulation. The APIs aren't entirely
generic across all SoCs because they are tweaked to accommodate
quirks of the cramium SoC.

libs/cramium-hal: contains board-specific driver codes that do not
require persistent services to be started. Possibly misnamed because
it also includes not just cramium-chip items, but also e.g. peripherals
to the cramium SoC, such as the PMIC and camera.

services/cramium-hal-service: contains the `main` process that manages
shared resources, such as UDMA, IO pins, IFRAM. These drivers cannot
be delegated to a `lib` crate because there can be only one instance
of these resources, and instead we have to dynamically allocate
access to these through IPC messaging.

services/cramium-emu: hosted mode emulation of things in
cramium-hal-service.

services/bao-video: contains a `main` process that integrates
the camera and OLED driver. This means that all graphic drawing
primitives also interface with this crate. These are condensed
into a single process space to speed up execution, and kept
separate from cramium-hal-services because we want the video
services to not be blocked by, for example, a thread that is
handling I2C things.
2025-02-20 13:54:46 +08:00
bunnie
2235f7a3f1 clean up ux-api to be no-std clean
ux-api can't do rkyv derives and rely on std items in a
no-std environment. This is necessary because some of the
base layer APIs (frame buffers, points, etc.) are relied
upon in a no-std loader environment to render diagnostics
to the screen. Thus ux-api needs to have a baseline of
primitives available without a std flag.
2025-02-20 13:32:52 +08:00
bunnie
b33ca44e3b Complete move of cramium-emu from libs to services
I thought originally cramium-emu would be a library crate, but
actually, it makes more sense as a "services" crate. The APIs
that cramium-emu would live in cramium-api, and cramium-emu
itself is a bit closer to cramium-hal-service, filling in
the executable bits of code that allow emulation to run.
2025-02-20 13:30:55 +08:00
bunnie
9c4e7cabf6 add a "platonic" API crate for cramium
This is a distillation of cramium-hal items into "pure API"
items so that we can have a parallel cramium-emu crate.

The idea is that the API crate sits on top of both implementations;
the HAL goes to hardware, and EMU goes to hosted mode emulations.
2025-02-20 13:27:18 +08:00
bunnie
3afb01b04c add emulation HAL for cramium target
this is where we'll try to aggregate all the shims that allow
the target to work on hosted mode
2025-02-18 23:22:09 +08:00
bunnie
4872bbcee1 remove useless name argument in this version of the api 2025-02-18 23:20:48 +08:00
bunnie
f78d54a834 add configuration for doc build 2025-02-17 22:53:56 +08:00
bunnie
88be6b66ba
Merge branch 'main' into cram-dev 2025-02-17 18:35:38 +08:00
bunnie
73114f8d8d clean up ux-api integration with blitstr2
a bunch of imports were in here that should be in blitstr2
let's test this out and see how well these abstractions hold up
as we configure the rest of the OS around it.
2025-02-17 18:27:55 +08:00
bunnie
b788ed6633 move blitstr2 to its own library
this allows us to share font data between platforms without
replicating the code base
2025-02-17 18:24:39 +08:00
bunnie
e1bc6eac56 remove copy of blitstr2 from ux-api; move blitstr2 to lib location 2025-02-13 17:41:07 +08:00
bunnie
ae856ecc82 start to add in skeletons of trait implementations for ux elements 2025-02-13 17:28:56 +08:00
bunnie
c28c1f989a add hosted option to cramium-hal 2025-02-13 17:27:45 +08:00
bunnie
0bfb864873 add boasec to font feature selection; prepare for moving blitstr crate 2025-02-13 17:26:54 +08:00
bunnie
6e18096247 ux-api needs to have the board specified when cramium features are selected 2025-02-11 16:25:22 +08:00
bunnie
c2c1c8bc91 update top level libs and cargo for all the ported-in files 2025-02-11 16:24:51 +08:00
bunnie
f7193ae29c port in more helper routines 2025-02-11 16:24:30 +08:00
bunnie
3890008af1 make platform directory for graphics
trying to keep it as platform neutral as possible but it seems
we need to be able to know the size of the framebuffer at least
2025-02-11 16:23:45 +08:00
bunnie
5ed3f41bea add blitstr to the minigfx lib 2025-02-11 16:23:26 +08:00
bunnie
2a4d91d9be expand primitives in minigfx library 2025-02-11 16:23:06 +08:00
bunnie
79fae48bd8 add widget scaffolds 2025-02-11 16:22:50 +08:00
buncram
9cdb967741 add widgets to ux-api 2025-02-11 08:33:42 +08:00
buncram
69baf0f6e8 some initial notions of what widgets might look like 2025-02-11 08:33:09 +08:00
bunnie
437a5a2520 modify fast dma test for clocking option 2025-02-08 05:20:25 +08:00
bunnie
dff5bc7fa6 update bio tests for clkmode option 2025-02-08 04:35:02 +08:00
bunnie
e4646013d0 remove minigfx from the HAL aspect of cramium
it was sort of out of place there anyways...
2025-02-02 07:02:07 +08:00
bunnie
19de313067 add ux-api
ux-api is meant to be a platform-independent set of APIs for
elements involving UX interchange in xous. In particular, it
sets up the path for portability of the gfx/minigfx crates and modals.
2025-02-02 07:00:24 +08:00
bunnie
7679dc12d1 formatting changes due to changes in nightly rust
needed to get a clean check on gh
2025-02-01 06:37:38 -08:00
bunnie
4f14a67504 formatting changes due to changes in nightly rust
needed to get a clean check on gh
2025-02-01 22:26:40 +08:00
bunnie
43bc35b26e modify i2c reset condition to have wait states
this is necessary because the cpu can easily outrun the udma
block as the reset is processing, causing the re-initialization
to fail.
2025-01-30 04:17:57 -08:00
bunnie
b02112b05a fix reset conditions and straggler debug statements 2025-01-03 04:05:51 +08:00
bunnie
fa3550a30f add trait for setting IRQ on GPIO 2025-01-03 04:04:45 +08:00
bunnie
7f8f64e1be add routine to set irq pin for PMIC to board description file 2025-01-03 04:03:31 +08:00
bunnie
0953eac2ef cleanup warnings 2025-01-03 04:01:15 +08:00
bunnie
68759073ef configure the IRQ input 2024-12-27 20:01:32 +08:00
bunnie
86afe7ca0a add APIs to configure PMIC IRQs 2024-12-27 20:01:10 +08:00
bunnie
5aac426b0b more deep API cleanup
realizing a bunch of stuff like the stack expects you to enqueue
the OUT receiver with calls to read() that happen to block, fixing
max packet size that can be different for in and out end points,
and handling quirks of the core when sending setup packets longer than
64 bytes.
2024-12-23 01:18:03 +08:00
bunnie
c044b3481d beginning of breaking change to the cramium usb hal implementation
the UsbBus implementation is being totally rewritten for the
inside-out IRQ protected scheme.

we can now get past some preliminaries in the link protocol
(i.e., address setting and the first config descriptor), but
a long way to go still in debugging.
2024-12-22 00:36:57 +08:00
bunnie
9a1a6271c5 add debugging configuration features 2024-12-22 00:36:33 +08:00
bunnie
e8fd388ae9 add support for paged mode debugging
we have to allocate the virtual page in our process space before
we can use the debug UART.
2024-12-22 00:34:16 +08:00
bunnie
6625e45dd2 remove a debug print that causes the uart to be claimed prematurely
the uart in the shared library is claimed by the first process
that touches it, so prints in the shared library at early boot have
to be carefully configured
2024-12-22 00:33:16 +08:00
bunnie
45a8eb2227 stage tomls for version bump: try_send added to xous-ipc 2024-12-16 18:50:11 +08:00
bunnie
f5cae8b975 add visibility for third-party IRQ implementation
Had to promote the visibility of a bunch of event handler
structures so we can put an IRQ handler outside of the core
USB crate.
2024-12-16 18:02:01 +08:00
bunnie
5d35dee4f6 final i2c changes based on sim results 2024-12-11 04:05:24 +08:00
bunnie
4d148c9a55 check only the busy status bit for i2c to confirm command initiation 2024-12-10 18:18:15 +08:00
bunnie
90317b0adb wait for i2c commands to propagate before moving on 2024-12-10 18:06:24 +08:00
bunnie
a3ef478688 more mpw vs nto differences 2024-12-10 17:10:24 +08:00
bunnie
6e1023e5ea update comments 2024-12-10 17:05:59 +08:00
bunnie
f66bd30951 adjust timeouts for simulation 2024-12-10 17:03:52 +08:00
bunnie
5cd21f4330 add an RTL-only i2c test mode
The test is abridged because i2c is a pretty slow protocol, so we
do the bare minimum to exercise a write and a read.
2024-12-10 14:25:14 +08:00
bunnie
785826ca23 modifications to the HAL for DAR-699 2024-12-06 03:32:49 +08:00
bunnie
02b2b86184 add notes for NTO rework 2024-12-04 16:15:44 +08:00
bunnie
93b9ec00bf bump version numbers on all the packages so we can absorb num-derive changes 2024-12-02 19:14:11 +08:00
bunnie
83e26ff4c7 update num-derive dependency
this became mandatory in 1.83 to remove warnings. I think it
should have no impact on functionality.
2024-12-02 18:52:59 +08:00
bunnie
147cfb8c97 remove xous-pio references in cargo files 2024-12-02 01:21:57 +08:00
bunnie
c72607e0bf expand feature flags to be more specific to board types 2024-11-30 02:22:24 +08:00
bunnie
20b0ecd592 add verilator-only modifications to the HAL
verilator doesn't implement the TRNG, so the TRNG is bodged.
A warning is left in to help remind us/alert us if the bodge
is accidentally put into production.

the 'dabao' board type is introduced, which is the breakout board
codename.

camera and display are feature-gated behind their respective board
definitions.
2024-11-30 02:19:55 +08:00
bunnie
2dddae34fc add udma stresstest feature 2024-11-28 18:27:52 +08:00
bunnie
ffb00cf6ad turns out it helps if you put explicit pull-ups on the I/Os
reverting this change
2024-11-28 16:14:14 +08:00
bunnie
a3619618d0 slow down toggle rate on i2c so it is compatible with slow pullups
the strict verilog model has weak pull-ups which model the
"slowness" of the rise with an extended Z-condition that takes
3us to pull up to a solid 1.
2024-11-28 15:53:12 +08:00
bunnie
3738db9f5c fix io-direction issue in testbench 2024-11-28 01:28:39 +08:00
bunnie
13702f2df0 fix unit test to match actual testbench tooling 2024-11-22 15:23:38 +08:00
bunnie
83dbb82500 add routines for programming SPI flash 2024-11-22 00:55:15 +08:00
bunnie
faa8a60843 add ref to mbox module 2024-11-21 18:23:36 +08:00
bunnie
ba87422903 add platform code for mailbox to CM7 2024-11-21 18:23:20 +08:00
bunnie
996b574486 quiet down debug; add a method to expatriate PORTSC 2024-11-20 21:42:02 +08:00
bunnie
5ec5bc29c9 add keyboard pins to board description 2024-11-20 01:42:47 +08:00
bunnie
6829eae73c add a reset method to the UDMA abstraction 2024-11-20 01:42:27 +08:00
bunnie
72685e2c1c improve i2c error recovery 2024-11-20 01:42:06 +08:00
bunnie
289d6879ca fix typo 2024-11-19 22:15:47 +08:00
bunnie
a40d78f3ea add backpressure setting to SPIM; also re-attempt interface clearing
...now that we have the right bit...
2024-11-19 00:00:50 +08:00
bunnie
e8e28702e2 fix position of clear bit; add backpressure feature for NTO 2024-11-19 00:00:18 +08:00
bunnie
fe45f40cb7 increase verbosity of pl230 output for co-debugging 2024-11-18 18:38:41 +08:00
bunnie
d0e638e020 enequeue data before command is issued
it becomes clear on a slower bus configuration that this is
the correct ordering for udma

also add code to debug timeout cases
2024-11-18 18:36:23 +08:00
bunnie
0c5fde7fc2 reformat busy statement for easier debug 2024-11-18 18:35:56 +08:00
bunnie
21e59885e3 add some attempts to debug the SPIM lockup.
for now, filing a bug agaisnt the IP block
2024-11-08 00:17:42 +08:00
bunnie
12f0159fc0 make camera IFRAM de-allocateable
This allows us to use the RAM for USB stack operations.

Will cause panics if camera is operated without re-allocating
the memory.
2024-11-07 16:12:01 +08:00
bunnie
b1e31924a0 add helper routines for qr finding 2024-11-05 01:45:29 +08:00
bunnie
92509c448b some debug cleanup 2024-11-04 22:53:31 +08:00
bunnie
4f85deaecb change api name for resolutions to dimensions 2024-10-27 23:26:45 +08:00
bunnie
d41113fb9a fix operator chaining 2024-10-26 18:42:16 +08:00
bunnie
4dd78b9727 add descriptor chaining helper methods
mass storage is...somewhat stable now, on both linux and windows,
but there are some corrupt packets. need to look into whether
electrical issue, or if we're stomping the transfer buffers because
we've not managed them correctly.

Also need to reflect on how to turn this API into something
safer...the hardware is doing *so much* in this API, the driver
is basically global mutable state with arbitrary slices you can
write over the ends once you hand things off to the driver.
2024-10-26 03:07:00 +08:00
bunnie
9e0bd64195 allocate large swathes of memory to camera
this is for higher resolution QR code scanning

makes it incompatible with simultaneous USB usage

however, when camera is off, the USB stack can be started, and
vice-versa. Basically, you can't both do active USB and camera
at the same time, but you can do one or the other.
2024-10-21 01:22:12 +08:00
bunnie
b5f7c4c490 add minigfx to hal lib 2024-10-21 01:18:51 +08:00
bunnie
407dec86a3 adopt platform & display -agnostic APIs for SH1107 frame buffer 2024-10-21 01:15:48 +08:00
bunnie
0081575e80 fix timer primitive for ov driver 2024-10-21 01:15:09 +08:00
bunnie
d5ba0c4cb7 add a plantform-agnostic graphics API
first step on a long road to improve the graphics API on Xous.
2024-10-21 01:13:40 +08:00
bunnie
f214e9c4d1 add frame slicing to ov2460 driver 2024-10-20 17:04:35 +08:00
bunnie
529c8b18b2 various fixes to driver
- add USB mass storage state tracking for handler-based intervention
- fix some wait loops

need to regression test this againt a xous-mode USB operation
2024-10-19 00:12:38 +08:00
bunnie
2ec562169c modify USB HAL for no-std ops
split the handler out into a function pointer

add callbacks for completion handling of EPs - in-line with
the reference code

improve the pei handling

change visibliity of structures to allow for out of crate
handlers
2024-10-18 04:14:49 +08:00
bunnie
2cb3bbf780 add SE0 pin setup 2024-10-12 00:46:15 +08:00
bunnie
701170e7e7 make device opening fallible 2024-10-12 00:45:53 +08:00
bunnie
37e82f1662 add ticktimer ref to cramium-hal
this is needed for delays in Xous mode - the camera requires
some dead-reckoned delays between i2c writes and reads
2024-10-10 02:07:15 +08:00
bunnie
7bd9e2b86b add camera pins & ifram spec 2024-10-10 02:04:49 +08:00
bunnie
552096d2a0 add prelim ov2640 driver 2024-10-10 02:04:22 +08:00
bunnie
091082dfcc add a clear routine for the sh1107 frame buffer 2024-10-10 02:03:59 +08:00
bunnie
2d8747605c promote visibility of some udma config constants 2024-10-10 02:03:37 +08:00
bunnie
c001b2759e add a method to clone an iox handle
gpios for everyone!
2024-10-10 02:03:11 +08:00
bunnie
30fdc139e5 simplify new methods for spim 2024-10-08 17:59:42 +08:00
bunnie
b99c5544c6 simplify new methods for i2c 2024-10-08 17:59:31 +08:00
bunnie
717ddefb2e add references to new libraries 2024-10-07 22:53:29 +08:00
bunnie
be56097fe4 add axp2101 driver skeleton 2024-10-07 22:52:55 +08:00
bunnie
f95941af83 add I2C features to the board description file 2024-10-06 02:44:47 +08:00
bunnie
7399c4a6da add mapping for i2c channels to global clocks; fix typo 2024-10-06 02:44:16 +08:00
bunnie
d45052b772 add i2c base driver 2024-10-06 02:43:49 +08:00
bunnie
81c6d9510b modularize the udma module 2024-10-04 22:59:02 +08:00
bunnie
d21789beff remove the chip select gpio-wait hack
We use the txrx call instead, which does not signal a completion
until the rx transaction is finished (which is after the final
bit is received of a pending SPI transaction).
2024-10-04 22:51:36 +08:00
bunnie
683aa63616 add async txrx variant to spim API
This allows us to do a "swap" transaction (transmit and receive)
asynchronously (the await returns a pointer to the receive buffer).

Note that a pure-rx-only variant is still todo, but should follow
pretty naturally from the pattern outlined here.
2024-10-04 22:49:56 +08:00
bunnie
669ab294f2 update lib refs and manifest 2024-10-04 13:05:40 +08:00
bunnie
be8f939311 update hardware descriptor to point to the oled 2024-10-04 13:05:01 +08:00
bunnie
437dcb2de5 add IoGpio trait
this allows us to stash a reference to the Iox in both std
and no-std reperesentations of the hardware.
2024-10-04 13:04:22 +08:00
bunnie
b6532ffd39 add the 'SharedCsr' type object
this is a CSR object that presents writes as an immutable on the
parent object. This simplifies traits, etc.

On the one hand, the CSR itself is truly immutable - the address
represented by the CSR does not change.

On the other hand, the underlying data inside the CSR is changing,
so, the CSR actually represesnts an immutable pointer to a mutable
piece of data.

For the case of the UDMA, we have a bank of globally shared state,
it is much more convenient to think of the CSR as immutable, and
we manage the underlying global shared state through other checks,
e.g. through dynamic allocators that track when various blocks
or resources have been parceled out.
2024-10-04 13:01:03 +08:00
bunnie
c2ff7c759d prelim driver for sh1107-style OLED displays 2024-10-04 13:00:36 +08:00
bunnie
c44f117331 fixes to udma SPIM for tx-only mode
- fix tx_await() condition to consider both control and tx channels
- make tx_async more efficient for the common case that the buffer
fits in a single transaction by appending the CS de-assert as part
of the initial command stream
- make trait for the udma global clock setting

The high bit in this exploration is that there seems to be no
way to actually confirm when a UDMA transaction has fully completed
on the hardware interface. All the completion signals tell you
when the software-side UDMA resources are freed up. However, in this
case, the hardware-side resources may still be transmitting/receiving
data.

This is a problem for the case of a '4-wire SPI' display where you
need to set an extra line to control command/data mode addressing.

In this case, the current work-around is to read back the state of
the chip select pin as a GPIO to determine when the hardware has
finished.

I suspect that if we can figure out how to use UDMA in a full duplex
mode that we could do something more essentially linked to the
hardware, but this would also require having a dummy Rx buffer allocated
that is the same depth as the hardware Tx buffer if all you cared about
is the hardware conclusion of a Tx.
2024-10-04 12:53:55 +08:00
bunnie
412a76288a fix formatting 2024-10-02 01:47:41 +08:00
bunnie
d6790489f1 migrate more board parameters to board files 2024-10-02 01:44:33 +08:00
bunnie
20dd9b2c14 consolidate spi pin setup routines 2024-10-02 00:23:17 +08:00
bunnie
6eca732043 cleanup a warning 2024-10-01 23:15:22 +08:00
bunnie
c0ddf5f82a add board feature placeholders 2024-10-01 23:14:20 +08:00
bunnie
81637f119b add helper to translate return values from io setup to udma clock channels
this allows us to tease out the clock setting code from the pin
setting code. probably will need to add more helpers for other
peripherals as we continue through with this exercise.
2024-10-01 23:13:08 +08:00
bunnie
45d9487c70 add board module to the project 2024-10-01 23:12:53 +08:00
bunnie
1dbfb21020 add some stand-in code for board definitions on the cramium platform 2024-10-01 23:12:30 +08:00
bunnie
c7bdc1aec5 refactor iox to have a setup_pin() trait
this lays the foundation to make code portable between std and
no-std environments for setting up pin configurations.
2024-10-01 23:11:24 +08:00
bunnie
ab41cbc299 make aclk test allow both registered and unregistered mem configs
both are valid, which is picked in the end will depend on
timing closure
2024-09-26 18:19:27 +08:00
bunnie
0b419400c7 improve reset condition for filter & make pass criteria tighter
- filter setup can be impacted by previous engine running, make
sure engines are stopped and FIFOs flushed prior to test start
- when reading a filtered bank we can get garbage, so make the
test check for the specific value we should see.
2024-09-26 18:18:12 +08:00
bunnie
81f0523ee3 add functional multiply-accumulate test
note that multiplies must go from register to register,
they can't directly pull out of FIFO regs
2024-09-26 18:17:31 +08:00
bunnie
7b8f4d91ec add mul unit test 2024-09-26 18:17:14 +08:00
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
67e0004f73
Merge branch 'main' into rkyv-0.8-migration 2024-09-23 22:32:34 +08:00
bunnie
f494da21cc absorb new xous-ipc version 2024-09-23 22:05:50 +08:00
Sean Cross
8e27dce59c flatipc: release 0.1.2
This releases flatipc 0.1.2 with more documentation and a new
`Ipc::from_memory_message()` call to reconstitute an object from a
xous::MemoryMessage.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-23 19:32:54 +08:00
bunnie
3a9a7ebf02 length of a record stored is the pos field for rkyv-to-pddb
prior use of `rkyv` reserves two bytes to record `pos` pre-pended
to the rkyv record

the new rkyv works without having to do that because it indexes
the rkyv data off the end of the stored records. Thus, all you
need to know is the total length of the byte slice that stores
the serialized data. This is available as the return argument
when you read a PDDB key, so we don't have to explicitly store it
anymore.
2024-09-23 17:01:13 +08:00
bunnie
c699e06c5a port rkyv ser/de usage in mtxchat 2024-09-23 17:00:16 +08:00
bunnie
75954de8d6 commit the version bump 2024-09-23 01:46:25 +08:00
bunnie
888cd2252e
Merge branch 'main' into rkyv-0.8-migration 2024-09-23 01:23:12 +08:00
bunnie
44b9041d0d attempt to update rkyv use in TLS library
@nworbnhoj would love it if you could have a look at
the implementation and let me know if I've ported this correctly.

I think what was going on is you were using rkyv to serialize
a structure to the PDDB. I've just updated the ser/de to use
the latest `alloc` API (which is much simpler than the API used
in xous-ipc because it is no-alloc).

I'll try and run some tests that involve the TLS crate too down
the road under the theory that it would suss out any porting
errors.
2024-09-23 01:14:41 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00
Sean Cross
3eb54d2cc9 flatipc: add more checks to vec and string
These are required as this goes across the IPC boundary.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 19:26:48 +08:00
Sean Cross
0c5b011fcf flatipc-derive: remove outdated header
Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:51:40 +08:00
Sean Cross
c8d70aae6a flatipc: run cargo +nightly fmt -p flatipc
Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:49:56 +08:00
Sean Cross
a77fdac6f0 libs: add flatipc implementation
flatipc is a new method for doing IPC. This is a zero-copy approach
where structs are given `repr(C)` implementations that are well-defined
and work across process boundaries.

If the same struct or enum is used in two processes that has the same
layout, then data can be freely passed between the two processes without
incurring a serialization or deserialization penalty, provided the
following hold:

1. The buffer must be page-aligned and be a multiple of the page size
2. The item must be `#[repr(C)]`
3. There must be no pointers or references of any kind

If these three things hold, then the object is safe to sling across the
process boundary.

This crate adds the ability to annotate structs with
`#[derive(flatipc::Ipc)]` to provide them with this functionality. When
doing so, objects gain the `.into_ipc()` call that turns them into
something that can be sent across process boundaries.

The resulting object has `.lend()`, `.lend_mut()`, `.try_lend()`, and
`.try_lend_mut()` as functions.

Signed-off-by: Sean Cross <sean@xobs.io>
2024-09-22 18:32:58 +08:00
bunnie
34e6f46d63 formatting changes that resulted from the regex search
a bunch of lines are shorter or different length now which
triggers a mandatory reformat. this patch cleans that up,
so that going forward the manual rework patches are clearer and
not tied up with formatting patches.
2024-09-22 15:31:14 +08:00
bunnie
52ffd88b40 regex search/replace instances of xous_ipc::String to String
split into multiple commits for easier committing
2024-09-22 14:17:03 +08:00
bunnie
3cdf01d5e9 fix rust-1.80 warnings for cram-soc config 2024-08-19 02:57:12 +08:00
bunnie
00da783c4d add filter tests to dma suite
the filter is on by default (which blocks all DMA access with
the null settings) and can be configured to restrict access to
regions of memory that contain secret materials.
2024-08-02 17:25:38 +08:00
bunnie
28142e2b24 cleanup bios tests 2024-07-13 22:34:59 +08:00
bunnie
c3bbbbd672 fix bug in i2c library where i/o was not set low
you have to write *0* to the clear register to set the port low.
always the weird gotcha on that one...
2024-07-05 01:59:14 +08:00
bunnie
2ebe7f3c64 fix port ordering for NTO
don't think we'll be doing much with the MPW + PIO banks anyway anymore...
2024-07-05 01:58:42 +08:00
bunnie
059855201b add a simple dmareq handler test 2024-07-04 05:26:22 +08:00
bunnie
7f35fa8e72 add unit tests for aliased fifo pages 2024-07-04 03:58:33 +08:00
bunnie
7b2109b1cc improve bio tests
- don't dead reckon tests: read feedabck from the hw to know
when they are done
- fix doc bugs
- add more test feedback on long-running tests
2024-07-03 01:23:48 +08:00
bunnie
e0d09f1d3b more DMA corner cases
bytes, half-words, words, multi-core contention, oh my!
2024-07-01 16:45:02 +08:00
bunnie
64c281bfe0 add DMA tests to bio library 2024-06-30 03:28:22 +08:00
bunnie
6ddc8bc79a
Merge branch 'main' into nto-work 2024-06-27 00:41:07 +08:00
bunnie
311154e231 absorb version bump 2024-06-27 00:26:12 +08:00
bunnie
43db94061d add arithmetic tests
this exercises a simple stack-based routine to check that
the RAMs are correctly wired. Note that due to a lack of
creativity on my side, only cores 0, 1, and 3 are exercised;
it's just assumed that core 2 works as well since everything is
instantiated by loop.
2024-06-27 00:11:52 +08:00
bunnie
d665805523 Refactor remaining tests for multi-bank RAM op
BDMA memory pages for each core are now on separate pages, with
each core having a private memory space.

Also add code readback tests, debug PC & trap test
2024-06-26 15:01:59 +08:00
bunnie
bd9500110c copy xous-bio crate to xous-bio-dma
this is the starting point for the rework of the BIO with DMA mods
2024-06-25 03:32:49 +08:00
bunnie
d0f94424db reformatting and shuffling of test order and printouts
just determining a good target length for instruction memory size
for the next iteration of the bio core
2024-06-25 03:32:12 +08:00
bunnie
6618d8dc4d improve docs on what's happening in the TRNG buffer 2024-06-22 21:18:48 +08:00
bunnie
3cefb722e6 harmonize register set for testing to what's in hw 2024-06-21 18:55:54 +08:00
bunnie
75cc40d866 Update TRNG settings
new settings are much *much* better; no more need for entropy
compression.
2024-06-18 00:08:03 +08:00
bunnie
57342ebc4a commit some one-off hacks while trying to explore reliability of serial USB 2024-06-16 01:51:57 +08:00
bunnie
9bcb65449e fix missing dir api 2024-06-15 17:54:49 +08:00
bunnie
831cad011e add flow control and and enq/deq management on app buffers
currently uses just a "dumb" 0-to-max scheme and then block until
drain. A more efficient implementation might implement a circular
buffer but it's more tricky to code -- just want to get something
working for now.
2024-06-15 17:36:12 +08:00
bunnie
7824874cc8 some tweaks to try and make stalls appear at the right time??? 2024-06-14 18:57:48 +08:00
bunnie
832d0205c2 expose append zero packet api and rename function to be generic 2024-06-14 16:11:38 +08:00
bunnie
d2c534a3c8 document the entropy compression method
compression helps us reduce the amount of data we have to
shuttle between the hardware interface and the rest of the world.
It takes more samples from the TRNG and represents them in a compressed
form that effectively increases the bits per byte of entropy. It
does not increase the *rate* of entropy generation -- while each
byte has more entropy, the bytes come proportionally slower. However,
this is a reasonable trade-off because kernel space calls to fetch
the entropy feed are expensive, and what this does is effectively
amortize the price of a syscall: the time per syscall is longer,
but you get more entropy out per syscall, thus effectively reducing
the needed overhead to get a certain amount of entropy.
2024-06-14 16:09:01 +08:00
bunnie
f6fe1143e2 compress sparse TRNG output data 2024-06-14 14:33:11 +08:00
bunnie
af4f096387 quiet down debug 2024-06-13 22:07:08 +08:00
bunnie
5a1c3ca6fe cleanup warnings on the USB driver 2024-06-13 16:08:18 +08:00
bunnie
a360f3ee52 bump xous pins for RawTrng API 2024-06-13 15:49:35 +08:00
bunnie
b24cf4fd8e add guardband code to driver 2024-06-13 15:42:58 +08:00
bunnie
34808beb8f remove unused dep 2024-06-13 15:32:34 +08:00
bunnie
3abb68cbdc adjust TRNG parameters to match hw reality 2024-06-13 15:32:06 +08:00
bunnie
61ed5aa145 reduce debugging so USB serial works 2024-06-13 00:35:17 +08:00
bunnie
1de497e3fe commit the todo 2024-06-12 14:16:49 +08:00
bunnie
bbc7158dc1 cleanups to debug output
works under linux, not windows
2024-06-12 14:11:16 +08:00
bunnie
f96ca0ee93 ok. finally, an end to end of HID: can send keys now to linux
windows still not working, it's fussier.
2024-06-11 23:18:13 +08:00
bunnie
7b2804eec5 endpoint enumeration now working
turns out that you *have* to enable the endpoints after your
address has been assigned. You can't do it before.

Very subtle one-liner in the docs that I missed until now. :-/
2024-06-11 22:30:55 +08:00
bunnie
f004c45f2a trying to debug ep activation problem
this commit hangs on a wait for ep to start running
2024-06-11 21:13:45 +08:00
bunnie
b08851b741 enumeration is now "mostly" working
- need to handle something with how stalls are handled
- need to handle responses to requests that don't exist
2024-06-11 16:38:34 +08:00
bunnie
cb12ee3769 first time we're seeing a handshake in xous. 2024-06-10 23:35:09 +08:00
bunnie
ac7b58b702 trying to back-trace to a working bootloader state 2024-06-10 18:45:44 +08:00
bunnie
3f75da8240 commits related to previous commit on demo 2024-06-09 23:53:55 +08:00
bunnie
31e03a9bc7 add routines to move packets; refactor tricky bits
we're able to receive the setup packet, but still nothing is
being sent out of the core.
2024-06-09 04:27:31 +08:00
bunnie
a32a2f2395 more debug progress
- 2nd bank of magic numbers seems more stable-ish
- can now get to the point of a setup packet being received
and flagged
2024-06-08 00:51:13 +08:00
bunnie
ca8fd21c44 interrupts are minimally responsive now 2024-06-07 13:54:37 +08:00
bunnie
41d0364cf4 more debug 2024-06-06 22:26:16 +08:00
bunnie
e9217b7eb6 convert HAL to be driver-friendly
rewrite so the driver obeys the type bounds necessary for
USB stack integration, in particular, Sync requires all raw pointers
to be AtomicPtr
2024-06-06 17:54:24 +08:00
bunnie
8ef46fd081 move usb driver to a common location 2024-06-06 03:58:35 +08:00
bunnie
907b0c543a move order of tests 2024-06-03 03:43:57 +08:00
bunnie
c4d787356b add aclk unit test 2024-06-02 20:20:06 +08:00
bunnie
5c9b91d22a integrate i2c driver and update test log 2024-06-02 19:17:27 +08:00
bunnie
cc7b1158f3 create a "proper" i2c driver for BIO
this is an actually usable driver for end applications.
maybe some massaging needs to be done on shared resources, but
from the i2c standpoint this can do SMB, I2C transactions with
a fairly "normal" API.
2024-06-02 19:16:27 +08:00
bunnie
3e263c1974 update docs to match small change to spec 2024-06-02 06:21:42 +08:00
bunnie
559be323b7 i2c demo about working 2024-06-02 06:21:29 +08:00
bunnie
935857a675 add basic i2c concept 2024-06-02 02:39:45 +08:00
bunnie
23f2b117ab dont use report_api inside the generation macro - just for debugging 2024-06-02 02:39:30 +08:00
bunnie
9fe1933611 minor cleanup 2024-06-02 02:39:06 +08:00
bunnie
41e636bb8c fix formatting 2024-06-01 22:00:30 +08:00
bunnie
c113c4e9bd incorporate i2c module, pretty prints 2024-06-01 22:00:07 +08:00
bunnie
24bd9da6ab pretty-print unit tests 2024-06-01 21:58:18 +08:00
bunnie
e0f3ee8e49 pretty-print spi 2024-06-01 21:58:05 +08:00
bunnie
ccc342d9f3 add debug pretty-printing to test 2024-06-01 21:53:54 +08:00
bunnie
ac95f9a6df
Merge branch 'main' into bio 2024-06-01 11:03:53 +05:30
bunnie
a8518f7fa1 create a serializable version of Spim
this works by blowing apart the structure and re-assembling
it on the other side. The reason we can't simply pass it
is because the hardware pointer to the core register violates
a Rust safety rule, but Rust doesn't know that this pointer
points to a hardware register that's immutable and static versus
a regular block of memory that can go away.
2024-05-31 20:39:39 +08:00
bunnie
cdf0289099 add rv deps to the cramium-hal
needed for manipulating irqs
2024-05-31 03:39:32 +08:00
bunnie
17a2330681 add an IRQ API for the UDMA
this API has the unfortunate problem that only one process
can manage all the IRQs for all the serial ports, due to the
concentration of all IRQs into a single register bank.

That being said, it does support registering multiple repsonders
in a somewhat ergonomic fashion.
2024-05-31 03:38:23 +08:00
bunnie
35e7cf3a5b bump xous dep revs 2024-05-29 02:07:06 +08:00
bunnie
34e7474b80 add work-around for DAR-620
UDMA Rx busy bit seems to get stuck occassionally. This seems
to be aggravated if we insert a dcache_flush in the poll loop.

The current time-out code seems to mitigate the problem, but
I have low confidencne that this is a 100% solution. I have a feeling
we'll be revisiting this again soon.
2024-05-22 18:08:50 +08:00
bunnie
9e66c1bee2 commit the version bump 2024-05-07 01:03:05 +08:00
bunnie
0f79056ac7 refactor spim divider equation to reflect reality 2024-05-06 03:32:41 +08:00
bunnie
6723b9d67c cleanup missing APIs
- need to be able to specify the mode that a SPIM could be in
that was set up by the bootloader
- make yield() optional - it could be useful if the API is used
in userland contexts, but in an interrupt context (e.g. swapper)
it should not be used.
2024-05-06 02:26:55 +08:00
bunnie
58308656a0 fix feature flags for xous deployment 2024-05-06 02:25:09 +08:00
bunnie
be2e450686 fix address ordering error on RAM 2024-05-05 21:48:04 +08:00
bunnie
914acb9c12 apply the optimization to writes as well 2024-05-05 16:41:00 +08:00
bunnie
6d7d3b244d slight optimization to SPIM read 2024-05-05 16:39:59 +08:00
bunnie
ad4f05bed5 fix address ordering bug; cleanup chip select timing 2024-05-05 16:31:21 +08:00
bunnie
a0aeaae106 issue command to exit quad mode, in quad mode
if not in quad mode, command is ignored; but without this,
the command is never accepted if you are in quad mode.

the idea is you use this to reset the chip when you don't
know what mode it's in.
2024-05-05 03:23:37 +08:00
bunnie
7c0aa1bcbe add debugging support to HAL lib
tries to do the right thing in both Xous and bare metal environments,
although, xous formatting might be a little funky.
2024-04-30 17:12:41 +08:00
bunnie
1b4e6b310a SPIM bug fixes
- improve visibility of core structures for debugging
- add qpi-mode ID readouts
- support different commands for flash/ram ID readout
- fix bit-shift bug on cmd (docus say to "align to MSB" but
I don't know what MSB they are talking about, it only works if
you align the commands to LSB).
2024-04-30 17:11:02 +08:00
bunnie
436be7ae9c fix masking bug in iox implementation 2024-04-30 17:10:28 +08:00
bunnie
34489d5f94 raise visibility of internal ifram structures
allows for abstraction violations but at this stage of debugging,
we'll need it.
2024-04-30 17:08:09 +08:00
bunnie
e5dfd14daa fix bugs found by rustc
thanks, rustc, for finding these bugs!

this is why we cleanup warnings regularly.
2024-04-29 04:08:52 +08:00
bunnie
0131315e3a cleanup trng warnings -- it's going to be a while before this is fixed
I think I may have to be patient on waiting for docus on how to
tune the trng, so, turning off these warnings for now. trng tuning
will be "an event", I expect.
2024-04-29 04:07:52 +08:00
bunnie
431ca216f9 improve visibility of hal elements 2024-04-29 03:43:03 +08:00
bunnie
e3e3b3125c cleanup warnings 2024-04-28 02:57:24 +08:00
bunnie
588e1cf9f1 add some debugging, convenience routines to trng driver 2024-04-28 02:44:10 +08:00
bunnie
c407db877e change DUART ports to accommodate jtag breakout 2024-04-22 11:00:06 +08:00
bunnie
4ace363abc this resolves comments from @xobs' code review 2024-04-09 18:23:09 +08:00
bunnie
588e7aaf0a add spi memory drivers to udma library
totally untested, but, at least structurally present so we
have a chance that our memory structures and APIs can work.
2024-04-06 22:54:34 +08:00
bunnie
d6b33159a5 stage version pin bump 2024-04-01 15:46:26 +08:00
bunnie
62b2567ade add comprehensive host fifo test 2024-03-20 13:41:40 +08:00
bunnie
5911808611
Merge pull request #509 from betrusted-io/bio
WIP: BIO driver
2024-03-12 18:24:38 +08:00
bunnie
133bb2b74f fix a few minor details missing in the tests
also update docs and completion tracker
2024-03-12 13:54:07 +08:00
bunnie
4fa3dd3b59 add spi unit test 2024-03-12 04:53:37 +08:00
bunnie
a96abc669f add interrupt clear call 2024-03-07 01:32:15 +08:00
bunnie
2f5a717e65 add unit test for inter-core events and fifo events
synthetic test that exercises multiple cores triggering each
other, waiting on each other to complete tasks, and waiting on
the host to meet conditions such as fifo fullness levels before
running.

this proves out the basic concept of inter-core eventing.
2024-03-04 04:08:01 +08:00
bunnie
0844cfbc52 more unit tests
fifo input/output from host with back-pressure works
gpio loopback input testing works

framework for automated assertion testing is in place;
all tests from this point forward will endeavor to include
some asserts that will cause the test to fail, so we don't require
manual inspection to check test results.
2024-03-03 18:33:30 +08:00
bunnie
8a7b5e5627 add the FIFO basic unit test + todo list of tests 2024-03-03 02:39:12 +08:00
bunnie
e1b0d83cbd add test plan 2024-03-02 02:02:02 +08:00
bunnie
e3cdb4a35d unit test for "hello multiverse"
four cores started all at once, each responsible for updating
a byte of the GPIO range, in unison.
2024-03-02 02:02:02 +08:00
bunnie
6c6634540c skip address tag embedded within the loadable program 2024-03-02 02:02:02 +08:00
bunnie
260ec0b39b wrap assembly code generator in a macro
This macro takes as arguments the name of the function
you want to use to retrieve the assembly code, and two labels,
one for the start and one for the end of the assembly code,
and the assembly code itself.

The labels for the start/end of assembly code are identifiers
and because of Rust's rules macros can't create identifiers out
of thin air (I wish instead of saying "partially hygienic", they
just said, "you can't create identifiers that don't exist". Yes,
I'm sure "partially hygienic" has some other meaning to computer
science people but to me it's just pretentious bullshit that
forces me to read through four blog posts and three issues to
come to the practical conclusion I really wanted to know; I
think maybe they wanted to refer to it as hygiene because the
limitation is super frustrating and hygiene sounds like a positive
way to spin something that is annoying. Sure. It's fine. You
didn't want to allow macros to make identifiers because it can lead
to surprising behavior and name space conflicts. That's your choice
as a language designer, just say it.).

Anyways. as usual, rust macro took way too long to write.
2024-03-02 02:02:02 +08:00
bunnie
f24746b88a start on a simple "multi-core" test 2024-03-02 02:02:02 +08:00
bunnie
633b76eb5d flesh out common useful routines for bio access 2024-03-02 02:02:02 +08:00
bunnie
e297c02cf3 add crate for BIO - better I/O - driver 2024-03-02 02:02:02 +08:00
bunnie
b6e5e7f2c2 apply formatting patch
@nworbnhoj, i saw you had explicitly done a formatting pass.
However, I think maybe the +nightly flag was missing, it looks
like the formatting ignored our custom rule set, which requires
nightly?
2024-03-02 01:26:51 +08:00
nworbnhoj
ffac721c6b rustfmt
deliberate check of automated rustfmt_check.yaml

confirmed - system works
2024-03-01 09:19:15 +10:00
nworbnhoj
01b13e0e32 replace vendored-in rustls::crypto:💍:SUPPORTED_SIG_ALGS with public access 2024-03-01 06:50:04 +10:00
nworbnhoj
7f19e660d9 add link to rustls issue
https://github.com/rustls/rustls/issues/1819
2024-02-29 09:53:02 +10:00
nworbnhoj
b217c1546e tls tidy-up 2024-02-29 06:52:50 +10:00
nworbnhoj
6d24f1af41 refine tls probe() remove unnecessary Option 2024-02-29 06:18:43 +10:00
nworbnhoj
17c1fabc1e refine shellchat net tls test for tls 1.3
https://docs.rs/rustls/latest/rustls/manual/_03_howto/index.html#unexpected-eof
2024-02-28 13:55:49 +10:00
nworbnhoj
332c2975ba reinstate tls::ota add_der_header() and rm_der_header()
In keeping with webpki-roots - the TrustAnchors are managed without the Der Tag::Sequence header

This in turn requires that:
- the header is removed from x509 fields before saving in the pddb, and
- the der Tag::Sequence is added to ota.subject before it can be decoded  () see ota.subject()
2024-02-28 12:40:05 +10:00
nworbnhoj
7760b02229 refine tls::ota.from(&TrustAnchor) 2024-02-28 06:59:38 +10:00
nworbnhoj
faece9783e refine tls:rota.subject() -> Result<String, Error> 2024-02-28 05:24:57 +10:00
nworbnhoj
8ed22b8257 refine shellchat net tls mozilla 2024-02-27 08:48:10 +10:00
nworbnhoj
a3740df71a refine shellchat net tls test 2024-02-27 07:23:09 +10:00
nworbnhoj
bb2b7f05e7 fix tls::ota.pddb_key() 2024-02-27 07:22:11 +10:00
nworbnhoj
2cc0052d7d refine tls::ota.into() TrustAnchor 2024-02-27 07:21:36 +10:00
nworbnhoj
e608e7bb30 update shellchat net tls mozilla for rustls v22.2 2024-02-27 07:20:32 +10:00
nworbnhoj
1f6ec1fe69 refine danger:StifledCertificateVerifier 2024-02-25 15:50:47 +10:00
nworbnhoj
92d1b21caf Add a single bogus TrustAnchor to danger::StifledCertificateVerification root_cert_store
rustls::ServerCertVerifierBuilder::build() returns a `CertVerifierBuilderError` if no trust anchors have been provided.
2024-02-25 15:49:36 +10:00
nworbnhoj
8d4494a005 implement tls::ota.subject() 2024-02-25 15:47:32 +10:00
nworbnhoj
04e2311920 simplify rustls::ClientConfig in tls.probe() 2024-02-25 07:42:45 +10:00
nworbnhoj
bda9bc94e2 tidy-up after update to rustls v22.2 2024-02-25 05:28:07 +10:00
nworbnhoj
2d744f1267 resolve tls ownership issues 2024-02-25 05:23:57 +10:00
nworbnhoj
39f3b782fa update tls lib.rs for rustls v22.2 2024-02-25 05:20:48 +10:00
nworbnhoj
ad01b7de6c rename RustlsOwnedTrustAnchor to OwnedTrustAnchor and update for rustls v22.2 2024-02-25 05:07:05 +10:00
nworbnhoj
fa24528226 update impl ServerCertVerifier for StifledCertificateVerification 2024-02-25 03:16:18 +10:00
nworbnhoj
8e7fd7d1a8 relocate ServerCertVerifier 2024-02-15 10:42:32 +10:00
nworbnhoj
84200b2cd2 replace Certificate with CertificateDer 2024-02-15 10:41:45 +10:00
nworbnhoj
60aa640f23 relocate ServerName 2024-02-15 10:33:55 +10:00
nworbnhoj
2b3d982d3f relocate TrustAnchor 2024-02-15 10:30:08 +10:00
nworbnhoj
d0fba6fbd7 replace SystemTime with UnixTime 2024-02-15 10:28:17 +10:00
nworbnhoj
ba6d3fcdf6 rename WebPkiVerifier 2024-02-15 10:27:17 +10:00
nworbnhoj
f2204c5a25 relocate ServerCertVerified 2024-02-15 10:23:48 +10:00
bunnie
32a8a54ec4 upgrade sct so we're all using ring-0.17 2024-02-11 01:32:13 +08:00
bunnie
5fb368ae05 partial progress on porting to ring-0.17 2024-02-09 17:18:41 +08:00
David Kotval
8eb0a26d51 fix: don't break tls
Due to our patch of ring@0.16.0, we must be careful
that none of the transitive deps of the tls packages
try to use a newer ring.
2024-02-08 12:47:45 -06:00
bunnie
98f964be50 fix cramium target 2024-02-06 15:30:48 +08:00
bunnie
699004e7b0 bump xous pins 2024-02-06 14:49:10 +08:00
bunnie
bf15d7c803
Merge branch 'main' into refactor-sha2 2024-02-01 01:46:31 +08:00
bunnie
40423f9448 fix hosted and renode modes 2024-02-01 01:42:18 +08:00
bunnie
55d88587a9 upgrade all the subordinate Cargo.toml files to match the patch
looks like about 9 crates will be affected by this. Point them
all to the latest version of the API, and specify the
"precursor" feature (which activates our patch)
2024-01-30 01:43:09 +08:00
kotval
fe5a93744f
Merge pull request #1 from kotval/out_of_tree_issue
Localization Issues
2024-01-29 10:44:35 -06:00
buncram
36c8e87889 add before/after data wait states to chip select; fix bug in CSR alloc 2024-01-29 02:07:45 +08:00
buncram
8d729cee01 cleanup warnings in ifram 2024-01-29 02:06:32 +08:00
bunnie
faa867e63d fix bug in page alignment logic
size, you can do this one liner:

let aligned_size = ((unasigned_size + alignment_quanta - 1) / (alignment_quanta)) * alignment_quanta;

before i was doing this with a `let mut` + `if` statement. this is not as obvious
but more compact, probably you'll start to see this idiom more and more in the code.

I think it's also computationally efficient, because as long as
the alignment_quanta is a power of 2, the compiler does something
like a shift right with the `/` operator (and it may also do something
like a shift left with the `*` operator as well).
2024-01-28 17:08:04 +08:00
bunnie
da0d08f7b6 fix scalar5 return parsing
there isn't an arg0 in the `ScalarMessage` return type but
that doesn't mean numbering starts at 1. So the first slot
should remain unused if you're not casting a return value
to `MessageId` (which is "just" a `usize` but "feels wrong")
2024-01-28 16:38:05 +08:00
bunnie
528abf3b9f fix bugs in baremetal udma API 2024-01-28 16:01:33 +08:00
bunnie
67ca9f1d90 implement spim TX routines for UDMA 2024-01-28 02:15:21 +08:00
bunnie
9f8cfde417 update toml's to reflect baremetal->std change 2024-01-27 16:53:35 +08:00
bunnie
74219d58f5 change "baremetal" to "std" as a feature
has the opposite meaning, makes it easier to just include the
things that we don't want in kernel or loader mode
2024-01-27 16:52:39 +08:00
bunnie
e1b5487de0 refactor cramium HAL to pull ifram allocation into hw managers 2024-01-26 22:50:17 +08:00
bunnie
13122663f3 intermediate progress, have to switch branch 2024-01-26 01:21:06 +08:00
David Kotval
14da821164 fix: added English stubs to tls messages. 2024-01-24 16:42:36 +00:00
bunnie
3063e76c1c add option to derive rkyv types for iox functions 2024-01-23 03:59:32 +08:00
bunnie
60dc329cbc ugrade unit tests to use the auto-generated irq names 2024-01-22 23:24:47 +08:00
bunnie
b5be447170 add notes 2024-01-20 21:31:05 +08:00
bunnie
d4e6cbc442 cleanup pl230 test 2024-01-20 21:29:19 +08:00
bunnie
d990a4d3b2 xous is now a Rust target, so we have to specify baremetal explicitly 2024-01-20 17:45:36 +08:00
bunnie
75217075c1 fix up bugs in trng hal; automatically reset generator on exhaustion 2024-01-20 16:16:31 +08:00
bunnie
2fb5b171c0 add sce to hal crate 2024-01-20 01:26:10 +08:00
bunnie
001e501fc6 initial take at the SCE TRNG API 2024-01-20 01:25:52 +08:00
bunnie
b72a365c1f adjustments for virtual memory
the library now automatically does v2p mappings for DMA targets.
2024-01-19 23:19:51 +08:00
bunnie
a0e464bcee turn Udma into a trait
I think this makes the code more clearly reflect the intended
"hardware polymorphism" effect of the udma implementation
2024-01-18 18:49:37 +08:00
bunnie
28d959f938 add cramium-hal library 2024-01-18 18:00:49 +08:00
bunnie
09487cbcb4 chore: fix default clock rate for simulation framework
have to slow down the defalut clock rate for the FIFO test in PIO
unit test, so we can capture results in simulation
2024-01-16 17:41:41 +08:00
bunnie
508c610339 prefsgenerator not in workspace but still needs formatting 2024-01-15 01:04:36 +08:00
bunnie
e274fa8873 relate perlib to the libs/ directory
perflib was made before we had libs, so put it into its new, proper
home.
2024-01-15 00:52:43 +08:00
bunnie
0c50581e9c more rustfmt-related fixes 2024-01-15 00:43:52 +08:00
bunnie
0267a56989 format Cargo.tomls
because apparently cargo fmt doesn't format Cargo.toml files???
2024-01-15 00:14:39 +08:00
bunnie
7d9874e522 strip trailing whitespace on mass-storage 2024-01-14 23:58:20 +08:00
bunnie
59c6d6ae77 format libs/xous-pl230 2024-01-14 19:24:12 +08:00
bunnie
ee2c7ef140 format xous-pio 2024-01-14 19:22:37 +08:00
bunnie
f00293a3a8 suppress formatting on in-line assembly in xous-pio 2024-01-14 19:22:18 +08:00
bunnie
508476a085 libs/userprefs 2024-01-14 19:14:08 +08:00
bunnie
c43fd370ee format libs/tls 2024-01-14 19:13:54 +08:00
bunnie
84590c58fc format libs/cos_table 2024-01-14 19:12:38 +08:00
bunnie
660c3b06f9 format libs/chat 2024-01-14 19:12:20 +08:00
bunnie
f196bcf469
Merge pull request #465 from nworbnhoj/sigchat
Link sigchat to existing Signal account
2024-01-08 17:23:09 +08:00
bunnie
8ec08c9c76 fix rust v1.75.0 warnings that are probably benign
a lot of re-import warnings have cropped up. While I appreciate
their studiousness on this, the problem is that removing some
of these exports in the API crate could mean that future users
who want access to some API features that aren't used in this
configuration are now unaccessible.

I think it's not a huge problem at the moment, just spam-cleaning
the warnings because there are too many to deal with carefully
at the moment.
2024-01-04 19:15:28 +08:00
nworbnhoj
05c991e3a2 Merge branch 'main' into sigchat 2023-12-26 08:14:42 +11:00
bunnie
fda782663a bump version pins for xous change 2023-12-26 00:13:10 +08:00
nworbnhoj
854b2198c4 tls doc & tidy-up 2023-12-24 06:03:26 +11:00
nworbnhoj
5703707cca implement Tls.accessible() 2023-12-22 14:25:51 +11:00
nworbnhoj
7d72387cb9 simplify TLS.probe() modals 2023-12-22 14:24:08 +11:00
nworbnhoj
0ca24db2f0 implement Tls.is_trusted_cert() & Tls.is_trusted_x509() 2023-12-22 14:23:04 +11:00
nworbnhoj
6e1947d3b0 rename Tls.*_cert() to Tls.*_rota()
actually this is a correction of the names of these fn
these fn are actually handling trust_anchors rather than certificates
and in some cases we will need equivalent fn for certificates
2023-12-21 16:33:47 +11:00
nworbnhoj
12c74e724f implement Tls.inspect(host)
Tls.probe() now returns a Vec<Certificate> and Tls.inspect(host) presents the trust_modal to the user
2023-12-21 07:48:09 +11:00
nworbnhoj
de1dcffd66 rename shellchat net tls inspect
rename shellchat `net tls probe` to `net tls inspect`
2023-12-20 18:44:52 +11:00
nworbnhoj
2684a55888 Merge branch 'main' into sigchat 2023-12-20 05:26:19 +11:00
nworbnhoj
d22317018b rename Tls.trust_modal() 2023-12-19 06:03:23 +11:00
nworbnhoj
de6b6baab9 extend shellchat net ws to utilize /lib/tls 2023-12-19 05:09:11 +11:00
nworbnhoj
bcb6a8c3bf implement tls.stream_owned() 2023-12-18 17:16:33 +11:00
nworbnhoj
90daccea46 merge main into sigchat 2023-12-05 13:19:49 +11:00
bunnie
efb087c01a
Merge pull request #455 from betrusted-io/mtxchat-layout-tests
WIP: Mtxchat layout refactor
2023-12-02 16:13:04 +08:00
bunnie
fa3f349a0a bump pins as xous-rs has changed 2023-12-01 21:20:01 +08:00
bunnie
f88afd1a1a fix various edge cases; move status bar redraw to end of routine
putting the status bar redraw at the end means that even if
the fitting of the boxes isn't 100% correct, the status bar still
ends up "on top".
2023-12-01 17:55:39 +08:00
bunnie
0da86640b1 cleanup debug statement 2023-12-01 17:55:26 +08:00
bunnie
e4fba76ed2 add some debugging infos
the scroll-down freeze is actually because of the nature of
the test program hijacking the main loop. the test program
probably needs to be redesigned so it takes in events so we
don't eventually end up in deadlock
2023-12-01 03:17:00 +08:00
bunnie
157f0031e6 refactor layout to take advantage of pre-computed height bubbles
mostly works, so checkpointing it here. need to debug why going down
after going up (in terms of selection) is not working.
2023-12-01 02:23:47 +08:00
bunnie
7222fb0de9 add an optional bounding rectangle field to posts
this is computed when the post is added to the list of posts.

Also split out the visual properties of a UI into a separate
struct so that we can pass it as a single argument to routines
that could handle layout-related tasks.
2023-11-30 23:05:41 +08:00
bunnie
c5dff9d35d Merge branch 'main' of github.com:betrusted-io/xous-core into mtxchat-layout-tests 2023-11-30 18:19:20 +08:00
nworbnhoj
e8e875742e replace more TcpStream::connect(&str) with TcpStream::connect((&str, u16))
resolves #453
2023-11-30 20:29:15 +11:00
nworbnhoj
0fc9a07f5e replace TcpStream::connect(&str) with TcpStream::connect((&str, u16))
resolves #453
2023-11-30 19:41:42 +11:00
bunnie
4a5bedd6ab Merge branch 'main' of github.com:betrusted-io/xous-core into mtxchat-layout-tests 2023-11-30 14:22:15 +08:00
nworbnhoj
ffa3d56af4 fix ChatOp::PostAdd to default correctly to dialogue_key set by ChatOp::DialogueSet 2023-11-30 07:24:58 +11:00
nworbnhoj
7e485885b7 introduce tls probe help modals
- invalid certificate modal
- unknown issuer modal
- not valid yet modal
2023-11-29 16:42:21 +11:00
nworbnhoj
492d089d5c fix typos 2023-11-29 12:06:02 +11:00
bunnie
dcd8076306 pull in the comments and notes from #445 so it's in the code 2023-11-28 17:53:12 +08:00
bunnie
c2becc089b implement default behavior when no dialog is specified.
- the `post_add()` API on the 'lib' side of things says Add a new Post
  to the current `Dialogue`, and it passes an empty `dialogue_id` string.
- the `post_add()` handler on the server dutifully unpacks the `dialog_id`
  field with `post.dialogue_id.as_str().unwrap()`, and then passes on to
  the `post_add()` call inside the UI object
- the `post_add()` implementation in the UI object then checks the
  `dialog_id` with if `pddb_key.eq(&dialogue_id)`, expecting that the key
  should match the dialog id. But through this path, the dialogue ID
  is always the empty string, so the function can't work.

This patch causes the code to "fall through" and use the default
`pddb_key` if the length of the `dialog_id` is zero. Not sure if
this is the intended behavior, but in the test case at least I get
posts appearing now once this patch is in.
2023-11-28 17:24:56 +08:00
bunnie
d4624124c9
Merge pull request #443 from betrusted-io/chat-status
WIP: Chat status
2023-11-03 13:54:34 +08:00
bunnie
6ab88117f6 bump xous-api-log version & fix version pins 2023-10-31 20:07:28 +08:00
bunnie
5aefcac8ec add forced redraw function, fix misdirected message
- rapid redraws are normally aborted by this routine. offer a forced
redraw in the case that a "final state" has to be rendered without
fail.

- fix a misdirected message (sending it to app instead of to ui by
accident)
2023-10-29 23:03:46 +08:00
bunnie
d4a934785b re-introduce a default text to display when going out of busy state
this simplifies the problem of tracking concurrency if multiple threads
are requesting a busy-state to be presented. In this case, when the
final thread leaves its busy state, the idle-state will be shown.
2023-10-29 20:07:22 +08:00
bunnie
4423339059 move wifi delay hook to the correct area
- remove modal pop-up for wifi connection, and replace with
busy animation
- specify units of delay in the constants (_MS to indicate milliseconds;
this is a convention I'm trying to adhere to)
- partial progress on debugging why the animation isn't running
(value of animation variable is not being passed back at the GAM layer).

Also a general note on coding styles that probably is going to cause
confusion now that more people are contributing to the code base.

Generally, when a lot of "generic" library functions fail, we've been
passing an error message up the stack. However, these functions are
actually meant to be infalliable, and when you kick the error up the
stack you just end up with a panic at an unhelpful location (because
you finally catch the error only at the main loop or something and
by that point there's nothing you can really do about it but panic,
since it's supposed to be an infalliable operation).

As a result I have been trying to tamp down on needless error propagations
and having them fail with a unwrap or expect at the point where the
abstraction should be infalliable. This helps in debugging the actual
failure root cause because you're closer to the line of code that
actually broke, instead of just some line at a generic error handler.

Of course if you build with stack unwinding the top-level unwraps are more
useful because you can peer down into the call chain, but even then,
with the limited screen real estate I think deeply nested failures
would probably overflow any panic display. So even with panic unwinding
I think we stil want to keep the root cause within a few stack frames,
instead of errors being passed up sixteen levels of abstraction before
finally dying.

This only applies to things that are meant to be truly infalliable,
like syscalls that should not fail, or like unpacking a buffer or
memory message that has already been allocated. In this case the errors
are more like asserts, and are helpful if they fail at the line where
they break instead of being passed up the call stack (which was the
original architecture).

Probably I should add a note about this to the Xous Book.
2023-10-29 16:33:03 +08:00
bunnie
4e027b676c remove logic from status primitive and make the interface simpler
- status bar text is just status bar text now
- idle animation runs/stops based on an explicit run/stop message

Note that at the moment if one starts the busy bar and a modal pops
up, you might overflow the queue of the ui drawing thread with animation
requests, because the thread blocks when the modal is summoned.

Modals "take the screen" anyways, so maybe the solution to this is
to add an additional interlock around any modal calls within the UI
main thread. Need to think about it a bit more.
2023-10-29 01:08:38 +08:00
bunnie
d844c4306c reduce size of chat status bar to match status bars above 2023-10-28 22:50:23 +08:00
bunnie
be39c44b17 add a stand-in initial startup message
This prompts users on how to raise the menu. Not sure if it's
the right thing, but it's something.
2023-10-20 00:48:10 +08:00
bunnie
b456bfaf3b add busy-wait animation server and hooks for managing the same
Busy-wait animaitions are handled by a helper server that is normally
blocked. A single shared `bool` indicates whether the animation should
run or not.

When woken up, the busy-wait animator will check if the shared `bool`
is set, and if so, send a message to the main loop to update
the animation, then send wait an appropriate timeout and send itself
a message to re-check the animation status.

This particular format of server is fairly compact but can be vulnerable
to a "message storm" if busy state updates happen in rapid
succession without allowing the server to unblock and handle messages.
Thus, all messages to this server use a `try_send` method, with a silent
failure if the message can't be sent. In other words, if the animator
is already super busy and its queue is full, don't send it more messages,
just drop the existing updates so we can fail without a panic or deadlock.
The typical consequence of this is some UX inconsistency, which is
not a critical error.
2023-10-20 00:43:09 +08:00
bunnie
355425726d add data structures to track status bar state
- status bar gets some initial text on boot
- previous status message is saved when entering a busy state,
and restored on exit
- add routines for hopefully making the redraw a bit more efficient
if the only thing happening is a busy-wait update.
2023-10-20 00:41:19 +08:00
bunnie
8401d924e0 add opcodes for updating status bar and running busy animations 2023-10-20 00:40:26 +08:00
bunnie
d63b5912b1 absorb new xous-rs version 2023-10-10 16:50:00 +08:00
bunnie
83256257e1 bump xous-rs crate to absorb Send derives on Messages
this is necessary for the smoltcp port
2023-10-03 20:54:14 +08:00
bunnie
7e204604e9
Merge pull request #418 from nworbnhoj/chat
integrate tls trusted root_store into mtxchat
2023-09-26 11:02:18 +08:00
nworbnhoj
61c1747475 integrate tls trusted root_store into mtxchat
Set up tls with rustls::ClientConnection,
BUT - on Error::InvalidCertificate - then
probe the host for the untrusted certificate chain and prompt the user
to perhaps trust one of the certificates in the chain - then try again.
2023-09-25 11:22:47 +10:00
bunnie
e6c61455ba update PIO code for SoC integration
- add duart debug for bare iron testing
- add wait states on FIFO commits for when CPU clock is much
faster than PIO clock.

more wait states will be needed for correct operation in the
future
2023-09-22 22:19:32 +08:00
bunnie
08827633ac bring Chat dependencies up to date 2023-09-19 19:41:56 +08:00
bunnie
a00672cd27 fix missing use statements in tls lib 2023-09-19 19:39:27 +08:00
bunnie
b3e9108bb7
Merge branch 'main' into revert-414-revert-409-tls.probe 2023-09-19 19:28:30 +08:00
bunnie
9f57ad96fd
Merge pull request #408 from nworbnhoj/chat
mtxchat app and chat library
2023-09-19 19:09:56 +08:00
bunnie
c5d81ef08b
initialize menu before mounting PDDB
This is necessary because mounting the PDDB is a "secure" operation, and secure ops will fail until all UX contexts are occupied.

This problem does not manifest in hosted mode because we cheat and automount the PDDB in hosted mode.
2023-09-19 19:08:36 +08:00
nworbnhoj
7803efec7f pass room_alias aka dialogue_id aka dialogue.pddb_key to mtxchat.listen()
this ensures that new Matrix Events received from the server are added to the correct chat::Dialogue
2023-09-18 18:49:59 +10:00
bunnie
82c7b6ebed bring the versions up to date with main for a cleaner merge 2023-09-15 16:32:04 +08:00
bunnie
885e877b43 add features for mdma test to control RAM src/dest regions
The MDMA controller seems broken on the FPGA board, but is working
in RTL. Add a feature flag that allows us to toggle between modes.
2023-09-15 15:09:20 +08:00
bunnie
ab8a5aefcf fix target dependency options 2023-09-15 11:25:22 +08:00
bunnie
49eaac1b46 fix port I/O settings 2023-09-15 11:25:08 +08:00
bunnie
d47bc1af0a remove pio_generated, we should now be relying on utra 2023-09-14 16:25:14 +08:00
bunnie
2387aa4dff migrate to latest pio; tweaks to PIO tests 2023-09-14 16:24:39 +08:00
nworbnhoj
61743a9c76 mtxchat tidy-up 2023-09-14 05:30:33 +10:00
bunnie
06953cec55 remove overly sensitive test case
this case is too sensitive to clock config outside of the PIO
block, because it relies on some specificts of how inter-bus sync
works and the environment is free to set PIO and PCLK relationship
arbitrarily
2023-09-13 10:29:14 +08:00
nworbnhoj
d8db9ad2a7 fix tls::rota.public_key() 2023-09-13 07:20:10 +10:00
nworbnhoj
a06d84d8a9 convert mtxchat to use tls.root_store()
a ureq::Agent is configured to use tls.root_store(), and used for all comms with the matrix server
2023-09-13 07:18:22 +10:00
nworbnhoj
c22419f7c7 bump rustls to harmonize versions 2023-09-13 06:57:39 +10:00
bunnie
b29d29eb0e
Revert "Revert "Tls.probe"" 2023-09-12 19:55:50 +08:00
bunnie
7efcca39d5
Revert "Tls.probe" 2023-09-12 19:13:11 +08:00
bunnie
478a612c02 commit version bump 2023-09-12 16:25:10 +08:00
bunnie
1ebee74bb1
Merge pull request #409 from nworbnhoj/tls.probe
Tls.probe
2023-09-12 16:07:52 +08:00
nworbnhoj
d4c5ae1447 convert tls::danger to non-public 2023-09-11 13:49:48 +10:00
nworbnhoj
5cacb9c20e TLS tidy-up 2023-09-11 09:37:09 +10:00
nworbnhoj
d57c1143bb TLS doco 2023-09-11 09:35:49 +10:00
nworbnhoj
8ab3aa85be implement tls.probe(target)
moved from tls::cmd to tls::lib
2023-09-11 08:59:08 +10:00
nworbnhoj
a46dad11d2 mtxchat tidy-up 2023-09-09 10:36:37 +10:00
nworbnhoj
c50cc73610 mtxchat add navigation help on first login
chat add help navigation modal
2023-09-09 10:24:52 +10:00
nworbnhoj
a7d3b34563 Merge branch 'main' into chat 2023-09-08 13:48:45 +10:00
nworbnhoj
3542103510 mtxchat tidy-up 2023-09-08 13:46:52 +10:00
nworbnhoj
ff68567140 chat UI rawkeys toggle menu_mode & raise app/msg menus 2023-09-07 11:38:21 +10:00
nworbnhoj
c7c0041922 Chat readme & comments 2023-09-01 05:41:40 +10:00