forked from sinara-hw/assembly
Compare commits
17 Commits
mirny_lega
...
master
Author | SHA1 | Date |
---|---|---|
|
2e14232474 | |
|
d71bc3a57e | |
|
01d479eba3 | |
|
579749d114 | |
|
d8ba6b94ae | |
|
22222ebdbf | |
|
6d46ed7150 | |
|
d44be3dd8e | |
|
9a216f3d51 | |
|
2777676057 | |
|
ea1b0b5c56 | |
|
49de48aa32 | |
|
98632d7c31 | |
|
47d46b7bbd | |
|
8d1432488f | |
|
cb048ac4aa | |
|
89173e4f2e |
16
README.md
16
README.md
|
@ -2,7 +2,7 @@
|
|||
|
||||
Repository with instructions and remarks on assembling and testing Sinara hardware
|
||||
|
||||
### Build docs
|
||||
## Build docs
|
||||
|
||||
```shell
|
||||
nix build
|
||||
|
@ -17,7 +17,19 @@ nix develop
|
|||
mdbook build
|
||||
```
|
||||
|
||||
The output files are in `book` directory.
|
||||
The output files will be in `book` directory.
|
||||
|
||||
### Alternative way
|
||||
|
||||
Since the docs builder depends only on mdBook, you may get it from anywhere you like - `nix-shell -p mdbook`,
|
||||
`snap install mdbook`, `cargo install mdbook` or any other from your OS.
|
||||
After that you will be able to do:
|
||||
|
||||
```shell
|
||||
mdbook build
|
||||
```
|
||||
|
||||
The output files will be in `book` directory.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
- [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)
|
||||
|
@ -28,4 +29,6 @@
|
|||
- [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)
|
||||
- [device_db.py](sw_sup/device_db.md)
|
||||
- [Setup your PC for building ARTIQ firmware](sw_sup/setup_build_pc.md)
|
||||
- [AFWS client](sw_sup/afws_client.md)
|
|
@ -39,13 +39,15 @@ 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#boards
|
||||
# master/standalone only
|
||||
artiq_mkfs -s ip 192.168.1.75 kasli.config
|
||||
artiq_mkfs -s ip 192.168.1.75/24 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 +67,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)
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -17,9 +17,9 @@
|
|||
|
||||
## Getting the firmware
|
||||
|
||||
Here is [Mirny 0.3.1 firmware](../extra/mirny/mirny-0.3.1.zip). It contains a single ``.jed`` file that can be flashed following [flashing instructions](#flashing). This firmware supports Almazny v1.2+.
|
||||
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](../extra/mirny/mirny_0.2.4_legacy_almazny.zip).
|
||||
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)
|
||||
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
# 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
|
||||
|
||||
...
|
||||
```
|
|
@ -78,6 +78,19 @@ dfu-util -a 0 -s 0x08000000:leave -R -D dual-iir.bin
|
|||
|
||||
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.
|
||||
|
||||
### Clearing settings
|
||||
|
||||
In case someone sets some setting wrongly, or updates the firmware and suddenly there's an incompatibility, you may find (firmware, not yourself) in a state of panic, where it will not allow you to change the settings back.
|
||||
|
||||
1. Get into DFU mode (described above), probably with jumper method.
|
||||
2. Use dfu-util to clear the flash completely:
|
||||
|
||||
```
|
||||
dfu-util -a 0 -s 0x08000000:mass-erase:force:leave
|
||||
```
|
||||
|
||||
3. Reflash the target firmware.
|
||||
|
||||
## Testing
|
||||
|
||||
1. Ensure that the [firmware](#getting-the-firmware) has been flashed onto the Stabilizer
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 74 KiB |
Binary file not shown.
After Width: | Height: | Size: 110 KiB |
Binary file not shown.
After Width: | Height: | Size: 78 KiB |
|
@ -0,0 +1,138 @@
|
|||
# AFWS client
|
||||
|
||||
This article is intended to help with using the `afws_client` command properly.
|
||||
|
||||
## Usage
|
||||
|
||||
### What is AFWS
|
||||
|
||||
AFWS (ARTIQ FirmWare Service) - a service, that allows building customer tailored firmware and gateware (binaries) on M-Labs's servers,
|
||||
and receive these binaries in ready-to-flash format. Subscription to this service also includes helpdesk support,
|
||||
and thus is paid on yearly basis (contact sales for prices). It is also typically included when purchasing Carrier (Kasli/Kasli-SoC) for a year,
|
||||
or one-time when purchasing standalone cards for existing crate. Each variant/carrier requires its own subscription.
|
||||
|
||||
### What do I need for obtaining binaries
|
||||
|
||||
You'll need to have credentials - username and password, which you can obtain from helpdesk, if you haven't yet.
|
||||
Don't forget to specify variant (sticker on top of the crate) that you need to obtain binaries for.
|
||||
|
||||
### When do I need to update
|
||||
|
||||
In most cases there is no need to update the firmware, unless you encountered a bug and the fix was backported to your version.
|
||||
However, if you: changed the layout of the cards - either moved EEM connections, added or deleted cards;
|
||||
changed modes/configurations of the cards (e.g. enable/disable SUServo, synchronization, edge counter, SED lanes etc.).
|
||||
In such cases, these changes need to be authorized through helpdesk.
|
||||
|
||||
### How to
|
||||
|
||||
The base command looks like this:
|
||||
```shell
|
||||
afws_client <username> build <afws_directory> <variant>
|
||||
```
|
||||
|
||||
Where (remove `<` and `>`):
|
||||
* `<username>` - your username from credentials
|
||||
* `<afws_directory>` - the directory/folder, into which you wish to save the binaries
|
||||
* `<variant>` - name of the crate/variant. It's optional if you have only one variant in the account
|
||||
|
||||
After running this command, it will ask you for the password (the line will remain blank for security reasons).
|
||||
If everything matches (username and password are correct, specified variant is in your account and not expired),
|
||||
AFWS will start building the firmware, which takes 10-15 minutes. Sometimes there might be some problems, in which
|
||||
case don't hesitate to contact helpdesk.
|
||||
|
||||
After the build done, the AFWS client will automatically download the binaries into `<afws_directory>`, from which
|
||||
you can flash them into your Carrier.
|
||||
|
||||
#### View build logs
|
||||
|
||||
You may want to view the build logs (for example, in case of problems with configuration).
|
||||
For this, add `--log` option after build:
|
||||
|
||||
```shell
|
||||
afws_client <username> build --log <afws_directory> <variant>
|
||||
```
|
||||
|
||||
#### Specify version
|
||||
|
||||
By default, AFWS client tries to figure out the installed ARTIQ version. However it works only for Kasli, and not Kasli-SoC.
|
||||
It also may fail to determine ARTIQ version if you are using AFWS client without ARTIQ installation.
|
||||
Additionally, you may want to specify version regardless of installed version.
|
||||
In all these cases, you'll need to specify **both** `--major-ver` and `--rev` arguments, so your command will look like this:
|
||||
|
||||
```shell
|
||||
afws_client <username> build --major-ver <MAJOR_VER> --rev <REV> <afws_directory> <variant>
|
||||
```
|
||||
|
||||
Where:
|
||||
* `MAJOR_VER` - ARTIQ major version, either `7` (legacy), `8` (current stable),
|
||||
`9` (current beta) or `10` (experimental with `nac3` compiler)
|
||||
* `REV` - revision from respective branch and repository - i.e. commit hash. You may obtain it either from:
|
||||
* [ARTIQ repository](https://github.com/m-labs/artiq) (for Kasli 2.0 and earlier) by
|
||||
[selecting branch](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-branches-in-your-repository/viewing-branches-in-your-repository)
|
||||
and selecting `XXX commits` above list of files. From here, the list of commits in specified branch will appear
|
||||
and you will be able to choose the commit and press ["Copy full SHA for YYY"](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/about-commits#using-the-file-tree)
|
||||
button in the right side.
|
||||
* [ARTIQ on Zynq repository](https://git.m-labs.hk/M-Labs/artiq-zynq) (for Kasli-SoC). In similar way to GitHub,
|
||||
you can choose branch, commit history and copy SHA1 of the commit.
|
||||
|
||||
The branches currently map as following:
|
||||
* ARTIQ-7 - release-7
|
||||
* ARTIQ-8 - release-8
|
||||
* ARTIQ-9 - master
|
||||
* ARTIQ-10 - nac3
|
||||
|
||||
The binaries you receive are "pure" - if the inputs are the same (same version,
|
||||
same JSON), the system outputs exactly the same binaries, and if you did it recently, they will be obtained from Nix
|
||||
cache (i.e. not rebuilt).
|
||||
|
||||
#### Change password
|
||||
|
||||
After you received credentials from us, we strongly recommend changing the password as soon as possible via
|
||||
`afws_client <username> passwd` command. This command will ask you for existing password and new desired password.
|
||||
|
||||
The passwords are stored in a hashed way (i.e. cannot be decrypted back), however it's your responsibility to choose good passwords.
|
||||
Just keep in mind, that password may contain only alpha-numeric symbols and underscore `[a-zA-Z0-9_]`. If it contains other symbols,
|
||||
they may be silently ignored and you will not be able to log in.
|
||||
If you cannot login, we may reset your password if you email us at helpdesk.
|
||||
|
||||
#### Get variants
|
||||
|
||||
You may get variants, which are tied to your account by using `get_variants` command:
|
||||
```shell
|
||||
afws_client <username> get_variants
|
||||
```
|
||||
|
||||
It will ask for password and output the variants and their respective expiry date:
|
||||
|
||||
```text
|
||||
+-----------+-------------+
|
||||
| Variant | Expiry date |
|
||||
+-----------+-------------+
|
||||
| test | 2028-02-08 |
|
||||
| test3 | 2042-08-08 |
|
||||
+-----------+-------------+
|
||||
```
|
||||
|
||||
#### Get JSONs
|
||||
|
||||
Sometimes you may want to view the JSON description, from which AFWS is building the variant. With the JSON, you can
|
||||
later build the firmware by yourself and/or generate device_db file. The command looks like this (variant
|
||||
needs to be valid, i.e. not expired and authorized in your account):
|
||||
|
||||
```shell
|
||||
afws_client <username> get_json [-o <OUT>] [-f] <variant>
|
||||
```
|
||||
|
||||
Specify output file `-o <OUT>`, if you want to save it directly to file `<OUT>`, use `-f` if you want to force
|
||||
overwrite. If you do not specify any of these options, you'll get the JSON description directly in stdin (i.e. in your
|
||||
console/terminal).
|
||||
|
||||
|
||||
#### Miscellaneous
|
||||
|
||||
You may also specify custom AFWS provider with these options (put them before username):
|
||||
|
||||
* `--server SERVER` - server to connect to (default: afws.m-labs.hk)
|
||||
* `--port PORT` - port to connect to (default: 80)
|
||||
* `--cert CERT` - SSL certificate file used to authenticate server (default: use system certificates)
|
||||
|
|
@ -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
|
||||
|
@ -30,6 +32,14 @@ git checkout release-6 # or release-5...
|
|||
cd ..
|
||||
```
|
||||
|
||||
Keep in mind that ARTIQ-6 scripts have been removed in `nix-scripts`, so you may need to checkout the last commit that still has them.
|
||||
|
||||
```shell
|
||||
cd nix-scripts
|
||||
git checkout c590df48e0553a670e18ebf9d02047bfcfddb40d
|
||||
cd ..
|
||||
```
|
||||
|
||||
## Setting up the environment and building firmware
|
||||
|
||||
Within ``fish`` shell (others may not work correctly), set up the ARTIQ build environment:
|
||||
|
@ -51,7 +61,8 @@ 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 +72,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
|
||||
```
|
||||
|
||||
|
|
|
@ -8,14 +8,15 @@ a-la `I can't connect, please help`.
|
|||
1. `device_db.py` has misleading `core_addr` address.
|
||||
2. PC and the crate are in different subnets. They should be in the same network. Also you may want to directly attach the Kasli to the PC.
|
||||
3. Network restrictions/problems on your router, either by IP, MAC, protocols or anything else.
|
||||
4. Wrong configuration of the Kasli. Change IP or MAC address to correspond your network. For ARTIQ-8, add
|
||||
network mask to the `ip` setting on Kasli, like `192.168.1.75/24`.
|
||||
4. Wrong configuration of the Kasli. Change IP or MAC address to correspond your network. For ARTIQ-8 and later, add
|
||||
network mask to the `ip` setting on Kasli (not applicable for Kasli-SoC), like `192.168.1.75/24`.
|
||||
5. Incompatible Ethernet cables/SFP RJ45. Try different cables and SFP adapters.
|
||||
We usually test them with CAT6 cables, but lower categories should be supported too.
|
||||
6. SFP or Ethernet are not pushed til the end.
|
||||
7. Some weird bugs in Vivado, leading to not working SFP on certain combinations of builds and Kaslis (very rare)
|
||||
8. Running configured for external reference Kasli without external reference clock signal
|
||||
9. Using legacy firmware with newer hardware. ARTIQ-6 doesn't support Kasli v2.0.2
|
||||
10. Some other device in your network already reserved the configured IP address.
|
||||
|
||||
## Ways to diagnose
|
||||
|
||||
|
@ -27,6 +28,8 @@ a-la `I can't connect, please help`.
|
|||
5. `nmap` and `arp` to scan your network to help your Kasli get discovered. May be restricted in your network.
|
||||
6. Directly connect your Kasli to the PC via Ethernet and set up networking on the PC: `ip addr change 192.168.1.0/24 dev eth0`
|
||||
7. Become a router and capture all the packets when your Kasli tries to connect to the network.
|
||||
8. Turn off the Carrier/Kasli and `ping` the configured IP address. If it pings, then you'll need either set different
|
||||
IP address on your Carrier or somehow deal with that other device - remove, assign different address, move to other network etc.
|
||||
|
||||
|
||||
## Direct connection
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
# 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 and add `/opt` to sandbox e.g. adding following to the `nix.conf` (for example `~/.config/nix/nix.conf` or `/etc/nix/nix.conf`):
|
||||
```
|
||||
experimental-features = nix-command flakes
|
||||
extra-sandbox-paths = /opt
|
||||
```
|
||||
5. On Ubuntu, the Nix will conflict with Apparmor. You'll need to disable Apparmor for Nix,
|
||||
or for the whole system (you can also delete Apparmor completely, but be careful with it).
|
||||
|
||||
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.
|
|
@ -15,6 +15,8 @@ until its fully loaded.
|
|||
|
||||
### Older Nix and other Linuxes
|
||||
|
||||
Ensure your user is in `dialout` group.
|
||||
|
||||
1. Install `cutecom` via `nix-shell -p cutecom` or your package manager
|
||||
2. Run `cutecom` and follow settings from the picture: ![uart_cutecom.png](../img/uart_cutecom.png)
|
||||
3. Restart the device with `artiq_flash start`, or by power-cycling it (wait 30 seconds before turning on)
|
||||
|
|
Loading…
Reference in New Issue