Compare commits

..

No commits in common. "master" and "fastino-10v" have entirely different histories.

12 changed files with 32 additions and 329 deletions

View File

@ -33,9 +33,7 @@ Tips for adding hardware instructions:
for images with transparent background)
3. Add link to the new chapter to the `src/SUMMARY.md`
4. Do not forget to tell about all hidden/non-obvious obstacles and pitfalls
5. Avoid using uncommon, complex, or hard-to-understand words, phrases, or grammar (e.g., ❌constituent -> ✔component).
Keep in mind that these guides may be used by people with different backgrounds and levels of English proficiency.
6. Add testing steps, even the "obvious" ones
7. Add JSON sample if needed
8. Add hardware setup (e.g. pins, switches) steps if needed
9. View changed and added pages with `mdbook build` (see building instructions above)
5. Add testing steps, even the "obvious" ones
6. Add JSON sample if needed
7. Add hardware setup (e.g. pins, switches) steps if needed
8. View changed and added pages with `mdbook build` (see building instructions above)

View File

@ -10,7 +10,6 @@
- [Sinara 2118 BNC-TTL / 2128 SMA-TTL](./hw/bnc_sma_ttl.md)
- [Sinara 2138 MCX-TTL](./hw/mcx_ttl.md)
- [Sinara 5432 DAC Zotino / Sinara 5632 DAC Fastino](./hw/zotino_fastino.md)
- [Sinara 5716 DAC Shuttler](./hw/shuttler.md)
- [Sinara 5518 BNC-IDC / 5528 SMA-IDC adapter](./hw/bnc_sma_idc_adapter.md)
- [Sinara 4410/4412 DDS Urukul (AD9910/AD9912)](./hw/urukul.md)
- [Sinara 5108 Sampler](./hw/sampler.md)
@ -29,5 +28,4 @@
- [Flashing the Firmware](./sw_sup/flashing_firmware.md)
- [Moninj](./sw_sup/moninj.md)
- [Clocking](sw_sup/clocking.md)
- [device_db.py](sw_sup/device_db.md)
- [Setup your PC for building ARTIQ firmware](sw_sup/setup_build_pc.md)
- [device_db.py](sw_sup/device_db.md)

View File

@ -39,15 +39,13 @@ Failure to comply with this voids the warranty.
```shell
mkdir <variant>
cd <variant>/
nix develop github:m-labs/artiq\?ref=release-8#boards
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 <variant>.json
python -m artiq.gateware.targets.kasli_generic <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)
@ -67,18 +65,15 @@ artiq_coremgmt config write -f device_map dev_map.bin
```shell
mkdir <variant>
cd <variant>/
nix develop git+https://git.m-labs.hk/m-labs/artiq-zynq\?ref=release-8
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-8"; 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-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
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

@ -15,59 +15,6 @@
}
```
## Getting the firmware
On Hydra you can find [Mirny 0.3.1 firmware](https://nixbld.m-labs.hk/job/artiq/gluelogic/mirny-cpld-almazny). It contains a single ``.jed`` file that can be flashed following [flashing instructions](#flashing). This firmware supports Almazny v1.2+.
If you are using a legacy Almazny (v1.0-1.1), due to different signals routed, you need to flash the older [0.2.4 firmware with Almazny support](https://nixbld.m-labs.hk/job/artiq/gluelogic/mirny-cpld-legacy-almazny).
### Building firmware (optional)
However, if you need to make chances or build from source, follow these instructions.
Once you get your hands on the firmware source code, you will need to work around few shortcomings of Nix, mainly not being able to run dynamically linked executables.
You will need:
- Xilinx ISE 14.7 installed on your system (this guide is assuming ``/opt/Xilinx`` path),
- an environment with Migen.
One way to do it is to create an FHS environment, like ARTIQ does for Vivado, within ARTIQ's ``flake.nix`` (to leverage Migen already being there), by adding these lines:
```
iseEnv = pkgs.buildFHSEnv {
name = "ise-env";
targetPkgs = vivadoDeps;
};
ise = pkgs.buildFHSEnv {
name = "ise";
targetPkgs = vivadoDeps;
profile = "set -e; source /opt/Xilinx/14.7/ISE_DS/settings64.sh";
runScript = "ise";
};
```
Add them below ``vivadoEnv``. Then add ``iseEnv`` and ``ise`` to the dev shell's build inputs. Call ``nix develop`` on that.
Then you can build Mirny:
```shell
nix develop
ise-env
cd ../mirny # or wherever your source is at
source /opt/Xilinx/14.7/ISE_DS/settings64.sh
python mirny_impl.py
```
### Flashing
For flashing, you will need Xilinx ISE 14.7 installed on your system (here assuming ``/opt/Xilinx`` path), and ``xc3sprog`` with the appropriate HS2 JTAG adapter.
```shell
nix-shell -p xc3sprog
xc3sprog -c jtaghs2 -m /opt/Xilinx/14.7/ISE_DS/ISE/xbr/data -v build/mirny.jed
```
## Testing
### Without Almazny
@ -102,7 +49,7 @@ After running `artiq_sinara_test`:
![](../img/mirny_gqrx.png)
### With Almazny (ARTIQ 7)
### With Almazny
At first, `artiq_sinara_test` will prompt you for testing Mirnies as the would be without Almazny.
After that, it will prompt you with testing the Almazny:
@ -150,8 +97,4 @@ You should also see differences in various modes, but that may require disabling
### Tips
~~Mirnies often fail `ValueError: MUXOUT not high`, in that case restart the tests or reboot the board(s).~~ - fixed in [9569cfb](https://github.com/m-labs/artiq/commit/9569cfb26329c0acdc1705d3256d2506b7bccce5)
For Almazny v1.0 and 1.1 support, CPLD firmware 0.2.4 (linked above) must be flashed onto Mirny.
For Almazny v1.2+ support, CPLD firmware 0.3.1+ (with fixes) must be flashed onto Mirny.
Mirnies often fail `ValueError: MUXOUT not high`, in that case restart the tests or reboot the board(s).

View File

@ -1,120 +0,0 @@
# Sinara 5716 DAC Shuttler
The Sinara 5716 DAC Shuttler consists of the [Shuttler](https://github.com/sinara-hw/Shuttler), [Remote AFE-Board](https://github.com/sinara-hw/Shuttler), and [EEM FMC Carrier](https://github.com/sinara-hw/EEM_FMC_Carrier) (EFC) Board.
The EFC Board has an FPGA running Kasli Satellite. DRTIO communication is established through the EEM Cable. At first power up, EFC Board and connected Kasli/Kasli-soc calibrate the clock skews on their own EEM transceiver and then store the value into the flash memory/SD Card.
## JSON
```json
{
"type": "shuttler",
"ports": [<port num>]
}
```
## Hardware Configurations and Connections
### EEM Cable Connection
Only the EEM0 port on the EFC board is used. The EEM Cable provides power. You can ignore the barrel jack at the back of the board if it is placed.
### CLK Input
The EFC requires a **common** clock source with the connected device.
For the EFC Board v1.0, please refer to this [issue](https://github.com/sinara-hw/EEM_FMC_Carrier/issues/44).
For the EFC Board v1.1 (or later), there is a DIP switch to select the clock source.
![efc_clk_sel](../img/efc_clk_sel.png)
| Clock Source | CLK_SEL0 | CLK_SEL1 |
|---|---|---|
| Front Panel SMA | 0 | 0 |
| Internal Oscillator(default) | 1 | 0 |
| MMCX | 0 | 1 |
| PE CLK | 1 | 1 |
### VADJ Power
The EFC Board has configurable Digital IO Voltage Level/PSU called VADJ. You should configure VADJ to 1.8V by fitting W1/W2 jumper accordingly.
![efc_vadj_settings](../img/efc_vadj_settings.jpg)
### Remote AFE Board Connections
The Remote AFE Board is not installed in the crate and should be shipped separately. When you test the EFC Board, please connect the Mini SAS Cables in this orientation.
![Mini-Sas Connections](../img/shuttler_afe_connections.jpg)
There is no PSU for the Remote AFE Board at this moment. For testing purposes, you should connect the Remote AFE Board to a lab PSU supplying +15V, -15V, and +5V. Please make sure all voltages share a common GND and check the pinouts carefully. Incorrect power connections can damage the Remote AFE Board.
## Building EFC Board Gateware and Firmware
The EFC Board gateware and firmware are on the [Artiq](https://github.com/m-labs/artiq) repo.
To build the gateware and firmware,
```
python -m artiq.gateware.targets.efc --hw-rev [v1.0, v1.1]
```
## Routing Table Configuration if Shuttler is Connected to Kasli Satellite
When Kasli Satellite is compiled with Shuttler, Shuttler is connected to the Satellite Repeater instance. Therefore, you will need to specify the routing table on the Kasli/Kasli-soc master in order to access the Shuttler hardware. Shuttler locates at DEST 4 connecting to Repeater ID #3. The ID number goes up accordingly if more than one Shuttler is connected.
Here provides an example to configure the routing table.
You have 1 Kasli Master and 1 Kasli Satellite. Kasli Master (SFP1)(DEST1) port is connected to Kasli Satellite(SFP0)(DEST0). Shuttler is connected to Kasli Satellite with DRTIO over EEM Cable(DEST4).
1. Initialize the Routing Table: ``` artiq_route rt.bin init```
2. Add the routing table entry for Kasli Master's Peripherals: ```artiq_route rt.bin set 0 0```
3. Add the routing table entry for Kasli Satellite's Peripherals: ```artiq_route rt.bin set 1 1 0```
4. Add the routing table entry for Shuttler: ```artiq_route rt.bin set 4 1 4 0```
5. Flash the routing table on Kasli Master: ```artiq_coremgmt config write -f routing_table rt.bin```
## Flashing
When you are building a crate with shuttler(s), you should erase the flash/sd card config on both the EFC and Kasli/Kasli-soc. Always flash the EFC Board first before flashing the Kasli/Kasli-soc.
If either of the following elements is changed, you will need to **ERASE** the stored calibrated values on both the EFC and Kasli Master, or the communication between the boards cannot be established:
1. EEM Cable
2. Clock-Related Cable
3. EFC Board Gateware
4. Kasli/Kasli-Soc Master Gateware
5. EFC Board/Kasli/Kasli-Soc PCB
To erase the flash on the EFC board,
```
artiq_flash -t efc erase
```
To flash the gateware and firmware onto the EFC board,
```
artiq_flash --srcbuild -t [efc1v0, efc1v1] -d artiq_efc/shuttler
```
## Testing
1. Connect the Remote AFE Card to the Shuttler
2. Power up the Remote AFE Board and the Kasli/Kasli-Soc with the connected Shuttler.
3. Check all Remote AFE Board Power Indicator LEDs.
4. Run the `artiq_sinara_test`.
```
*** Testing LEDs.
Check for blinking. Press ENTER when done.
...
Testing LED: shuttler0_led0
Testing LED: shuttler0_led1
*** Testing Shuttler.
Testing: shuttler0
Check Remote AFE Board Relay LED Indicators.
Press Enter to Continue.
Testing Shuttler DAC
Voltages: 0.1 -0.1 0.2 -0.2 0.3 -0.3 0.4 -0.4 0.5 -0.5 0.6 -0.6 0.7 -0.7 0.8 -0.8
Press Enter to Continue.
PASSED
...
```

View File

@ -10,19 +10,9 @@ EEM is used for power only, and it can be alternatively powered by 12V barrel ja
Not present in the JSON.
## Getting the firmware
## Building
You can get the firmware from [Hydra](https://nixbld.m-labs.hk/jobset/mcu/mcu-contrib).
* ``stabilizer-dual-iir`` supports Pounder v1.2 - probably you should flash this one,
* ``stabilizer-dual-iir-pounder_v1_0`` supports Pounder 1.0 and 1.1 (legacy),
* ``stabilizer-lockin`` is a different application which we do not usually flash.
These all include changes to the mainline code to include Pounder telemetry.
### Building (optional)
Please keep in mind that the firmware from the official Quartiq repository does not include support for Pounder in MQTT, you may need to use a fork for that. But if the stabilizer is without a Pounder, it's also a valid option.
Pick your poison - firmware version: older with Pounder support or newer with USB serial console - the first works with a hardcoded MQTT broker and (static or dynamic) IP address, the latter is configured like the booster - through a serial console.
There is no Nix Flake support to make things easier, so you need to set up rust and cargo manually. Start with cloning the stabilizer repository and opening a new shell with dfu-util (for flashing) and rustup (for building).
@ -40,18 +30,27 @@ rustup update
rustup default stable
```
Building:
Building the older version:
```
BROKER="MQTT BROKER IP" cargo build --release
BROKER="MQTT BROKER IP" cargo objcopy --release --bin dual-iir -- -O binary dual-iir.bin
```
Building the newer version:
```
cargo build --release
cargo objcopy --release --bin dual-iir -- -O binary dual-iir.bin
```
The newer version must be configured with USB console later (try ``help`` command first).
## Flashing
Once you have the binary, you can now flash it.
Once you have the binary (either built, or received from someone), you can now flash it.
Without firmware on the device or with older firmware (without USB serial console), you need to use the jumper method:
Without firmware on the device or with older firmware, you need to use the jumper method:
1. Have the Stabilizer disconnected from power.
2. Use a jumper of some sort to short BOOT pins on the board.
@ -76,11 +75,9 @@ dfu-util -a 0 -s 0x08000000:leave -R -D dual-iir.bin
7. Look for "File downloaded successfully".
For normal usage, the stabilizer must be configured with USB console later (try ``help`` command first), to set its IP address and MQTT broker address. However, for general testing (like the one below), you don't need to configure it any further.
## Testing
1. Ensure that the [firmware](#getting-the-firmware) has been flashed onto the Stabilizer
1. Ensure that the [firmware](https://github.com/quartiq/stabilizer) has been flashed onto the Stabilizer
2. Turn on the crate/Stabilizer via EEM cable or power supply
3. Set up the signal generator for an amplitude of 1V, frequency of 10kHz, and a sine wave
4. Use the splitter to connect the generator's output to ADC0 and to the oscilloscope (refer to the picture below)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

View File

@ -1,6 +1,4 @@
# Building legacy firmware
## Building ARTIQ-6 and earlier
# Building ARTIQ-6 and earlier
Pre-flake ARTIQ (that is 6 and earlier) requires slightly different steps for building.
@ -8,9 +6,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:
@ -20,7 +18,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
@ -53,9 +51,7 @@ 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/
@ -65,40 +61,4 @@ 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
```
```

View File

@ -45,9 +45,3 @@ During the connection, the clock signal is being distributed, effectively making
* Wrong setups - master to master, standalone to standalone. Messing up with SFP ports generally makes it unusable,
but the connection should be established in most cases.
* The fiber adapters are not symmetrical - if one end has 1270/1330 label, another one should be 1330/1270.
### Master-satellite interrupted/unstable connection
This often happens due to overheating issues. Check if the Kasli/SoC fans are working properly and
try installing rack fans to increase the air flow.

View File

@ -1,62 +0,0 @@
# Setup your PC for building ARTIQ firmware
This page should guide you through building the firmware on your own PC.
Unfortunately, the building process is not possible on Windows natively (nor MSYS2),
but you can use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install).
## Prerequisites
You should have a Linux with `nix` and `git` installed. For this purpose you may want to consider NixOS, though it is hard way for everything else.
You should have at least 70+ GB of free space (better 100+ GB) on your `/opt` or `/` - most of this space will be taken
by Vivado.
## Installation
1. Install Vivado 2022.2 from [Vivado archive](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive.html) into `/opt`.
2. Check that `ls -al /opt/Xilinx/Vivado/2022.2/settings64.sh` exists and has read and execute permissions for all:
```shell
$ ls -al /opt/Xilinx/Vivado/2022.2/settings64.sh
-rwxr-xr-x 1 nobody nogroup 245 Dec 17 2022 /opt/Xilinx/Vivado/2022.2/settings64.sh
```
3. Add following into the `~/.local/share/nix/trusted-settings.json`, by `mkdir -p ~/.local/share/nix/ && nano ~/.local/share/nix/trusted-settings.json`
or with your favorite way (don't forget to save - Ctrl+O in `nano`):
```json
{
"extra-sandbox-paths":{
"/opt":true
},
"extra-substituters":{
"https://nixbld.m-labs.hk":true
},
"extra-trusted-public-keys":{
"nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc=":true
}
}
```
4. Enable flakes in Nix by e.g. adding `experimental-features = nix-command flakes` to nix.conf (for example `~/.config/nix/nix.conf`).
From here, you should be able to enter ARTIQ development shell directly from URL, or by cloning the repository.
The later will allow you to edit the source code in case of need.
For example for Kasli 2.0:
```shell
git clone https://github.com/m-labs/artiq.git
cd artiq
nix develop #boards
```
For Kasli-SoC:
```shell
git clone https://git.m-labs.hk/M-Labs/artiq-zynq.git
cd artiq-zynq
nix develop
```
For building instructions for your JSON, please refer to the [build and test instructions](../build_test_firmware.md).
The reference uses commands like `nix develop github:m-labs/artiq\?ref=release-8#boards` and `nix develop git+https://git.m-labs.hk/m-labs/artiq-zynq\?ref=release-8`.
You may safely skip such commands if you entered the development shell (`nix develop`) from cloned git repository.
If you want to update the source files, you may use `git pull origin master --rebase`.
Please refer to the [git documentation](https://www.git-scm.com/docs) or other resources of your choice if you are unfamiliar with `git`.
You may also use GUI git tools, like the one integrated into JetBrains IDEs (PyCharm, Intellij and others), VS Code, Sublime Merge or others.