I am trying to upgrade the Kasli v1.1 board in the lab from the ARTIQ 5 to ARTIQ 8.I followed the instructions from the documentationBuilding and developing ARTIQ.I used $ python -m artiq.gateware.targets.kasli apm.jsonto get the binary files. when I run
artiq_flash --srcbuild -d artiq_kasli/apm
I get the following message:

apm@apm-HP-280-G2-SFF:~/artiq8$ artiq_flash --srcbuild -d artiq_kasli/apm
Design: top;COMPRESS=TRUE;UserID=FFFFFFFF;Version=2022.2
Part name: 7a100tfgg484
Date: 2025/03/27
Time: 13:49:06
Bitstream payload length: 0x2af624
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling"
Info : clock speed 25000 kHz
Info : JTAG tap: xc7.tap tap/device found: 0x13631093 (mfg: 0x049 (Xilinx), part: 0x3631, ver: 0x1)
TEMP 69.70 C
VCCINT 0.988 V
VCCAUX 1.777 V
VCCBRAM 0.993 V
VPVN 0.000 V
VREFP 0.000 V
VREFN 0.000 V
VCCPINT 0.000 V
VCCPAUX 0.000 V
VCCODDR 0.000 V
Info : Found flash device 'sp s25fl128s' (ID 0x182001)
Info : sector 0 took 1794 ms
Info : sector 1 took 1753 ms
Info : sector 2 took 109 ms
Info : sector 3 took 108 ms
Info : sector 4 took 107 ms
Info : sector 5 took 111 ms
Info : sector 6 took 105 ms
Info : sector 7 took 103 ms
Info : sector 8 took 98 ms
Info : sector 9 took 103 ms
Info : sector 10 took 106 ms
Info : sector 11 took 106 ms
Info : sector 12 took 115 ms
Info : sector 13 took 109 ms
Info : sector 14 took 105 ms
Info : sector 15 took 107 ms
Info : sector 16 took 97 ms
Info : sector 17 took 107 ms
Info : sector 18 took 109 ms
Info : sector 19 took 104 ms
Info : sector 20 took 102 ms
Info : sector 21 took 103 ms
Info : sector 22 took 106 ms
Info : sector 23 took 108 ms
Info : sector 24 took 100 ms
Info : sector 25 took 98 ms
Info : sector 26 took 100 ms
Info : sector 27 took 103 ms
Info : sector 28 took 97 ms
Info : sector 29 took 103 ms
Info : sector 30 took 117 ms
Info : sector 31 took 113 ms
Info : sector 32 took 120 ms
Info : sector 33 took 103 ms
Info : sector 34 took 99 ms
Info : sector 35 took 107 ms
Info : sector 36 took 107 ms
Info : sector 37 took 109 ms
Info : sector 38 took 108 ms
Info : sector 39 took 99 ms
Info : sector 40 took 101 ms
Info : sector 41 took 105 ms
Info : sector 42 took 107 ms
Info : Found flash device 'sp s25fl128s' (ID 0x182001)
Info : sector 64 took 104 ms
Info : sector 65 took 115 ms
Info : Found flash device 'sp s25fl128s' (ID 0x182001)
Info : sector 69 took 105 ms
Info : sector 70 took 105 ms
Info : sector 71 took 109 ms
Info : sector 72 took 114 ms
Info : sector 73 took 105 ms
Info : sector 74 took 100 ms
Info : sector 75 took 129 ms
Info : sector 76 took 110 ms
Info : sector 77 took 119 ms
Info : sector 78 took 114 ms
Info : sector 79 took 102 ms
Info : sector 80 took 100 ms
Info : sector 81 took 102 ms
Info : sector 82 took 98 ms
Info : sector 83 took 104 ms
Info : sector 84 took 106 ms
Info : sector 85 took 112 ms
MiSoC Bootloader
Copyright (c) 2017-2025 M-Labs Limited

Bootloader CRC passed
Gateware ident 8.0+unknown.beta;apm
Initializing SDRAM...
Read leveling scan:
Module 1:
00000001111111111000000000000000
Module 0:
00000001111111111000000000000000
Read leveling: 11+-5 11+-5 done
SDRAM initialized
Memory test passed

Booting from flash...
Starting firmware.
[     0.000011s]  INFO(runtime): ARTIQ runtime starting...
[     0.003886s]  INFO(runtime): software ident 8.0+unknown.beta;apm
[     0.009887s]  INFO(runtime): gateware ident 8.0+unknown.beta;apm
[     0.015891s]  INFO(runtime): log level set to INFO by default
[     0.021605s]  INFO(runtime): UART log level set to INFO by default
[     0.027977s]  WARN(runtime::rtio_clocking): rtio_clock setting not recognised. Falling back to default.
[     0.037143s]  INFO(runtime::rtio_clocking): Clocking has already been set up.
[     0.044379s]  INFO(runtime): network addresses: MAC=10-e2-d5-32-50-29 IPv4=192.168.1.75/0 IPv6-LL=fe80::12e2:d5ff:fe32:5029/10 IPv6=no configured address
[     0.058142s]  WARN(runtime::rtio_mgt): error reading device map (key not found), device names will not be available in RTIO error messages
[     0.070406s]  INFO(runtime::rtio_mgt): SED spreading disabled by default
[     0.078354s]  INFO(runtime::mgmt): management interface active
[     0.089704s]  INFO(runtime::session): accepting network sessions
[     0.094434s]  INFO(runtime::session): running startup kernel
[     0.100097s]  INFO(runtime::session): no startup kernel found
[     0.105804s]  INFO(runtime::session): no connection, starting idle kernel
[     0.120068s]  INFO(runtime::session): no idle kernel found

It's my JSON config file:

{
    "target": "kasli",
    "variant": "apm",
    "hw_rev": "v1.1",
    "base": "standalone",
    "core_addr": "192.168.1.70",
    "peripherals": [
         {
            "type": "urukul",
            "dds": "ad9910",
            "ports": [0, 1],
            "clk_sel": 2
        },
         {
            "type": "urukul",
            "dds": "ad9910",
            "ports": [2, 3],
            "clk_sel": 2
        },
         {
            "type": "urukul",
            "dds": "ad9910",
            "ports": [4, 5],
            "clk_sel": 2
        },
        {
            "type": "dio",
            "ports": [6],
            "bank_direction_low": "input",
            "bank_direction_high": "output"
        },
        {
            "type": "dio",
            "ports": [7],
            "bank_direction_low": "output",
            "bank_direction_high": "output"
        },
        {
            "type": "dio",
            "ports": [8],
            "bank_direction_low": "output",
            "bank_direction_high": "output"
        },
        {
            "type": "dio",
            "ports": [9],
            "bank_direction_low": "output",
            "bank_direction_high": "output"
        },
        {
            "type": "dio",
            "ports": [10],
            "bank_direction_low": "output",
            "bank_direction_high": "output"
        }
    ]
}

I don't know why this is happening. Has anyone encountered a similar situation?
Any help is appreciated. Thanks!

    sb10q
    I couldn't connect to Kasli, and I thought the flashing had failed. Just now, I successfully connected, but I got this message. Is this normal?

    sb10q
    I previously attempted to flash ARTIQ 9, but after thinking it had failed, I flashed ARTIQ 8 again.I just tried connecting with ARTIQ 9, and it connected without errors. Now, I'm not sure whether my Kasli gateware is running ARTIQ 8 or ARTIQ 9.

    sb10q
    Yes, it's ARTIQ 8. I just flashed it to ARTIQ 9 and ran into a few new issues.

    • I used
      $ git clone https://github.com/m-labs/artiq.git
      $ cd artiq
      $ nix develop #boards
      to building the development environment,but the gateware version seems incorrect.
      How can I flash the correct gateware?

    • Is there a recommended way to properly shut down ARTIQ? This is my first time using MSYS2 and I'm not familiar with it. I tried pressing Ctrl+C in the MSYS2 shell , then closing the dashboard, and then run artiq_session, which successfully connected to Kasli. But if I close the dashboard first and then press Ctrl+C in the shell or directly close the shell, and then run artiq_session, the connection fails.

    • I disconnected the power to Kasli, closed the shell, then restarted, and the connection was successful. However, there were two warnings.
      I'm not sure if this is normal.

    Thank you very much for your reply.I'm a beginner,please forgive my inaccurate wording.

      wqding

      How can I flash the correct gateware?

      See also the FAQ about version mismatches. In your case if you generated your unknown.beta gateware from the same version you are currently using in software there's probably no actual mismatch and you can ignore the message. (AFAIK ARTIQ-9 gateware should generate with a specific version number if you are using nix develop #boards and your Git tree is clean.)

      Is there a recommended way to properly shut down ARTIQ?

      CTRL+C is normally fine. This sounds like a known issue with MSYS2 keyboard interrupt we have seen lately. It may work properly if you precede your commands with winpty.

      I'm not sure if this is normal.

      If you have not set any value for these settings, it is normal for none to be found.

        sb10q architeuthis
        I recreated the ARTIQ development environment yesterday using the $ nix develop git+https://github.com/m-labs/artiq.git#boards. This time, the version number is normal
        $ artiq_cllient --version
        ARTIQ v9.9204+4ddad5f.beta

        I received the following message during the gateware generation:

        
        make: Entering directory '/home/apm/artiq_dev/artiq_kasli/apm/software'
        make -C /home/apm/artiq_dev/artiq_kasli/apm/software/bootloader CPU=vexriscv
        make[1]: Entering directory '/home/apm/artiq_dev/artiq_kasli/apm/software/bootloader'
         CARGO    cargo/riscv32ima-unknown-none-elf/debug/libbootloader.a
           Compiling compiler_builtins v0.1.49
           Compiling core v0.0.0 (/nix/store/9mdvhwhbgi44kgh97xyib5jfpdlyi6q8-rust-default-1.56.0-nightly-2021-09-01/lib/rustlib/src/rust/library/core)
           Compiling memchr v2.4.1
           Compiling semver-parser v0.7.0
           Compiling regex-syntax v0.6.29
           Compiling build_misoc v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libbuild_misoc)
           Compiling lazy_static v1.4.0
           Compiling build_const v0.2.2
           Compiling cc v1.0.69
           Compiling semver v0.9.0
           Compiling bootloader v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/bootloader)
           Compiling crc v1.8.1
           Compiling rustc_version v0.2.3
           Compiling bare-metal v0.2.5
           Compiling board_misoc v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libboard_misoc)
           Compiling aho-corasick v0.7.20
           Compiling regex v1.7.3
           Compiling riscv-target v0.1.2
           Compiling riscv v0.6.0
           Compiling rustc-std-workspace-core v1.99.0 (/nix/store/9mdvhwhbgi44kgh97xyib5jfpdlyi6q8-rust-default-1.56.0-nightly-2021-09-01/lib/rustlib/src/rust/library/rustc-std-workspace-core)
           Compiling alloc v0.0.0 (/nix/store/9mdvhwhbgi44kgh97xyib5jfpdlyi6q8-rust-default-1.56.0-nightly-2021-09-01/lib/rustlib/src/rust/library/alloc)
           Compiling bit_field v0.10.2
           Compiling byteorder v1.4.3
           Compiling managed v0.8.0
           Compiling bitflags v1.3.2
           Compiling smoltcp v0.8.2
        error: expected expression, found `.`
          --> libboard_misoc/i2c_eeprom.rs:47:13
           |
        47 |             .and_then( |_| {
           |             ^ expected expression
        
        error: could not compile `board_misoc` due to previous error
        warning: build failed, waiting for other jobs to finish...
        error: build failed
        make[1]: *** [Makefile:10: cargo/riscv32ima-unknown-none-elf/debug/libbootloader.a] Error 101
        make[1]: Leaving directory '/home/apm/artiq_dev/artiq_kasli/apm/software/bootloader'
        make: *** [Makefile:2: software] Error 2
        make: Leaving directory '/home/apm/artiq_dev/artiq_kasli/apm/software'
        Command make -C /home/apm/artiq_dev/artiq_kasli/apm/software failed

        Based on this commit ,I modified this section of code in i2c_eeprom.rs

         pub fn read<'a>(&self, addr: u8, buf: &'a mut [u8]) -> Result<(), i2c::Error> {
                self.select()?;
        
                i2c::start(self.busno)?;
                let read_result = i2c::write(self.busno, self.address)
                    .and_then( |_| i2c::write(self.busno, addr))
                    .and_then( |_| i2c::restart(self.busno))
                    .and_then( |_| i2c::write(self.busno, self.address | 1))?;
                    .and_then( |_| {
                        let buf_len = buf.len();
                        for (i, byte) in buf.iter_mut().enumerate() {
                            *byte = i2c::read(self.busno, i < buf_len - 1)?;
                        }
                    });
        
                let stop_result = i2c::stop(self.busno);
        
                read_result.and(stop_result)
            }

        to the following:

        pub fn read<'a>(&self, addr: u8, buf: &'a mut [u8]) -> Result<(), i2c::Error> {
                self.select()?;
        
                i2c::start(self.busno)?;
                i2c::write(self.busno, self.address)?;
                i2c::write(self.busno, addr)?;
               
        	i2c::restart(self.busno)?;
                i2c::write(self.busno, self.address | 1)?;
                let buf_len = buf.len();
                for (i, byte) in buf.iter_mut().enumerate() {
                    *byte = i2c::read(self.busno, i < buf_len - 1)?;
                }
                
                i2c::stop(self.busno)?;
                Ok(())
            }

        Then the creation seems to have been successful:

        make: Entering directory '/home/apm/artiq_dev/artiq_kasli/apm/software'
        make -C /home/apm/artiq_dev/artiq_kasli/apm/software/bootloader CPU=vexriscv
        make[1]: Entering directory '/home/apm/artiq_dev/artiq_kasli/apm/software/bootloader'
         CARGO    cargo/riscv32ima-unknown-none-elf/debug/libruntime.a
           Compiling compiler_builtins v0.1.49
           Compiling core v0.0.0 (/nix/store/9mdvhwhbgi44kgh97xyib5jfpdlyi6q8-rust-default-1.56.0-nightly-2021-09-01/lib/rustlib/src/rust/library/core)
           Compiling memchr v2.4.1
           Compiling semver-parser v0.7.0
           Compiling build_misoc v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libbuild_misoc)
           Compiling regex-syntax v0.6.29
           Compiling unicode-xid v0.0.4
           Compiling lazy_static v1.4.0
           Compiling quote v0.3.15
           Compiling log v0.4.14
           Compiling cc v1.0.69
           Compiling build_const v0.2.2
           Compiling semver v0.9.0
           Compiling board_artiq v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libboard_artiq)
           Compiling runtime v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/runtime)
           Compiling synom v0.11.3
           Compiling crc v1.8.1
           Compiling rustc_version v0.2.3
           Compiling syn v0.11.11
           Compiling board_misoc v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libboard_misoc)
           Compiling bare-metal v0.2.5
           Compiling aho-corasick v0.7.20
           Compiling synstructure v0.6.1
           Compiling regex v1.7.3
           Compiling failure_derive v0.1.1
           Compiling riscv-target v0.1.2
           Compiling rustc-std-workspace-core v1.99.0 (/nix/store/9mdvhwhbgi44kgh97xyib5jfpdlyi6q8-rust-default-1.56.0-nightly-2021-09-01/lib/rustlib/src/rust/library/rustc-std-workspace-core)
           Compiling riscv v0.6.0
           Compiling alloc v0.0.0 (/nix/store/9mdvhwhbgi44kgh97xyib5jfpdlyi6q8-rust-default-1.56.0-nightly-2021-09-01/lib/rustlib/src/rust/library/alloc)
           Compiling byteorder v1.4.3
           Compiling cfg-if v1.0.0
           Compiling bitflags v1.3.2
           Compiling libc v0.1.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libc)
           Compiling cfg-if v0.1.10
           Compiling bit_field v0.10.2
           Compiling managed v0.8.0
           Compiling failure v0.1.1
           Compiling cslice v0.3.0
           Compiling dyld v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libdyld)
           Compiling arrayvec v0.7.4
           Compiling log_buffer v1.2.0
           Compiling fringe v1.2.1 (https://git.m-labs.hk/M-Labs/libfringe.git?rev=53a964#53a964a6)
           Compiling managed v0.7.2
           Compiling alloc_list v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/liballoc_list)
           Compiling unwind v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libunwind)
           Compiling io v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libio)
           Compiling smoltcp v0.8.2
           Compiling eh v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libeh)
           Compiling unwind_backtrace v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libunwind_backtrace)
           Compiling tar-no-std v0.1.8 (https://git.m-labs.hk/M-Labs/tar-no-std?rev=2ab6dc5#2ab6dc58)
           Compiling proto_artiq v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/libproto_artiq)
           Compiling logger_artiq v0.0.0 (/nix/store/i6nqmhzklpzvib2cli040ii8kn1b91ww-python3-3.12.9-env/lib/python3.12/site-packages/artiq/firmware/liblogger_artiq)
            Finished dev [unoptimized + debuginfo] target(s) in 24.03s
         LD       ksupport_data.o
         LD       runtime.elf
         OBJCOPY  runtime.bin
         MSCIMG   runtime.fbi
        make[1]: Leaving directory '/home/apm/artiq_dev/artiq_kasli/apm/software'
        make -C /home/apm/artiq_dev/artiq_kasli/apm/software/libm CPU=vexriscv
        Creating bitmap...
        Creating bitstream...
        Bitstream compression saved 7207584 bits.
        Writing bitstream ./top.bit...
        INFO: [Vivado 12-1842] Bitgen Completed Successfully.
        INFO: [Project 1-1876] WebTalk data collection is mandatory when using a ULT device. To see the specific WebTalk data collected for your design, open the usage_statistics_webtalk.html or usage_statistics_webtalk.xml file in the implementation directory.
        INFO: [Common 17-83] Releasing license: Implementation
        9 Infos, 0 Warnings, 0 Critical Warnings and 0 Errors encountered.
        write_bitstream completed successfully
        write_bitstream: Time (s): cpu = 00:01:07 ; elapsed = 00:00:33 . Memory (MB): peak = 4075.922 ; gain = 134.676 ; free physical = 5421 ; free virtual = 8575
        ## quit

        Additionally, my system version is Ubuntu 22.04.1 LTS. I noticed that Ubuntu needs to have AppArmor disabled or uninstalled from here. I didn't disable it this time and there were no errors. Has this issue been fixed?