-
Notifications
You must be signed in to change notification settings - Fork 6
Tips and Tricks
- checkout the
README.md
inapps/ball
apps/hello
andapps/repl
- numerous basic commands in
services/shellchat/src/cmsd/*.rs
- modals in
services/modals/src/tests.rs
- tls in
libs/tls/src/cmds.rs
-
--no-verify
will disable verification of crates downloaded fromcrates.io
against the source code. Useful for when you are updating a crate that is sourced fromcrates.io
-
Cargo.toml
contains numerous commented outpatch
options to configure the build to refer to local source instead ofcrates.io
-
--gdb-stub
adds GDB support -
--no-timestamp
will suppress timestamping. Can improve build times and/or aid with reproduceable builds on the same build host. -
generate-locales
is required after any change to anyi18n.json
file.
Almost every server has a line similar to this near the top of main
:
fn main() -> ! {
log_server::init_wait().unwrap();
log::set_max_level(log::LevelFilter::Info);
log::info!("my PID is {}", xous::process::id());
Change log::set_max_level
to log::LevelFilter::Debug
. In most servers, this will cause the current message code to be printed to the debug console.
- You can call
log::set_max_level
at any time. Use this to your advantage if you are getting too much debug spew, by wrapping the region of interest in a call that toggles toDebug
and then back toInfo
when leaving the region. - There is an even more verbose level,
Trace
, that can be configured as well - Remember that
lib
code runs in the space of your server, so anylog
calls in thelib
stubs will also be affected by the configuration of the logging level in your server.
You can connect your PC to Precursor with a usb cable and use a terminal emulator to input with the PC keyboard and read logs real-time.
- connect Precursor with usb cable
-
shellchat:
usb console
-
linux cli:
- the current user will need to belong to the
dialout
group -
mincom: use
minicom -s
to configureSerial Device : /dev/ttyACM0
Hardware Flow Control : No
Add carriage return : Yes
and thenSave setup as dfl
. Start mincom withmincom
and quit withctrl-A q enter
- the current user will need to belong to the
GDB works on Xous, both from Renode and on real hardware.
See "Debugging Programs" in the Xous book.
- This does require a custom firmware build with GDB support. It is not on by default for security reasons.
- Pay attention that thread IDs in GDB are different from those in Xous.
- You can only attach to one process at a time with GDB.
- Debugging real hardware requires a Pi-HAT and debug cable attachment.
- analyze-bloat.sh will generate annotated assembly listings of every file. It does add symbols to the binaries, which changes their size. If you want assembly listings without symbols (which lines up with actual hardware) see the script for examples of how to generate the listings.
- backalyzer can dump the entire PDDB contents, given the cryptographic keys for your PDDB and a backup image.
You have been developing a xous app in xous-core/apps/
and the time has come to move it into it's own repository.
There is a relatively straight-forward git way to make the move and keep the commit history.
xous-core
└ api
└ apps
└ ball
└ hello
└myapp
└ Cargo.toml
└ locales
└ README.md
└ src
...
└ .git
...
myapp
└ Cargo.toml
└ locales
└ README.md
└ src
└ .git
...
The first step is to clone both repositories into a temp
working directory - to give yourself the opportunity to back out and try again if things don't work out.
mkdir temp
cd temp
git clone [email protected]:betrusted-io/xous-core.git
git clone [email protected]:owner/myapp.git
The second step is to filter the clone of xous-core
such that only myapp
remains. Get into the xous-core
clone with cd xous-core
then
git checkout filter-source
git filter-repo --subdirectory-filter apps/myapp --force
If this doesn't work out, then you can simply git checkout main
and git branch --delete filter-source
and then try again.
The third step is to bring filter-source
into your new myapp
repository. Get into the myapp
clone with cd ../myapp
then
git checkout -b filter-target
git remote add repo-source ../xous-core
git fetch repo-source
git branch branch-source remotes/repo-source/filter-source
git merge branch-source --allow-unrelated-histories
At this point you may have some merge conflicts to resolve. When you have checked everything is as you would expect then you can git push
back to the repository and discard the temp
working directory.