2024-01-18 10:00:49 +00:00
|
|
|
[package]
|
2025-09-18 13:25:51 +00:00
|
|
|
name = "bao1x-hal"
|
2024-01-18 10:00:49 +00:00
|
|
|
version = "0.1.0"
|
|
|
|
|
edition = "2021"
|
|
|
|
|
|
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
2026-01-29 11:12:00 +00:00
|
|
|
xous-api-names = { version = "0.9.71", optional = true }
|
|
|
|
|
xous-api-ticktimer = { version = "0.9.70", optional = true }
|
2024-01-27 08:52:39 +00:00
|
|
|
log = { version = "0.4.14", optional = true }
|
2026-01-29 11:12:00 +00:00
|
|
|
utralib = { version = "0.1.27", default-features = false, optional = true }
|
2024-09-22 06:17:03 +00:00
|
|
|
rkyv = { version = "0.8.8", default-features = false, features = [
|
|
|
|
|
"std",
|
|
|
|
|
"alloc",
|
2024-01-22 19:59:32 +00:00
|
|
|
], optional = true }
|
2024-12-02 10:52:59 +00:00
|
|
|
num-derive = { version = "0.4.2", default-features = false }
|
2024-01-22 19:59:32 +00:00
|
|
|
num-traits = { version = "0.2.14", default-features = false }
|
2024-05-30 19:39:32 +00:00
|
|
|
riscv = { version = "0.5.6", package = "xous-riscv" }
|
2025-09-12 17:11:41 +00:00
|
|
|
|
2025-09-11 18:46:16 +00:00
|
|
|
usb-device = { git = "https://github.com/betrusted-io/usb-device.git", branch = "main", features = [
|
|
|
|
|
"log",
|
|
|
|
|
"control-buffer-256",
|
|
|
|
|
], optional = true }
|
2025-09-12 17:11:41 +00:00
|
|
|
|
|
|
|
|
# usb-device = { path = "../../../usb-device", features = [
|
|
|
|
|
# "log",
|
|
|
|
|
# "control-buffer-256",
|
|
|
|
|
# ], optional = true }
|
|
|
|
|
|
2024-06-08 20:27:31 +00:00
|
|
|
bitfield = "0.13.2"
|
2024-10-04 05:05:40 +00:00
|
|
|
either = { version = "1.9.0", default-features = false }
|
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 05:54:46 +00:00
|
|
|
ux-api = { path = "../ux-api", default-features = false, optional = true }
|
2025-09-18 13:25:51 +00:00
|
|
|
bao1x-api = { path = "../bao1x-api", default-features = false }
|
2024-01-19 15:19:51 +00:00
|
|
|
|
2025-09-29 05:42:23 +00:00
|
|
|
digest = { version = "^0.10.7", optional = true }
|
|
|
|
|
ed25519-dalek = { package = "ed25519-dalek-bao1x", path = "../../bao1x-boot/ed25519-dalek-bao1x", default-features = false, features = [
|
|
|
|
|
"digest",
|
|
|
|
|
"zeroize",
|
|
|
|
|
], optional = true }
|
|
|
|
|
sha2-bao1x = { path = "../../bao1x-boot/sha2-bao1x", optional = true, default-features = false }
|
2025-10-05 09:12:04 +00:00
|
|
|
linked_list_allocator = { version = "0.10.5", optional = true }
|
2025-09-29 05:42:23 +00:00
|
|
|
|
2025-12-04 06:36:28 +00:00
|
|
|
# for generating glitch-protection delays
|
|
|
|
|
rand_chacha = { version = "0.3.1", default-features = false }
|
|
|
|
|
|
2024-02-06 07:30:48 +00:00
|
|
|
# [target.'cfg(target_os = "xous")'.dependencies]
|
2026-01-29 11:12:00 +00:00
|
|
|
xous = { version = "0.9.70", features = ["v2p"] }
|
|
|
|
|
xous-ipc = { version = "0.10.10", optional = true }
|
2024-01-19 15:19:51 +00:00
|
|
|
|
2025-09-23 17:03:43 +00:00
|
|
|
bitflags = "1.2.1"
|
|
|
|
|
# TODO: migrate from bitflags to this crate
|
|
|
|
|
bitbybit = "1.4.0"
|
2025-09-29 05:42:23 +00:00
|
|
|
arbitrary-int = "1.2"
|
2025-10-26 14:18:23 +00:00
|
|
|
bytemuck = "1.24.0"
|
2025-09-23 17:03:43 +00:00
|
|
|
|
2024-01-19 15:19:51 +00:00
|
|
|
[features]
|
2024-11-29 18:22:24 +00:00
|
|
|
camera-ov2640 = []
|
2025-04-30 20:09:17 +00:00
|
|
|
camera-gc2145 = []
|
2024-11-29 18:22:24 +00:00
|
|
|
display-sh1107 = []
|
2026-01-27 16:36:05 +00:00
|
|
|
sensor-lis2dh12 = []
|
2024-11-29 18:22:24 +00:00
|
|
|
axp2101 = []
|
2025-06-11 07:05:59 +00:00
|
|
|
bmp180 = []
|
2025-10-05 09:12:04 +00:00
|
|
|
sigcheck = ["ed25519-dalek", "sha2-bao1x", "digest", "linked_list_allocator"]
|
2024-11-29 18:22:24 +00:00
|
|
|
board-baosec = [
|
2025-06-10 06:56:04 +00:00
|
|
|
"std",
|
2025-04-30 20:09:17 +00:00
|
|
|
"camera-gc2145",
|
2024-11-29 18:22:24 +00:00
|
|
|
"display-sh1107",
|
|
|
|
|
"axp2101",
|
2025-06-11 07:05:59 +00:00
|
|
|
"bmp180",
|
2025-09-18 13:25:51 +00:00
|
|
|
"utralib/bao1x",
|
2025-02-11 08:25:22 +00:00
|
|
|
"ux-api/board-baosec",
|
2025-09-20 14:16:16 +00:00
|
|
|
"ux-api/std",
|
2024-11-29 18:22:24 +00:00
|
|
|
] # USB form factor token
|
2026-01-24 15:49:19 +00:00
|
|
|
# "lite" variant of baosec. Shares the same basic flags but some things remapped when this is added.
|
2026-02-26 10:29:47 +00:00
|
|
|
accel-kbd = []
|
2026-01-27 16:36:05 +00:00
|
|
|
oem-baosec-lite = ["sensor-lis2dh12"]
|
2026-01-24 15:49:19 +00:00
|
|
|
|
2025-04-30 20:09:17 +00:00
|
|
|
loader-baosec = [
|
2025-09-18 13:25:51 +00:00
|
|
|
"utralib/bao1x",
|
2025-04-30 20:09:17 +00:00
|
|
|
"camera-gc2145",
|
|
|
|
|
"display-sh1107",
|
|
|
|
|
"axp2101",
|
2025-06-11 07:05:59 +00:00
|
|
|
"bmp180",
|
2025-04-30 20:09:17 +00:00
|
|
|
"ux-api/loader-baosec",
|
|
|
|
|
]
|
2025-11-03 00:00:31 +00:00
|
|
|
kernel = []
|
|
|
|
|
kernel-baosec = ["utralib/bao1x", "kernel"]
|
|
|
|
|
kernel-baosor = ["utralib/bao1x", "kernel"]
|
|
|
|
|
kernel-dabao = ["utralib/bao1x", "kernel"]
|
2025-04-30 20:09:17 +00:00
|
|
|
test-baosec = ["ux-api/loader-baosec", "camera-gc2145"]
|
2025-09-11 18:46:16 +00:00
|
|
|
hosted-baosec = ["std"] # emulated hardware on x86 platform
|
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 05:54:46 +00:00
|
|
|
board-baosor = [
|
2025-09-20 14:16:16 +00:00
|
|
|
"std",
|
2025-04-30 20:09:17 +00:00
|
|
|
"camera-gc2145",
|
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 05:54:46 +00:00
|
|
|
"axp2101",
|
2025-09-18 13:25:51 +00:00
|
|
|
"utralib/bao1x",
|
2025-09-20 14:16:16 +00:00
|
|
|
"ux-api/std",
|
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 05:54:46 +00:00
|
|
|
] # Precursor form factor
|
|
|
|
|
loader-baosor = []
|
2025-12-22 08:17:08 +00:00
|
|
|
board-dabao = ["utralib/bao1x"] # Dev board form factor
|
|
|
|
|
loader-dabao = []
|
2025-09-18 13:25:51 +00:00
|
|
|
verilator-only = ["utralib/bao1x"]
|
|
|
|
|
mpw = ["utralib/bao1x"]
|
|
|
|
|
hdl-test = ["utralib/bao1x"]
|
2024-12-21 16:36:33 +00:00
|
|
|
verbose-debug = []
|
2025-10-18 17:19:30 +00:00
|
|
|
debug-print = []
|
2025-12-06 17:33:53 +00:00
|
|
|
debug-print-duart = ["debug-print", "debug-countermeasures"]
|
2025-10-18 17:19:30 +00:00
|
|
|
debug-print-uart = ["debug-print"]
|
2025-12-06 17:33:53 +00:00
|
|
|
debug-countermeasures = []
|
2025-12-15 17:02:00 +00:00
|
|
|
debug-wfi = []
|
2025-12-22 08:17:08 +00:00
|
|
|
security = ["sigcheck"]
|
2026-05-08 14:21:14 +00:00
|
|
|
qe-debug = []
|
2024-10-01 15:14:20 +00:00
|
|
|
|
2024-11-28 10:27:52 +00:00
|
|
|
udma-stress-test = [
|
|
|
|
|
] # For RTL simulation testing - aggravates a key corner case
|
|
|
|
|
|
2026-02-04 07:57:59 +00:00
|
|
|
key-testing = ["bao1x-api/key-testing"]
|
|
|
|
|
|
2024-08-18 18:57:12 +00:00
|
|
|
compress-entropy = []
|
|
|
|
|
magic-manual = []
|
2025-02-01 23:02:07 +00:00
|
|
|
std = [
|
|
|
|
|
"log",
|
|
|
|
|
"xous-api-names",
|
|
|
|
|
"usb-device",
|
|
|
|
|
"xous-api-ticktimer",
|
2025-09-18 13:25:51 +00:00
|
|
|
"bao1x-api/std",
|
2025-12-10 18:13:21 +00:00
|
|
|
"xous-ipc",
|
2025-12-26 12:18:06 +00:00
|
|
|
"rkyv",
|
2025-02-01 23:02:07 +00:00
|
|
|
]
|
2024-01-22 19:59:32 +00:00
|
|
|
derive-rkyv = ["rkyv"]
|
2025-10-26 14:18:23 +00:00
|
|
|
|
|
|
|
|
# flag for bypassing extra software checks so that hardware can be redteamed
|
|
|
|
|
redteam = []
|
|
|
|
|
|
2024-12-21 16:36:33 +00:00
|
|
|
default = []
|