I noticed that I actually hadn't changed anything in the xous-rs
directory, so I got rid of the patch. I also removed a few files
that weren't being used. Furthermore, I noticed that a couple of
random files were different from upstream so I changed them back.
I also modified the README slightly.
This commit is contained in:
Vihaan Jim 2023-10-14 18:12:22 -04:00
parent d99f40047c
commit 752642f62d
12 changed files with 109 additions and 221 deletions

139
Cargo.lock generated
View file

@ -74,7 +74,7 @@ dependencies = [
"aes 0.8.1",
"hex-literal",
"log",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
]
@ -116,7 +116,7 @@ dependencies = [
"rkyv",
"ureq",
"url",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -285,7 +285,7 @@ dependencies = [
"num-derive",
"num-traits",
"trng",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -607,7 +607,7 @@ dependencies = [
"pddb",
"rkyv",
"trng",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -726,7 +726,7 @@ dependencies = [
"rkyv",
"trng",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -757,7 +757,7 @@ dependencies = [
"trng",
"typenum",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -814,7 +814,7 @@ dependencies = [
"graphics-server",
"log",
"rkyv",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-names",
]
@ -855,7 +855,7 @@ version = "0.1.0"
dependencies = [
"log",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -871,7 +871,7 @@ dependencies = [
"num-derive",
"num-traits",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -885,7 +885,7 @@ dependencies = [
"num-derive",
"num-traits",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -1460,7 +1460,7 @@ dependencies = [
"trng",
"userprefs",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -1485,7 +1485,7 @@ dependencies = [
"rkyv",
"spinor",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -1640,7 +1640,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -1799,7 +1799,7 @@ dependencies = [
"num-derive",
"num-traits",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -2022,7 +2022,7 @@ dependencies = [
"trng",
"tts-frontend",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -2088,7 +2088,7 @@ dependencies = [
"wasi 0.11.0+wasi-snapshot-preview1",
"wasm-bindgen",
"wasm-bindgen-test",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-names",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2123,7 +2123,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -2213,7 +2213,7 @@ dependencies = [
"num-derive",
"num-traits",
"tts-frontend",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2355,7 +2355,7 @@ dependencies = [
"rkyv",
"tts-frontend",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -2371,7 +2371,7 @@ dependencies = [
"num-derive",
"num-traits",
"rkyv",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-names",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2386,7 +2386,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -2405,7 +2405,7 @@ dependencies = [
"rkyv",
"tts-frontend",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -2515,7 +2515,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -2535,7 +2535,7 @@ version = "0.1.0"
dependencies = [
"log",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-ticktimer",
]
@ -2552,7 +2552,7 @@ dependencies = [
"rkyv",
"spinor",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -2633,7 +2633,7 @@ dependencies = [
"num-derive",
"num-traits",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -2657,7 +2657,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -2814,7 +2814,7 @@ dependencies = [
"trng",
"tts-frontend",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -2850,7 +2850,7 @@ dependencies = [
"trng",
"ureq",
"url",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -2880,7 +2880,7 @@ dependencies = [
"serde",
"trng",
"ureq",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -2920,7 +2920,7 @@ dependencies = [
"smoltcp",
"trng",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -3311,7 +3311,7 @@ dependencies = [
"trng",
"tts-frontend",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -3344,7 +3344,7 @@ version = "0.1.0"
dependencies = [
"log",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -3897,7 +3897,7 @@ dependencies = [
"num-derive",
"num-traits",
"trng",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -3939,7 +3939,7 @@ dependencies = [
"spin 0.5.2",
"untrusted",
"winapi",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-names",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -4023,7 +4023,7 @@ dependencies = [
"tts-frontend",
"usb-device-xous",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -4346,7 +4346,7 @@ dependencies = [
"rkyv",
"trng",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -4440,7 +4440,7 @@ dependencies = [
"usb-device-xous",
"utralib",
"x25519-dalek",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -4505,7 +4505,7 @@ name = "spawn"
version = "0.1.0"
dependencies = [
"log",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
]
@ -4538,7 +4538,7 @@ dependencies = [
"rkyv",
"trng",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -4599,7 +4599,7 @@ dependencies = [
"usb-device-xous",
"userprefs",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -4786,7 +4786,7 @@ name = "ticktimer-test-client"
version = "0.1.0"
dependencies = [
"log",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
]
@ -4881,7 +4881,7 @@ dependencies = [
"ureq",
"webpki-roots 0.24.0",
"x509-parser",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -4998,7 +4998,7 @@ dependencies = [
"num-derive",
"num-traits",
"usb-device-xous",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
@ -5016,7 +5016,7 @@ dependencies = [
"rand_core 0.5.1",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -5034,7 +5034,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-ticktimer",
@ -5197,7 +5197,7 @@ dependencies = [
"usbd_scsi 0.1.1",
"utralib",
"vcell",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -5222,7 +5222,7 @@ dependencies = [
"usbd-human-interface-device 0.1.1",
"utralib",
"vcell",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -5285,7 +5285,7 @@ dependencies = [
"typenum",
"usb-device",
"usbd_mass_storage 0.1.0",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-ticktimer",
]
@ -5359,7 +5359,7 @@ dependencies = [
"usb-device",
"usbd_bulk_only_transport 0.1.0",
"usbd_mass_storage 0.1.0",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-ticktimer",
]
@ -5438,7 +5438,7 @@ dependencies = [
"usbd-human-interface-device 0.2.1",
"userprefs",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -5983,6 +5983,15 @@ dependencies = [
"rustc-std-workspace-core",
]
[[package]]
name = "xous"
version = "0.9.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c91c57a2ea348eefbeb08c42daf5c29439b2122516906a0e29fa1522162daf62"
dependencies = [
"lazy_static",
]
[[package]]
name = "xous-api-log"
version = "0.1.49"
@ -5990,7 +5999,7 @@ dependencies = [
"log",
"num-derive",
"num-traits",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -6004,7 +6013,7 @@ dependencies = [
"num-derive",
"num-traits",
"rkyv",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -6020,7 +6029,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
@ -6036,7 +6045,7 @@ dependencies = [
"num-derive",
"num-traits",
"rkyv",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -6050,7 +6059,7 @@ version = "0.9.53"
dependencies = [
"bitflags 1.3.2",
"rkyv",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -6061,7 +6070,7 @@ checksum = "8b3b566abdb43129f7921cf05f734706cd8fbe18a801c2668910979a0aefe687"
dependencies = [
"bitflags 1.3.2",
"rkyv",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -6081,7 +6090,7 @@ dependencies = [
"rand_chacha 0.3.1",
"stats_alloc",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-riscv",
]
@ -6095,7 +6104,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -6109,7 +6118,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
@ -6124,7 +6133,7 @@ dependencies = [
"pio",
"pio-proc",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -6136,7 +6145,7 @@ dependencies = [
"pio",
"pio-proc",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-pio",
]
@ -6165,7 +6174,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -6182,7 +6191,7 @@ dependencies = [
"num-traits",
"rkyv",
"utralib",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-log",
"xous-api-names",
"xous-api-susres",
@ -6201,7 +6210,7 @@ dependencies = [
"num-derive",
"num-traits",
"rkyv",
"xous",
"xous 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-api-names",
"xous-ipc 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)",
]

View file

@ -120,11 +120,6 @@ exclude = [
"libs/mass-storage/packing",
]
[profile.dev]
opt-level = 1
lto = "fat"
overflow-checks = false
[profile.release]
codegen-units = 1 # 1 better optimizations
debug = false
@ -184,8 +179,8 @@ rev="4296c2e7904898766cf7d8d589759a129794783b" # use the commitref because we're
path = "./utralib"
[patch.crates-io.svd2utra]
path = "./svd2utra"
[patch.crates-io.xous]
path = "./xous-rs"
# [patch.crates-io.xous]
# path = "./xous-rs"
# [patch.crates-io.xous-ipc]
# path = "./xous-ipc"
# [patch.crates-io.xous-api-names]

View file

@ -2,7 +2,7 @@
This app allows you to load apps onto your device at runtime and is intended to be used by developers who would like to quickly test their apps on physical hardware.
At the moment the apps are loaded onto the device using a primitive HTTP server; however, in the future, other (faster) methods may be implemented.
Depending on how good the device's WiFi connection is, loading the app can take anywhere from 10 or 20 seconds for a small app to a couple of minutes for a large app.
Depending on how good the device's WiFi connection is, loading the app can take anywhere from 20 seconds for a small app to a couple of minutes for a large app. Additionally, if you are loading a particularly large app, your device's WiFi connection may cut out while you are trying to load it, leading to your device not being able to download the app (this is another reason why different methods of app loading may need to be implemented).
Note that at the moment you can only load apps once each time the device runs since process destruction has not been implemented in Xous yet.
## Usage
@ -24,7 +24,7 @@ Now, after selecting `App Loader` from the app menu on the device, you should se
| Close |
\------------/
```
From here, you can select `Set Server` and then input the address of your server (e.g., `http://` followed by the ip address of your server, a `:`, and the port you are running it on). If you do not prefix it with `http://`, the app will present an error and make you try it again.
From here, you can select `Set Server` and then input the address of your server (e.g., `http://` followed by the ip address of your server, a `:`, and the port you are running it on). If you do not prefix the address with `http://`, the app will present an error and make you re-enter it.
Now, the screen should look like:
```
/-----------------\

View file

@ -1,113 +0,0 @@
use core::fmt::{Error, Write};
use utralib::generated::*;
#[macro_export]
macro_rules! print
{
($($args:tt)+) => ({
use core::fmt::Write;
let _ = write!(crate::debug::Uart {}, $($args)+);
});
}
#[macro_export]
macro_rules! println
{
() => ({
print!("\r\n")
});
($fmt:expr) => ({
print!(concat!($fmt, "\r\n"))
});
($fmt:expr, $($args:tt)+) => ({
print!(concat!($fmt, "\r\n"), $($args)+)
});
}
#[allow(dead_code)]
fn handle_irq(irq_no: usize, arg: *mut usize) {
print!("Handling IRQ {} (arg: {:08x}): ", irq_no, arg as usize);
while let Some(c) = { crate::debug::Uart {} }.getc() {
print!("{}", c as char);
}
println!();
}
pub struct Uart {}
// this is a hack to bypass an explicit initialization/allocation step for the debug structure
pub static mut DEFAULT_UART_ADDR: *mut usize = 0x0000_0000 as *mut usize;
pub const DEFAULT: Uart = Uart {};
impl Uart {
fn map_uart(&self) {
/*
Note: the memory address and interrupt specified here needs to map to a unique hardware
UART resource. Modify in this function as necessary.
*/
let uart = xous::syscall::map_memory(
xous::MemoryAddress::new(utra::console::HW_CONSOLE_BASE),
None,
4096,
xous::MemoryFlags::R | xous::MemoryFlags::W,
)
.expect("couldn't map debug uart");
unsafe {
DEFAULT_UART_ADDR = uart.as_mut_ptr() as _;
}
println!("Mapped UART @ {:08x}", uart.as_ptr() as usize);
// core::mem::forget(uart);
println!("Allocating IRQ...");
/* xous::claim_interrupt(
utra::console::CONSOLE_IRQ,
handle_irq,
core::ptr::null_mut::<usize>(),
)
.expect("unable to allocate IRQ"); */
self.enable_rx();
}
pub fn putc(&self, c: u8) {
if unsafe { DEFAULT_UART_ADDR } as usize == 0 {
self.map_uart();
}
let mut uart_csr = CSR::new(unsafe { DEFAULT_UART_ADDR as *mut u32 });
// Wait until TXFULL is `0`
while uart_csr.r(utra::uart::TXFULL) != 0 {}
uart_csr.wo(utra::uart::RXTX, c as u32);
}
pub fn enable_rx(&self) {
let mut uart_csr = CSR::new(unsafe { DEFAULT_UART_ADDR as *mut u32 });
uart_csr.rmwf(utra::uart::EV_ENABLE_RX, 1);
}
#[allow(dead_code)]
pub fn getc(&self) -> Option<u8> {
if unsafe { DEFAULT_UART_ADDR } as usize == 0 {
self.map_uart();
}
let mut uart_csr = CSR::new(unsafe { DEFAULT_UART_ADDR as *mut u32 });
match uart_csr.rf(utra::uart::EV_PENDING_RX) {
0 => None,
ack => {
let c = Some(uart_csr.rf(utra::uart::RXTX_RXTX) as u8);
uart_csr.wfo(utra::uart::EV_PENDING_RX, ack);
c
}
}
}
}
impl Write for Uart {
fn write_str(&mut self, s: &str) -> Result<(), Error> {
for c in s.bytes() {
self.putc(c);
}
Ok(())
}
}

Binary file not shown.

View file

@ -12,18 +12,29 @@ pub fn lfsr_next(state: u32) -> u32 {
(state << 1) + bit
}
pub fn basic_tests (pl230: &mut Pl230) {
pub fn basic_tests (pl230: &mut Pl230) -> bool {
report_api("channels", pl230.csr.rf(utra::pl230::STATUS_CHNLS_MINUS1) + 1);
//report_api("id0", pl230.csr.r(utra::pl230::PERIPH_ID_0));
//report_api("id1", pl230.csr.r(utra::pl230::PERIPH_ID_1));
//report_api("id2", pl230.csr.r(utra::pl230::PERIPH_ID_2));
let mut cc_struct = ControlChannels::default();
// conjure the DMA control structure in IFRAM0. In order to guarantee Rust
// semantics, it must be initialized to 0: 4 word-sized entries * 8 channels * 2 banks = 4 * 8 * 2
let init_ptr = utralib::HW_IFRAM0_MEM as *mut u32;
for i in 0..(4*8*2) {
unsafe {init_ptr.add(i).write_volatile(0)};
}
// safety: we guarantee that the pointer is aligned and initialized
let cc_struct: &mut ControlChannels = unsafe {
(utralib::HW_IFRAM0_MEM as *mut ControlChannels).as_mut().unwrap()
};
// read the status register
report_api("status", pl230.csr.r(utra::pl230::STATUS));
// report_api("status", pl230.csr.r(utra::pl230::STATUS));
pl230.csr.wfo(utra::pl230::CFG_MASTER_ENABLE, 1); // enable
report_api("status after enable", pl230.csr.r(utra::pl230::STATUS));
// report_api("status after enable", pl230.csr.r(utra::pl230::STATUS));
const DMA_LEN: usize = 16;
// setup the PL230 to do a simple transfer between two memory regions
// dma_mainram feature will cause us to DMA between main memory regions. This works under RTL sims.
#[cfg(feature="dma_mainram")]
@ -48,7 +59,7 @@ pub fn basic_tests (pl230: &mut Pl230) {
cc.set_src_inc(DmaWidth::Word as u32);
cc.set_dst_size(DmaWidth::Word as u32);
cc.set_dst_inc(DmaWidth::Word as u32);
cc.set_r_power(ArbitrateAfter::Xfer8 as u32);
cc.set_r_power(ArbitrateAfter::Xfer1024 as u32);
cc.set_n_minus_1(region_a.len() as u32 - 1);
cc.set_cycle_ctrl(DmaCycleControl::AutoRequest as u32);
cc_struct.channels[0].control = cc.0;
@ -57,19 +68,23 @@ pub fn basic_tests (pl230: &mut Pl230) {
pl230.csr.wo(utra::pl230::CHNLREQMASKSET, 1);
pl230.csr.wo(utra::pl230::CHNLENABLESET, 1);
// report_api("dma_len", DMA_LEN as u32);
report_api("baseptr", cc_struct.channels.as_ptr() as u32);
report_api("baseptr[0]", unsafe{cc_struct.channels.as_ptr().read()}.src_end_ptr);
report_api("baseptr[1]", unsafe{cc_struct.channels.as_ptr().read()}.dst_end_ptr);
report_api("baseptr[2]", unsafe{cc_struct.channels.as_ptr().read()}.control);
report_api("baseptr[3]", unsafe{cc_struct.channels.as_ptr().read()}.reserved);
report_api("baseptr reg", pl230.csr.r(utra::pl230::CTRLBASEPTR));
report_api("src start", region_a.as_ptr() as u32);
// report_api("baseptr[0]", unsafe{cc_struct.channels.as_ptr().read()}.src_end_ptr);
report_api("dst start", region_b.as_ptr() as u32);
// report_api("baseptr[1]", unsafe{cc_struct.channels.as_ptr().read()}.dst_end_ptr);
// report_api("baseptr[2]", unsafe{cc_struct.channels.as_ptr().read()}.control);
// report_api("baseptr[3]", unsafe{cc_struct.channels.as_ptr().read()}.reserved);
// report_api("baseptr reg", pl230.csr.r(utra::pl230::CTRLBASEPTR));
// this should kick off the DMA
pl230.csr.wo(utra::pl230::CHNLSWREQUEST, 1);
let mut timeout = 0;
while (DmaChanControl(cc_struct.channels[0].control).cycle_ctrl() != 0) && timeout < 16 {
report_api("dma progress ", cc_struct.channels[0].control);
// report_api("dma progress ", cc_struct.channels[0].control);
report_api("progress as baseptr[2]", unsafe{cc_struct.channels.as_ptr().read()}.control);
timeout += 1;
}
@ -242,4 +257,4 @@ pub fn pio_test(pl230: &mut Pl230) -> bool {
} else {
true
} */
}
}

Binary file not shown.

View file

@ -33,7 +33,7 @@ precursor = ["utralib/precursor"]
hosted = ["utralib/hosted"]
renode = ["utralib/renode"]
extra_flush = []
default = ["extra_flush"]
default = []
[lib]
test = true

View file

@ -1,18 +0,0 @@
// Versioning information is kept in a separate file, attached to a small, well-known server in the Xous System
// This is a trade-off between rebuild times and flexibility.
// This was autogenerated by xtask/src/main.rs:print_header(). Do not edit manually.
pub(crate) fn get_version() -> crate::api::VersionString {
let mut v = crate::api::VersionString {
version: xous_ipc::String::new()
};
v.version.append(SEMVER).ok();
#[cfg(not(feature="no-timestamp"))]
v.version.append("\n").ok();
#[cfg(not(feature="no-timestamp"))]
v.version.append(TIMESTAMP).ok();
v
}
#[allow(dead_code)]
pub const TIMESTAMP: &'static str = "Sat, 02 Jul 2022 13:41:48 -0400";
pub const SEMVER: &'static str = "v0.9.8-723-g64e82d88";

View file

@ -10363,4 +10363,4 @@ register to disable individual events.]]></description>
<constant name="TICKTIMER_INTERRUPT" value="20" />
</constants>
</vendorExtensions>
</device>
</device>

View file

@ -14828,4 +14828,4 @@ position to clear the flag]]></description>
<constants>
</constants>
</vendorExtensions>
</device>
</device>

View file

@ -717,4 +717,4 @@ register to disable individual events.]]></description>
<constant name="UART_INTERRUPT" value="0" />
</constants>
</vendorExtensions>
</device>
</device>