Commit graph

7859 commits

Author SHA1 Message Date
bunnie
de12d0f73a add usb feature to loader 2024-11-20 01:43:05 +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
5279e50ace
Merge pull request #594 from betrusted-io/udma-debug
Udma debug
2024-11-19 22:33:08 +08:00
bunnie
e42b7195b0 add notes about performance improvement for the future 2024-11-19 22:21:48 +08:00
bunnie
d78899ca74 implement retry on SPIM failure
somehow, the retry still *fails* - to be looked into in the future
2024-11-19 22:17:19 +08:00
bunnie
265805ac94 cleanup warnings 2024-11-19 22:17:07 +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
53de9cc273
Merge pull request #593 from betrusted-io/mpw-dev
Mpw dev
2024-11-18 18:41:56 +08:00
bunnie
fe45f40cb7 increase verbosity of pl230 output for co-debugging 2024-11-18 18:38:41 +08:00
bunnie
64520cf5a3 add note about failing option for pl230 2024-11-18 18:38:15 +08:00
bunnie
626d997868 move pl230 test to an easier place for checking 2024-11-18 18:37:33 +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
4a99341269 cleanup warnings 2024-11-14 22:19:40 +08:00
bunnie
fac7adca35 improve UX a little bit 2024-11-14 00:36:24 +08:00
bunnie
0bad04856b debug fixed point underflow issue 2024-11-14 00:34:02 +08:00
bunnie
fc95e8b7b3 update findings 2024-11-14 00:33:39 +08:00
bunnie
c2edfee2fd try to fix timeout issue on camera capture 2024-11-14 00:15:51 +08:00
bunnie
2e25ebff9f upgrade the linederivation to use std
this eliminates occasional storage overflow errors during searching
2024-11-14 00:03:49 +08:00
bunnie
3135407e8e live QR decoding now working!
Got up to version 8 to decode, although version 8 is a bit fussy.

Fairly sensitive to camera focal distance - hard to see focus
issues on B/W display. This needs to be improved in the HW.
2024-11-13 23:29:50 +08:00
bunnie
2b5aab23e0 add fractional iterator for conversion of pixels to modules 2024-11-13 23:29:26 +08:00
bunnie
8002d522b0 add support for neighborhood estimation and version guessing 2024-11-13 23:28:54 +08:00
bunnie
45b5dc1d95 flip image vertically as it comes from the camera fb
this orients it correctly for processing by the QR pipeline
2024-11-12 23:22:15 +08:00
bunnie
8beb9327bc
Merge pull request #592 from betrusted-io/mpwqrdev
Mpwqrdev
2024-11-08 00:25:33 +08:00
bunnie
4b9f1fce95 move bao-video back to the swap image
udma decongestion proves to prevent the hardware lockup, but the
solution is only so durable.
2024-11-08 00:18:03 +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
9b01753ed3 add some code that attempts a read retry on the SPIM interface
it's not successful, unfortunately.
2024-11-08 00:16:47 +08:00
bunnie
dc0fd47ff4 add an option to decongest udma
There is a hardware bug that causes SPIM RX packets to fail when
the UDMA bus is busy (like when streaming video). This causes
swap memory to fail because it relies on the SPIM bus.

This patch causes the video to sample *after* any computation
happens, so that any swap memory that might be hit taken care of.

This reduces the efficiency of the loop somewhat, because without
the decongesting, we could kick off the camera read and do useful
computation while the camera streamed data. Now we have to keep
them separate to work around this bug.
2024-11-08 00:14:21 +08:00
bunnie
f0e573638d add packages pulled in my QR code reader
hope to trim this down a bit - using rqrr to do some back
end processing but after intiial evaulation the right path
is probably going to be fork and slim down the code, which
is fine by me.
2024-11-07 16:19:29 +08:00
bunnie
c6871d58b1 placeholder stub for the future USB stack on cramium targets
The USB hardware stack is different enough that I think it
doesn't make sense to wedge it into the existing USB driver.
Instead it will be a separate driver that has the same `lib` level
API calls, but a totally different implementation underneath.

This allows us to make better architectural decisions that will
make the USB stack more reliable because the hardware has some
pretty strict latency requirements on responding to packets that
can't be met with the previous abstraction.
2024-11-07 16:17:08 +08:00
bunnie
2692d374c6 add some test scaffolding for userspace video processing
The whole graphical interface - camera + display & QR code processing -
is incorporated into a single process space to minimize on the amount
of swapping/memory message passing necessary to implement a low-latency,
high-frame rate video interface.

The current service just starts a camera-to-display loopback
while searching for and aligning QR code markers, without consulting
any other service on whether it should do that or not. Suitable
for debug and performance characterization, but not usable for
product integration.

The good news is we're getting an acceptable frame rate on
the camera during search mode with the kernel running.
2024-11-07 16:14:29 +08:00
bunnie
fd6c2ad4ff shuffle around package order
There's a hardware bug that makes concurrent camera and SPIM
traffic unreliable. The work-around is to place the camera
code inside the XIP area so we don't have to hit SPIM to swap
in code while the camera is running.

However, we do need to figure out a more reliable fix for this.
2024-11-07 16:13:08 +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
820acfa2e6 make sure that swapper pages are marked as wired once allocated
also improve debug output, it was a little nonsensical previously
(some bit rot on meaning of fields)
2024-11-07 16:10:27 +08:00
bunnie
a854ad53ea fix broken code in deep debug option 2024-11-07 16:10:07 +08:00
bunnie
b3de92aabc add option to dump kernel pages in panic dumps 2024-11-07 16:09:49 +08:00
bunnie
735c4bfedd add debug options for sussing out IRQ problems in the kernel 2024-11-07 16:05:47 +08:00
bunnie
99bf1276db add note about the multithreading option for I2C 2024-11-07 16:05:22 +08:00
bunnie
7cceb9bea4 add APIs and glue logic for implementation of shared I2C resource
The API now provides, in addition to stand-alone read/write
transactions, the ability to send a group of transactions that will
be executed in-order without any other transactions in between.

This allows better compatibility with devices that are designed assuming
they are the sole target on the bus.

Note that the current implementation does not thread out the I2C
handler into its own thread so the service provider blocks until
all the I2C transactions are done. Adding a thread to handle
the I2C stuff would allow other requests to make progress but
at the moment this isn't required.
2024-11-07 16:00:20 +08:00
bunnie
a11f2f7f54 add I2C abstraction to cramium HAL
taking full advantage of the new rkyv crate capabilities!
2024-11-07 15:04:55 +08:00
bunnie
e05f9346b3 add baosec build
this is a slimmed down target designed for a smaller memory
footprint. there is some loss of process isolation security but
also a boost in performance due to more items sharing a memory
space.
2024-11-05 22:10:45 +08:00
bunnie
5c5c473a3f add new baosec packages 2024-11-05 22:10:26 +08:00
bunnie
aba5d25e36 cleanup warnings when boardbringup is not selected 2024-11-05 19:41:12 +08:00
bunnie
101084a822 cleanup some local echo artifacts 2024-11-05 19:40:51 +08:00
bunnie
0463629a0a cleanup warnings when board-bringup target is not selected 2024-11-05 19:40:28 +08:00
bunnie
9d850a068f add some documentation 2024-11-05 19:40:04 +08:00