1
0
Fork 0

Update build instructions for new release-8

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2024-06-14 17:13:21 +08:00
parent 89173e4f2e
commit cb048ac4aa
2 changed files with 58 additions and 10 deletions

View File

@ -39,13 +39,18 @@ Failure to comply with this voids the warranty.
```shell
mkdir <variant>
cd <variant>/
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 <variant>.json
python -m artiq.gateware.targets.kasli_generic <variant>.json
python -m artiq.gateware.targets.kasli <variant>.json
artiq_flash --srcbuild -d artiq_kasli/<variant>/
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/<variant>/
```shell
mkdir <variant>
cd <variant>/
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 <variant>.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=<full path to the json description>;}).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=<full path to the json description>;}).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)

View File

@ -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 <variant> -d artiq_kasli --srcbuild
There's a slight discrepancy from usual command - ``-V <variant>`` 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 <variant> -d artiq_kasli/
@ -61,4 +65,40 @@ Then the customer can use ``artiq_flash`` easily, after extracting the contents:
```shell
artiq_flash -V <variant> -d .
```
```
## 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 <variant>
cd <variant>/
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 <variant>.json
python -m artiq.gateware.targets.kasli_generic <variant>.json
artiq_flash --srcbuild -d artiq_kasli/<variant>/
```
### Kasli-SoC
```shell
mkdir <variant>
cd <variant>/
nix develop git+https://git.m-labs.hk/m-labs/artiq-zynq\?ref=release-7
artiq_ddb_template -o device_db.py <variant>.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=<full path to the json description>;}).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
```