According to Artiq beta manual: Booting over JTAG & ethernet, one must set the boot mode switches SW11 and SW12 to JTAG and put a jumper on the PS_POR_B pins (see physical locations) to boot the Kasli SoC repeatedly via USB and artiq_netboot.

Questions about JTAG boot:

  1. Say SW11 and SW12 are set to JTAG, Kasli SoC has been booted successfully and then there is a sudden electrical power outage (e.g. I pulled the power cord out). Will the Kasli SoC be able to boot on its own once power is restored? Or will I have to connect its USB port to a laptop with the firmware and run local_run.sh as explained in Artiq beta manual: Booting over JTAG & ethernet?
  2. Can Kasli SoC boot via JTAG if no SD card is plugged in?

Questions about SD card boot:

  1. Say SW11 and SW12 are set to SD, a microSD card with a /boot.bin is plugged in and there is a jumper present on the PS_POR_B pins. Can the Kasli SoC boot from SD card while the jumper is on the PS_POR_B pins?
  2. Will artiq_coremgmt config write --file boot ./boot.bin permanently replace the file /boot.bin on the SD card that is plugged into the Kasli SoC?

Comment to M-Labs @sb10q : We'd love to see Support CoreMgmt over DRTIO happen. Can we contribute money-wise? (Shoot me an email!)

    dtsevas

    dtsevas Say SW11 and SW12 are set to JTAG, Kasli SoC has been booted successfully and then there is a sudden electrical power outage (e.g. I pulled the power cord out). Will the Kasli SoC be able to boot on its own once power is restored? Or will I have to connect its USB port to a laptop with the firmware and run local_run.sh as explained in Artiq beta manual: Booting over JTAG & ethernet?

    You will need to run local_run.sh after each power cycle, AFAIK.

    dtsevas Can Kasli SoC boot via JTAG if no SD card is plugged in?

    Yes, but you cannot write IP addr etc to config. I'd recommend at least having an empty SD card installed.

    dtsevas Say SW11 and SW12 are set to SD, a microSD card with a /boot.bin is plugged in and there is a jumper present on the PS_POR_B pins. Can the Kasli SoC boot from SD card while the jumper is on the PS_POR_B pins?

    Yes.

    dtsevas Will artiq_coremgmt config write --file boot ./boot.bin permanently replace the file /boot.bin on the SD card that is plugged into the Kasli SoC?

    Yes, it writes it to the SD card. See libconfig/lib.rs in zynq-rs.

    Hope that helps 🙂.

    Summary written for ourselves on our wiki:

    Booting over JTAG does not persist across power cycles, so new firmware would have to be flashed with artiq-zynq/local_run.sh or artiq-zynq/remote_run.sh after every single power outage. Also, booting over JTAG cannot be combined with booting from SD card because SW11 and SW12 have to be physically flipped on the Kasli SoC board to change boot mode, see BOOT MODE in Kasli SoC PCB layout with highlighted components.

    Conclusion: Booting over JTAG allows fast proto-typing when modifying and testing the firmware but is useless to regular operation in the lab, where persistence across power cycles is required.

    As it currently stands, we only have 2 options to flash our Kasli SoCs:

    1. Kasli SoC master or standalone with a functioning Ethernet connection and with SW11 and SW12 permanently set to SD: artiq_coremgmt config write -f boot [path]/boot.bin + artiq_coremgmt reboot (or power cycle).
    2. Kasli SoC satellite or no functioning Ethernet connection: We have to power down the Kasli SoC, physically disconnect the peripherals' ribbon cables from its EEM slots and physically take the it out of its cassette in our electronics rack, which is very annoying.

    Note: Booting over JTAG could be made useful to regular operation in the lab if:

    In that case, one could go to any Kasli SoC and:

    • set SW11 and SW12 on the front panel to JTAG,
    • boot over JTAG,
    • replace boot.bin on the SD card inside the Kasli SoC via artiq_coremgmt config write -f boot [path]/boot.bin,
    • write a bunch of core config keys & values to /config.txt on the SD card inside the Kasli SoC via artiq_coremgmt config write -s KEY VALUE and,
    • finally, set SW11 and SW12 to SD for regular operation.

    I see no reason why it shouldn't be possible to implement SD card access through JTAG as well on Kasli-SoC.

      rjo You mean copying files onto the SD card via the USB port on the Kasli SoC's front panel while SW11 and SW12 are set to SD? That would be ideal! Do you know if this exists already? Or if there is an open issue or a pull request for it on https://git.m-labs.hk/m-labs/artiq-zynq?

      It would involve using openocd to talk to the sd controller via JTAG. No idea how much of the required infrastructure exists for that already.