# Introduction
This guide demonstrates how to quickly start Linux and the out-of-box Edge AI demos on the
AM62A starter kit (SK) evaluation module (EVM). This can be done from any PC platform (Windows, Linux or macOS).
# Hardware Setup
In addition to the AM62A starter kit itself, the following hardware is needed:
* USB Type-C 5V - 15V and 3A power supply
* Micro-SD card reader
* Micro-SD card (8GB or larger recommended)
* USB Micro-B cable for UART serial communication
* HDMI display and HDMI cable (needed for running out-of-box Edge AI demos)
* USB mouse (needed for running out-of-box Edge AI demo)
Please refer to the [AM62A starter kit](https://www.ti.com/tool/SK-AM62A-LP) for detailed information
about the EVM. The figure below shows the basic hardware setup:
![Alt Text - AM62Ax EVM setup](./images/am62ax/am62ax_sk_evm_setup.jpg)
[[b! USB Type-C Ports
There are 2 USB Type-C ports on the EVM. The one next to the USB Micro-B port is marked as
"Type-C DRP" and can be used for data communication and power supply. The other one is marked
as "Type-C PWR" and is only used for power supply.
]]
The simplest way to run Linux on the starter kit is through a Micro-SD card. For that, the EVM will need to be
configured for SD card boot. Refer to the [AM62A Starter Kit User's Guide](https://www.ti.com/tool/SK-AM62A-LP) for
detailed information about boot mode configurations. For quick reference, the figure below shows the
boot mode switch setting for SD card boot.
![Alt Text - AM62Ax SK EVM SD card boot mode](./images/am62ax/am62ax_sk_evm_sdcard_boot_mode.jpg)
# Software Setup
To boot Linux through an SD card, a Linux bootable SD card needs to be created. For that,
a Linux WIC image and an image writing utility are needed.
### Getting the AM62A Linux WIC Image
Go to [Processor-SDK download page](https://www.ti.com/tool/PROCESSOR-SDK-AM62A). Click "Downloads" and
then choose PROCESSOR-SDK-LINUX-AM62A. Click "Download options"
and then in the pop-up window download the WIC image tisdk-edgeai-image-am62axx-evm.wic.xz.
### Writing the WIC Image to SD Card
An image writing utility is needed to write the WIC image to an SD card. An open source project,
[balenaEtcher](https://www.balena.io/etcher/), is recommended for this purpose, which works with
Windows, macOS and Linux.
After balenaEtcher is installed, insert a micro SD card into the SD card reader and start Etcher.
Choose the compressed WIC image obtained in previous step, choose the SD card reader as the
target, and then click "Flash". Then Etcher will decompress the image and write it to the SD card,
as shown below.
![Alt Text - balenaEtcher writing SD card](./images/am62ax/SDcard_writing.png)
[[b! For GP or HS-SE device type on a different board than AM62A SK
The AM62A starter kit has the HS-FS device type of AM62A SoC. The WIC image above supports booting
the HS-FS device by default. If a different device type such as GP or HS-SE is used on a different
board than the starter kit, the boot binary needs to be changed after writing the WIC image to the SD card:
1. Replug the SD card reader back into the PC. The boot partition of the SD card should be recognized.
2. In the boot partition, rename tiboot3.bin to tiboot3-default.bin.
3. For GP device, rename tiboot3-am62ax-gp-evm.bin to tiboot3.bin. For HS-SE device, rename tiboot3-am62ax-hs-evm.bin
to tiboot3.bin.
]]
# Establishing a Serial Connection with the EVM
Use a USB Micro-B cable to connect the host PC to the USB Micro-B interface for UART on the EVM, which is right next to the
two USB-C connectors. Open a serial port console on the host PC, according to procedures described below
for Linux, Windows or macOS. When the serial console opens, it will be blank until the EVM powers up.
### Connecting with Linux
1. Determine the serial device names associated with the EVM by running the following command on the Linux PC:
```
dmesg | grep ttyUSB
```
You should see results similar to this:
```
[ 8383.599799] usb 2-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
[ 8383.600472] usb 2-1.3: FTDI USB Serial Device converter now attached to ttyUSB1
[ 8383.600884] usb 2-1.3: FTDI USB Serial Device converter now attached to ttyUSB2
[ 8383.601265] usb 2-1.3: FTDI USB Serial Device converter now attached to ttyUSB3
```
This means the EVM has four serial ports. The first one is to be used for serial communication.
2. Use the following command to open a serial port console:
```
screen /dev/ttyUSB0 115200
```
### Connecting with Windows
1. Open Windows Device Manager and it should show 4 COM ports associated with the EVM, similar to below:
![Alt Text - Windows COM ports](./images/am62ax/windows_com_ports_am62x_sk_evm.jpg)
2. Use a serial terminal emulator such as TeraTerm to connect to the first port. Configure the
serial port setting to 115200 baud rate, 8 bit, no parity, 1 stop bit, no flow control, as shown below:
![Alt Text - serial port setting](./images/am62ax/serial_port_setting.jpg)
### Connecting with MacOS
1. Determine the serial device names associated with the EVM by running the following command:
```
ls /dev/cu*
```
You should see the USB ports listed, similar to below:
```
/dev/cu.usbserial-502111400330
/dev/cu.usbserial-502111400331
/dev/cu.usbserial-502111400332
/dev/cu.usbserial-502111400333
```
This means the EVM has four serial ports. The first one is to be used for serial communication.
3. Use the following command to open a serial port console:
```
screen /dev/cu.usbserial-502111400330 115200
```
# Running Linux and Demos on the EVM
Assuming you have flashed a Micro-SD card with AM62Ax Linux image and connected to the EVM's serial
port on your host PC, you can boot the EVM to Linux now:
1. Insert the Micro-SD card to the EVM (the side of the card with contacts should face upward).
2. Make sure the EVM boot mode switches are set properly for SD card boot as described earlier.
3. Connect the EVM to an HDMI display through an HDMI cable.
4. Connect the USB-C cable from the power adapter to one of the two USB-C ports on the EVM.
5. (Optional) Connect the EVM to a router/switch through an Ethernet cable.
6. The EVM should boot and the booting progress should display in the serial port console. At the end
of booting, the Arago login prompt will appear. Just enter "root" to log in, as shown below:
![Alt Text - Linux log in](./images/am62ax/linux_login_am62ax.jpg)
When the EVM boots to Linux, the Edge AI Gallery Application demo will come up on the HDMI display as shown below:
![Alt Text - Linux log in](./images/am62ax/am62a_oob_demo.jpg).
# Next Steps
After booting the AM62A starter kit to Linux, users are encouraged to explore more through one or more of the following:
* AM62A Edge AI documentation (accessible from the SDK download page) which describes in detail the Edge AI ecosystem, sample apps, deep learning models, dataflows, etc.
* The AM62A academy
which is designed to simplify and accelerate custom embedded development.
* The AM62A design gallery
which hosts various solutions developed by Texas Instruments and third-party hardware and software vendors within the TI Processors ecosystem.
# Troubleshooting
Here we list some common problems which may happen during this exercise and the corresponding solutions:
1. **The EVM doesn't power up and no LEDs are illuminated after connecting the USB-C power cable.**
This is usually caused by not having the right power supply. Please make sure a USB-C power adapter
is used. A USB to USB-C cable will not work.
Please refer to the [AM62A Starter Kit User's Guide](https://www.ti.com/tool/SK-AM62A-LP) for recommended external power supply.
2. **The EVM is connected to the PC, but the PC doesn't recognize the device.**
This may be caused by connecting to the wrong port on the EVM. Please make sure you connect to the
USB Micro-B connector right next to the two USB-C connectors. Please refer to Hardware Setup.
3. **The EVM doesn't boot and the serial console doesn't display anything.**
First, make sure the Micro-SD card is flashed with the right WIC image.
Please refer to Software Setup.
Then double check the EVM boot mode setting and it must be configured for SD card boot.
Please refer to Hardware Setup.
If you encounter any other issues not listed above, you can get help from the
[E2E Processor Forum](https://e2e.ti.com/support/processors-group/processors/f/processors-forum).
It is recommended to first search the forum for similar questions and relevant answers.
If you cannot find any related questions, please ask a new question and provide as much information
as possible such as SDK version, detailed description of the problems, boot log if applicable, etc.