I'm trying to test out ARTIQ9 with NAC3 on a spare Kasli crate we have, and I have the master/dashboard/moninj working and talking to the crate. I haven't been able to run any experiments, which I assumed was because I hadn't updated the gateware. I followed the instructions at https://m-labs.hk/artiq/manual-beta/building_developing.html and seemingly successfully built gateware using the nix develop git+https://github.com/m-labs/artiq.git?ref=nac3#boards shell. However, when trying to flash the gateware using the same shell, either via USB or the network, I get these errors:
USB:

artiq_coremgmt --device-db device_db_stringer_template.py log
Traceback (most recent call last):
  File "/nix/store/br51k771w5mfhy93h2whxhar8qbd34fw-python3.12-artiq-10.9641+f3d3584.beta/bin/.artiq_coremgmt-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/frontend/artiq_coremgmt.py", line 144, in main
    print(mgmt.get_log(), end="")
          ^^^^^^^^^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 138, in get_log
    self._read_expect(Reply.LogContent)
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 119, in _read_expect
    header = self._read_header()
             ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 113, in _read_header
    ty = Reply(*struct.unpack("B", self._read(1)))
                                   ^^^^^^^^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 108, in _read
    raise ConnectionResetError("Connection closed")
ConnectionResetError: Connection closed

Network:

artiq_coremgmt -D 169.254.15.15 flash --srcbuild artiq_kasli/mitll_stringer
Design: top;COMPRESS=TRUE;UserID=FFFFFFFF;Version=2024.2
Part name: 7a100tfgg484
Date: 2025/05/30
Time: 19:39:00
Bitstream payload length: 0x2bd2d0
Traceback (most recent call last):
  File "/nix/store/br51k771w5mfhy93h2whxhar8qbd34fw-python3.12-artiq-10.9641+f3d3584.beta/bin/.artiq_coremgmt-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/frontend/artiq_coremgmt.py", line 196, in main
    mgmt.flash(bins)
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 219, in flash
    self._write_bytes(image_buf.getvalue())
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 98, in _write_bytes
    self._write(value)
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 82, in _write
    self.socket.sendall(data)
TimeoutError: [Errno 110] Connection timed out

I also cannot access the core log files:

artiq_coremgmt --device-db device_db_stringer_template.py log
Traceback (most recent call last):
  File "/nix/store/br51k771w5mfhy93h2whxhar8qbd34fw-python3.12-artiq-10.9641+f3d3584.beta/bin/.artiq_coremgmt-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/frontend/artiq_coremgmt.py", line 144, in main
    print(mgmt.get_log(), end="")
          ^^^^^^^^^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 138, in get_log
    self._read_expect(Reply.LogContent)
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 119, in _read_expect
    header = self._read_header()
             ^^^^^^^^^^^^^^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 113, in _read_header
    ty = Reply(*struct.unpack("B", self._read(1)))
                                   ^^^^^^^^^^^^^
  File "/nix/store/9k1jb20bflfxj0s0h0b0pnq809jfqp2j-python3-3.12.10-env/lib/python3.12/site-packages/artiq/coredevice/comm_mgmt.py", line 108, in _read
    raise ConnectionResetError("Connection closed")
ConnectionResetError: Connection closed

I am able to ping the crate, and when I change TTLs via the dashboard moninj they act like expected. Why is the gateware flashing failing, and why can't I access the logs? I attempted to upload the device_db python file and system description json file I used to generate the gateware, but it would not let me. I'm happy to post snippets if they would be useful.

Flashing via coremgmt is a new feature in ARTIQ 9. ARTIQ 8 does not support it.

The implication is: You cannot upgrade from 8 to 9 with this method. You must use other methods like artiq_flash to flash the ARTIQ 9 binaries for the first time/from other ARTIQ versions.

coremgmt protocol was also changed in ARTIQ 9 to implement remote coremgmt. Please make sure both your ARTIQ software and binaries are built using the same source. I guess you haven't successfully flashed the ARTIQ 9 binaries at this moment?

Thanks, that was it! I just needed to use artiq_flash because the crate had ARTIQ 7 gateware on it.