Skip to content

Commit

Permalink
feat: add edk2-console command
Browse files Browse the repository at this point in the history
Signed-off-by: ZHANG Yuntian <[email protected]>
  • Loading branch information
RadxaYuntian committed Oct 9, 2024
1 parent 456c86f commit 89de486
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
14 changes: 14 additions & 0 deletions devenv.local.nix.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# You can use devenv.local.nix to override the default settings.
# This file is provided as an example.

{ pkgs, ... }:

{
# Override rsdk defaults here
env = {
EDK2_EC_UART = "ttyCH9344USB0";
EDK2_SE_UART = "ttyCH9344USB1";
EDK2_AP_UART = "ttyCH9344USB2";
EDK2_DEBUG_UART = "ttyCH9344USB3";
};
}
23 changes: 20 additions & 3 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,26 @@
# services.postgres.enable = true;

# https://devenv.sh/scripts/
# scripts.hello.exec = ''
# echo hello from $GREET
# '';
scripts = {
edk2-console = {
description = "Launch UART workspace";
exec = ''
${lib.getExe pkgs.tmux} kill-session -t edk2-console
sleep 1 # wait for picocom to be closed to release UART resources
${lib.getExe pkgs.tmux} new-session -d -s edk2-console ${lib.getExe pkgs.picocom} -b 460800 --imap lfcrlf /dev/$EDK2_EC_UART
${lib.getExe pkgs.tmux} split-window -h ${lib.getExe pkgs.picocom} -b 115200 /dev/$EDK2_SE_UART
${lib.getExe pkgs.tmux} split-window -v ${lib.getExe pkgs.picocom} -b 115200 /dev/$EDK2_AP_UART
${lib.getExe pkgs.tmux} split-window -v -t 0 ${lib.getExe pkgs.picocom} -b 115200 /dev/$EDK2_DEBUG_UART
${lib.getExe pkgs.tmux} attach-session -t edk2-console
'';
};
edk2-build = {
description = "Build Debian package";
exec = ''
.github/common/build-deb
'';
};
};

# enterShell = ''
# hello
Expand Down
3 changes: 3 additions & 0 deletions docs/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ In general, the log output order after power is connected is as follow:
EC ---Power On---> SE ---> AP ---> Debug
```

If you enable `devenv`, then you can run `edk2-console` to launch above 4 UART consoles at once.
Please first create a local `devenv.local.nix` based on `devenv.local.nix.example` to define the local UART devices before using this command.

## Installation

Once build completes, you can find the complete set of artifacts under `debian/edk2-cix/usr/share/edk2/`.
Expand Down

0 comments on commit 89de486

Please sign in to comment.