Hello, I'm new to ARTIQ and am getting the system set up for the lab I am in. I had some network problems but believe I connected the PC and Kasli-SOC. It seems like the next step is to make sure that the commands 'artiq_sinara_tester' and 'artiq_run led.py' are working. When I execute these commands, they both end up with the same error and I haven't seen any information on similar errors.

When running 'artiq_run led.py' I get the following error (led.py is the same as led0.py):

(artiq) PS C:\Users\QC_Control.conda\envs\artiq\Lib\site-packages\artiq> artiq_run led0.py

 Traceback (most recent call last): 

File "C:\Users\QC_Control\.conda\envs\artiq\Scripts\artiq_run-script.py", line 9, in <module> 

     sys.exit(main()) 

File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\frontend\artiq_run.py", line 224, in main 

     return run(with_file=True) 

File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\frontend\artiq_run.py", line 210, in run 

     raise exn 

File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\frontend\artiq_run.py", line 203, in run 

     exp_inst.run() 

File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\language\core.py", line 54, in run_on_core 

     return getattr(self, arg).run(run_on_core, ((self,) + k_args), k_kwargs) 

File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\coredevice\core.py", line 140, in run 

     self._run_compiled(kernel_library, embedding_map, symbolizer, demangler) 

File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\coredevice\core.py", line 128, in _run_compiled 

     self.comm.load(kernel_library) 

File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\coredevice\comm_kernel.py", line 381, in load 

     raise LoadError(self._read_string()) 

artiq.coredevice.comm_kernel.LoadError: core1 failed to process data 

When I run 'artiq_sinara_tester' I get a similar error:

(artiq) PS C:\Users\QC_Control.conda\envs\artiq\Lib\site-packages\artiq> artiq_run led0.py

 Traceback (most recent call last): 

 File "C:\Users\QC_Control\.conda\envs\artiq\Scripts\artiq_run-script.py", line 9, in <module> 

      sys.exit(main()) 

 File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\frontend\artiq_run.py", line 224, in main 

      return run(with_file=True) 

 File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\frontend\artiq_run.py", line 210, in run 

      raise exn 

 File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\frontend\artiq_run.py", line 203, in run 

     exp_inst.run() 

 File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\language\core.py", line 54, in run_on_core 

    return getattr(self, arg).run(run_on_core, ((self,) + k_args), k_kwargs) 

 File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\coredevice\core.py", line 140, in run 

    self._run_compiled(kernel_library, embedding_map, symbolizer, demangler) 

 File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\coredevice\core.py", line 128, in _run_compiled 

     self.comm.load(kernel_library) 

 File "C:\Users\QC_Control\.conda\envs\artiq\lib\site-packages\artiq\coredevice\comm_kernel.py", line 381, in load 

     raise LoadError(self._read_string()) 

 artiq.coredevice.comm_kernel.LoadError: core1 failed to process data 

If more information like the output of 'artiq_coremgmt log' might be useful I can also share that. Any help figuring this out is appreciated.

    So when I run artiq_coremgmt log as the first thing after entering the artiq environment, I get:

    (artiq) PS C:\Users\QC_Control\anaconda3\pkgs\artiq-7.8176.6fbfa12-0\site-packages\artiq> artiq_coremgmt log
    [ 0.000067s] INFO(runtime): NAR3/Zynq7000 starting...
    [ 0.005237s] INFO(runtime): gateware ident: yalemaster
    [ 0.015634s] INFO(libboard_zynq::i2c): PCA9548 detected
    [ 0.246836s] WARN(runtime::rtio_clocking): error reading configuration. Falling back to default.
    [ 0.255697s] WARN(runtime::rtio_clocking): Using default configuration - internal 125MHz RTIO clock.
    [ 0.264897s] INFO(runtime::rtio_clocking): using internal 125MHz RTIO clock
    [ 0.655628s] INFO(libboard_artiq::si5324): waiting for Si5324 lock...
    [ 2.366251s] INFO(libboard_artiq::si5324): ...locked
    [ 2.375996s] INFO(runtime::rtio_clocking): RTIO PLL locked
    [ 2.386747s] INFO(libboard_zynq::i2c): PCA9548 detected
    [ 2.422527s] INFO(runtime::comms): network addresses: MAC=fc-0f-e7-07-c4-30 IPv4=192.168.1.75 IPv6-LL=fe80::fe0f:e7ff:fe07:c430 IPv6: no configured address
    [ 2.440619s] INFO(libboard_artiq::drtio_routing): could not read routing table from configuration, using default
    [ 2.450869s] INFO(libboard_artiq::drtio_routing): routing table: RoutingTable { 0: 0; 1: 1 0; 2: 2 0; 3: 3 0; 4: 4 0; }
    [ 2.465444s] INFO(runtime::rtio_mgt::drtio): [DEST#0] destination is up
    [ 5.965091s] INFO(libboard_zynq::eth): eth: got Link { speed: S1000, duplex: Full }
    [ 128.778043s] INFO(runtime::mgmt): received connection

    Next, I try running artiq_sinara_tester and artiq_run led0.py. They both still get the same error as above.
    When I run artiq_coremgmt log, I now get the following:

    (artiq) PS C:\Users\QC_Control\anaconda3\pkgs\artiq-7.8176.6fbfa12-0\site-packages\artiq> artiq_coremgmt log
    [ 0.000067s] INFO(runtime): NAR3/Zynq7000 starting...
    [ 0.005237s] INFO(runtime): gateware ident: yalemaster
    [ 0.015634s] INFO(libboard_zynq::i2c): PCA9548 detected
    [ 0.246836s] WARN(runtime::rtio_clocking): error reading configuration. Falling back to default.
    [ 0.255697s] WARN(runtime::rtio_clocking): Using default configuration - internal 125MHz RTIO clock.
    [ 0.264897s] INFO(runtime::rtio_clocking): using internal 125MHz RTIO clock
    [ 0.655628s] INFO(libboard_artiq::si5324): waiting for Si5324 lock...
    [ 2.366251s] INFO(libboard_artiq::si5324): ...locked
    [ 2.375996s] INFO(runtime::rtio_clocking): RTIO PLL locked
    [ 2.386747s] INFO(libboard_zynq::i2c): PCA9548 detected
    [ 2.422527s] INFO(runtime::comms): network addresses: MAC=fc-0f-e7-07-c4-30 IPv4=192.168.1.75 IPv6-LL=fe80::fe0f:e7ff:fe07:c430 IPv6: no configured address
    [ 2.440619s] INFO(libboard_artiq::drtio_routing): could not read routing table from configuration, using default
    [ 2.450869s] INFO(libboard_artiq::drtio_routing): routing table: RoutingTable { 0: 0; 1: 1 0; 2: 2 0; 3: 3 0; 4: 4 0; }
    [ 2.465444s] INFO(runtime::rtio_mgt::drtio): [DEST#0] destination is up
    [ 5.965091s] INFO(libboard_zynq::eth): eth: got Link { speed: S1000, duplex: Full }
    [ 128.778043s] INFO(runtime::mgmt): received connection
    [ 141.549453s] ERROR(runtime::kernel::core1): failed to load shared library: parse error: not for a supported architecture
    [ 141.560316s] WARN(runtime::comms): connection terminated: unexpected pattern
    [ 149.070473s] ERROR(runtime::kernel::core1): failed to load shared library: parse error: not for a supported architecture
    [ 149.081332s] WARN(runtime::comms): connection terminated: unexpected pattern
    [ 160.440527s] INFO(runtime::mgmt): received connection

    Just to update, this problem was solved by using the correct device_db file. It looks like the device_db used was targeted for Kasli, not the Kasli-SoC, which caused compiler to build experiments for the RISCV (Kasli), not for the ARM (Kasli-SoC).

    a year later

    Where can one find that "correct device_db file"?

      I copied the example blink_forever from the link above and ran it with the same device_db.py (changing the ip address to mine) and the code seems to run. However, I do not see any LED blinking. I also tried to set the number of blinks (because from MSYS2 I cannot CTRL+C) and change the ON time just in case it was too fast for my eyes. No visible change. In the log, I get:
      [ 1000.246568s] INFO(ksupport::kernel::core1): kernel starting
      [ 1000.252242s] INFO(ksupport::kernel::core1): kernel finished
      [ 1000.258338s] INFO(runtime::comms): peer closed connection
      [ 1004.171340s] INFO(runtime::mgmt): received connection

        lf_10 The channels in the device_db.py file need to correspond to the correct channels from your firmware build. Instead of using the device_db.py in the examples folder, use artiq_ddb_template -o device_db.py <variant>.json with the variant file used to build your core device gateware/firmware. See also this manual entry: https://m-labs.hk/artiq/manual/environment.html#the-device-database. Assuming that the crate was ordered from M-Labs, your lab would have already been provided the correct device_db.py and variant JSON file. If your lab has a subscription to the AFWS service, you should be able to get the variant JSON file from there (should it also be missing). Hope that helps!

        And what if I purchased the Kasli-SOC from Creotech directly? So far I just used the boot.bin that I installed via SD card from hydra (from here). I also added a settings.txt to fix the IP.

          Thanx for the tip regarding the boot "master"! Now I changed it to "standalone".
          Having followed the instructions, in windows, I managed to download all the requirements. However, I am facing now the following problem:
          Vivado is downloaded and I am working on my directory where I cloned release-8 and (by using nix via wsl2) I ran:
          nix build --print-build-logs --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="standalone"; json=./default.json;}).kasli_soc-standalone-sd'
          It stops compiling in the end because it does not find Vivado:
          File "/nix/store/1bsw1rvnmnffggadxx9xxx9yz3frl0vm-python3-3.11.9-env/lib/python3.11/site-packages/migen/build/xilinx/vivado.py", line 69, in _run_vivado
          kasli_soc-standalone-gateware> raise OSError("Subprocess failed")

          Before downloading any Vivado version, I traced back what is used in the packages (as for Kasli-SOC at least it does not appear explicitly in the flake.nix file. If I am not wrong, it is Vivado 2022.2.
          I could not find yet a file where I could add the location of the bin folder of my Vivado such that nix finds it when compiling.
          Any tip?
          Thx in advance.

          Did you install Vivado outside of the default location? If so, you have to edit the (mainline ARTIQ) flake.nix, which to build for Zynq means cloning both repositories, ARTIQ and ARTIQ-Zynq. Change the inputs to the ARTIQ-Zynq flake to take your local copy of the ARTIQ source; there's a tip to this effect on the developing manual page. Then change the line in the ARTIQ flake that looks for Vivado in opt.

            Thx for the reply. This is what I did:
            In flake.nix from ARTIQ:
            vivado = pkgs.buildFHSEnv {
            name = "vivado";
            targetPkgs = vivadoDeps;
            profile = "set -e; source /mnt/c/Xilinx/Vivado/2022.2/settings64.sh";
            runScript = "vivado";
            };

            In flake.nix from ARTIQ-zynq:
            'inputs.artiq.url = "path:/mnt/c/Users/lf/Documents/codes/hardware/artiq/artiq"
            '

            Following the instructions in the manual I typed nix flake update and nix develop after every flake.nix change and got messages showing my changes.

            I also changed the build command:
            nix build --print-build-logs --impure --expr 'let fl = builtins.getFlake "/mnt/c/Users/lf/Documents/codes/hardware/artiq/artiq-zynq"; in (fl.makeArtiqZynqPackage {target="kasli_soc"; variant="standalone"; json=./default.json;}).kasli_soc-standalone-sd'

            I will continue looking for the origin of the error.

              Thanks for the reply. I tried to substitute the extra-sandbox-paths="/opt" to the location of my vivado with what you suggest, as well as with /mnt/c, but I still get the same error.

              Hi again,
              I decided to do it on Linux and installed everything as is suggested in the instructions. Given that all is the same, once I downloaded the artiq-zynq pachage (its release-8), I just executed nix develop and then nix build --print-build-logs --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="standalone"; json=./basic.json;}).kasli_soc-standalone-sd'

              The error I get is the same:
              kasli_soc-standalone-gateware> Fastino (EEM0) starting at RTIO channel 0x000000
              kasli_soc-standalone-gateware> USER LED at RTIO channel 0x000001
              kasli_soc-standalone-gateware> USER LED at RTIO channel 0x000002
              kasli_soc-standalone-gateware> /etc/profile: line 37: /opt/Xilinx/Vivado/2022.2/settings64.sh: No such file or directory
              kasli_soc-standalone-gateware> Traceback (most recent call last):
              kasli_soc-standalone-gateware> File "/nix/store/a2iy41gccss952qhh8vnaivxjla29alq-gateware/kasli_soc.py", line 672, in <module>
              kasli_soc-standalone-gateware> main()
              kasli_soc-standalone-gateware> File "/nix/store/a2iy41gccss952qhh8vnaivxjla29alq-gateware/kasli_soc.py", line 668, in main
              kasli_soc-standalone-gateware> soc.build(build_dir=args.g)
              kasli_soc-standalone-gateware> File "/nix/store/vbv516vz6qi4m4wgavbdb1m1qwq7qnc4-python3-3.11.9-env/lib/python3.11/site-packages/migen_axi/integration/soc_core.py", line 169, in build
              kasli_soc-standalone-gateware> self.platform.build(self, *args, **kwargs)
              kasli_soc-standalone-gateware> File "/nix/store/vbv516vz6qi4m4wgavbdb1m1qwq7qnc4-python3-3.11.9-env/lib/python3.11/site-packages/migen/build/xilinx/platform.py", line 59, in build
              kasli_soc-standalone-gateware> return self.toolchain.build(self, *args, **kwargs)
              kasli_soc-standalone-gateware> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              kasli_soc-standalone-gateware> File "/nix/store/vbv516vz6qi4m4wgavbdb1m1qwq7qnc4-python3-3.11.9-env/lib/python3.11/site-packages/migen/build/xilinx/vivado.py", line 224, in build
              kasli_soc-standalone-gateware> _run_vivado(build_name)
              kasli_soc-standalone-gateware> File "/nix/store/vbv516vz6qi4m4wgavbdb1m1qwq7qnc4-python3-3.11.9-env/lib/python3.11/site-packages/migen/build/xilinx/vivado.py", line 69, in _run_vivado
              kasli_soc-standalone-gateware> raise OSError("Subprocess failed")
              kasli_soc-standalone-gateware> OSError: Subprocess failed

              I checked that the file settings64.sh exists. I also looked int /etc/profile and it only has 27 lines of code.

              My artiq-zynq package is NOT in /opt, but this should not be the problem.

              Any idea?

              I forgot to say that I am using Ubuntu 22.04.4 LTS

              Step 5 solved the problem. Thank you very much!

              2 months later

              @esavkin You could also set up an apparmor profile for Nix and possibly merge it upstream. But, of course, that takes more work.