diff --git a/devenv.local.nix.example b/devenv.local.nix.example new file mode 100644 index 0000000..ce316e5 --- /dev/null +++ b/devenv.local.nix.example @@ -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"; + }; +} diff --git a/devenv.nix b/devenv.nix index de770f2..a0068f5 100644 --- a/devenv.nix +++ b/devenv.nix @@ -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 diff --git a/docs/debug.md b/docs/debug.md index 8ff7936..88affe1 100644 --- a/docs/debug.md +++ b/docs/debug.md @@ -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/`.