From cb048ac4aabcfbcd13d52ccc213f7365c28c19fe Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Fri, 14 Jun 2024 17:13:21 +0800 Subject: [PATCH] Update build instructions for new release-8 Signed-off-by: Egor Savkin --- src/build_test_firmware.md | 16 +++++++++--- src/sw_sup/artiq_legacy.md | 52 +++++++++++++++++++++++++++++++++----- 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/src/build_test_firmware.md b/src/build_test_firmware.md index 48c09cb..2b43f08 100644 --- a/src/build_test_firmware.md +++ b/src/build_test_firmware.md @@ -39,13 +39,18 @@ Failure to comply with this voids the warranty. ```shell mkdir cd / -nix develop github:m-labs/artiq\?ref=release-7 +#nix develop github:m-labs/artiq\?ref=release-8 # not working https://github.com/m-labs/artiq/issues/2439 +git clone https://github.com/m-labs/artiq.git +cd artiq +git checkout release-8 # master/standalone only artiq_mkfs -s ip 192.168.1.75 kasli.config artiq_flash storage -f kasli.config artiq_ddb_template -o device_db.py .json -python -m artiq.gateware.targets.kasli_generic .json +python -m artiq.gateware.targets.kasli .json artiq_flash --srcbuild -d artiq_kasli// +artiq_rtiomap dev_map.bin +artiq_coremgmt config write -f device_map dev_map.bin ``` ## Kasli-SoC (zynq) @@ -65,15 +70,18 @@ artiq_flash --srcbuild -d artiq_kasli// ```shell mkdir cd / -nix develop git+https://git.m-labs.hk/m-labs/artiq-zynq\?ref=release-7 +nix develop git+https://git.m-labs.hk/m-labs/artiq-zynq\?ref=release-8 artiq_ddb_template -o device_db.py .json -nix build -L --impure --expr 'let fl = builtins.getFlake "git+https://git.m-labs.hk/m-labs/artiq-zynq?ref=release-7"; in (fl.makeArtiqZynqPackage {target="kasli_soc"; variant="[master, standalone, satellite]"; json=;}).kasli_soc-[master, standalone, satellite]-sd' +nix build -L --impure --expr 'let fl = builtins.getFlake "git+https://git.m-labs.hk/m-labs/artiq-zynq?ref=release-8"; in (fl.makeArtiqZynqPackage {target="kasli_soc"; variant="[master, standalone, satellite]"; json=;}).kasli_soc-[master, standalone, satellite]-sd' # copy `results/boot.bin` to the SD card # insert SD card to the Kasli-SoC and boot artiq_coremgmt -D 192.168.1.56 config write -s ip 192.168.1.75 # or just place extra/CONFIG.TXT near the boot.bin on SD card # update firmware (alternative to copy to SD, if ARTIQ already running) artiq_coremgmt config write -f boot result/boot.bin +artiq_coremgmt reboot # reboot via power supply +artiq_rtiomap dev_map.bin +artiq_coremgmt config write -f device_map dev_map.bin ``` ## Testing (common) diff --git a/src/sw_sup/artiq_legacy.md b/src/sw_sup/artiq_legacy.md index 8e3a4b5..ba1e6a7 100644 --- a/src/sw_sup/artiq_legacy.md +++ b/src/sw_sup/artiq_legacy.md @@ -1,4 +1,6 @@ -# Building ARTIQ-6 and earlier +# Building legacy firmware + +## Building ARTIQ-6 and earlier Pre-flake ARTIQ (that is 6 and earlier) requires slightly different steps for building. @@ -6,9 +8,9 @@ Pre-flake ARTIQ (that is 6 and earlier) requires slightly different steps for bu The following steps need to be done only once. -First we will need to specify older nixpkg version - 21.05. Open ``~/.nix-channels`` with your favorite text editor. +First we will need to specify older nixpkg version - 21.05. Open `~/.nix-channels` with your favorite text editor. -If there are any ``nixpkgs`` present already, comment them out with ``#``. +If there are any `nixpkgs` present already, comment them out with `#`. Then add the following line: @@ -18,7 +20,7 @@ https://nixos.org/channels/nixos-21.05 nixpkgs Save and exit. -Now, we need special ``nix-scripts`` to configure building environment, and a local copy of the artiq repository, in legacy release. +Now, we need special `nix-scripts` to configure building environment, and a local copy of the artiq repository, in legacy release. ```shell mkdir artiq-legacy @@ -51,7 +53,9 @@ artiq_flash -V -d artiq_kasli --srcbuild There's a slight discrepancy from usual command - ``-V `` option is not present in ARTIQ-7+, but it is necessary here. -If you want to send the binaries to a customer, there's no need packing up the whole build directory - only ``top.bit``, ``bootloader.bin`` and ``runtime.elf/fbi`` or ``satman.elf/fbi`` are necessary. You can use the ``prep_pkg.py`` script from extras to package them up neatly into a zip file for distributions: +If you want to send the binaries to a customer, there's no need packing up the whole build directory - only `top.bit`, `bootloader.bin` +and `runtime.elf/fbi` or `satman.elf/fbi` are necessary. You can use the `prep_pkg.py` script from extras to package +them up neatly into a zip file for distributions: ```shell python prep_pkg.py -v -d artiq_kasli/ @@ -61,4 +65,40 @@ Then the customer can use ``artiq_flash`` easily, after extracting the contents: ```shell artiq_flash -V -d . -``` \ No newline at end of file +``` + +## ARTIQ-7 + +The process of building firmware for ARTIQ-7 is mostly similar to ARTIQ-8, except there are no named RTIO channels +and no remote reboot functionality on Kasli-SoC. DRTIO set ups are also similar to ARTIQ-8. [See reference](../build_test_firmware.md). + +### Kasli, Kasli 2.0 + +```shell +mkdir +cd / +nix develop github:m-labs/artiq\?ref=release-7 +# master/standalone only +artiq_mkfs -s ip 192.168.1.75 kasli.config +artiq_flash storage -f kasli.config +artiq_ddb_template -o device_db.py .json +python -m artiq.gateware.targets.kasli_generic .json +artiq_flash --srcbuild -d artiq_kasli// +``` + +### Kasli-SoC + +```shell +mkdir +cd / +nix develop git+https://git.m-labs.hk/m-labs/artiq-zynq\?ref=release-7 +artiq_ddb_template -o device_db.py .json +nix build -L --impure --expr 'let fl = builtins.getFlake "git+https://git.m-labs.hk/m-labs/artiq-zynq?ref=release-7"; in (fl.makeArtiqZynqPackage {target="kasli_soc"; variant="[master, standalone, satellite]"; json=;}).kasli_soc-[master, standalone, satellite]-sd' +# copy `results/boot.bin` to the SD card +# insert SD card to the Kasli-SoC and boot +artiq_coremgmt -D 192.168.1.56 config write -s ip 192.168.1.75 # or just place extra/CONFIG.TXT near the boot.bin on SD card +# update firmware (alternative to copy to SD, if ARTIQ already running) +artiq_coremgmt config write -f boot result/boot.bin +# reboot via power supply +``` +