# UART Logs

Used for network, booting, and most other issues debugging.

## How to get them

First, connect your Kasli/SoC to the PC with a data micro-USB cable. Once you turn on the device, wait at least 15 seconds
until its fully loaded.

### Development shell

1. `flterm /dev/ttyUSBX`, where `X` is usually third (index 2) from suggested variants.
2. Restart the device with `artiq_flash start`
3. If it didn't work, try all of `/dev/ttyUSBX`, and restart the device

### Older Nix and other Linuxes

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)
4. If it didn't work, try all of `/dev/ttyUSBX`, and restart the device

### Windows

While Windows 11 tested to be working out-of-the box with both UART and flashing, Windows 10 may need additional drivers
manipulations, as shown below.

#### Drivers

Use following instructions to set correct drivers for the COM ports.
At choosing FTDI drivers stage you may have longer list of drivers. 
In that case, choose respective `USB Serial Converter X` (A for 0, B for 1, C for 2, D for 3) driver. In case you cannot
locate the devices, they may appear in the _Other devices_ section:
![other_devices_section.png](../img/win32/other_devices_section.png)
You may also need to reboot your PC after doing this.

1. ![com_driver_set0.png](../img/win32/com_driver_set0.png)
2. ![com_driver_set1.png](../img/win32/com_driver_set1.png)
3. ![com_driver_set2.png](../img/win32/com_driver_set2.png)
4. ![com_driver_set3.png](../img/win32/com_driver_set3.png)
5. ![com_driver_set4.png](../img/win32/com_driver_set4.png)
6. ![com_driver_set5.png](../img/win32/com_driver_set5.png)
7. ![com_driver_set6.png](../img/win32/com_driver_set6.png)

If you are here after [flashing firmware](flashing_firmware.md) stage, you may fail to see the devices in the described locations.
If you see them in the `Universal Serial Bus devices` section, you may need just to uninstall the third _Quad_ device and reconnect the
Kasli/Kasli-SoC to the PC.

#### Connecting with PuTTY

1. Enable options shown on picture:
   ![putty_lfcr.png](../img/win32/putty_lfcr.png)
2. Be aware of these options:
   ![putty_com_settings.png](../img/win32/putty_com_settings.png)
3. Connect to every COM port you find on connecting the device (usually connecting the the third port is enough)
4. Restart the device with `artiq_flash start`, or by power-cycling it (wait 30 seconds before turning on)
5. See which COM port produces meaningful output and close others :)