Introduction
In this training, you will learn how to connect a host computer running a terminal emulation program to the SAM9X60-EK Evaluation Kit to access the target console.
There are two methods to access the target console:
- J-Link CDC serial port
- UART Debug port
The target console (also known as DEBUG, Target Console, Applet Console, or simply Console) is a serial communications port (generally a UART) on the target device that communicates with a terminal emulation program on a host computer. It provides status information from operating systems, such as Linux boot log, and debug information from utility programs, for example, from SAM-BA Applets.
These are the steps to establish serial communication between host and target:
- Choose one of the two ports available for serial communication: J-Link CDC port (J22) or UART Debug port (J24).
- Choose a terminal emulation program for your machine and configure it.
- Connect host to the target.
- Observe RomBOOT on the screen. Serial communication is established.
Pre-requisites
Be familiar with the features of the SAM9X60-EK evaluation kit.
J-Link CDC Serial Port (J22)
The J-Link CDC serial port (J22) of the SAM9X60 evaluation kit provides a debugging interface using the SEGGER J-Link-OnBoard debugger. Microcontroller U27 provides a JTAG interface to the debugger.
When the J-Link debugger is not in use, microcontroller U27 provides USB CDC class serial communications between the SAM9X60-EK UART and micro-B USB connector J22.
When the host computer is connected to J22 of the evaluation kit, the SAM9X60-EK will enumerate as a CDC class device. A terminal emulation program running on a host computer provides a user interface to interact with the target console.
UART Debug Port (J24)
The SAM9X60-Evaluation kit features a dedicated serial port for debugging. This is accessible through the Debug header J24. Various interfaces can be used such as FTDI TTL-232-R USB-to-TTL serial cable.
The J24 header is a 6-pin male header suitable for FTDI-based cables.
Terminal Emulation Program
Download, install, and configure a Terminal Emulation program onto your host computer. There are several choices for terminal programs for Windows, macOS®, and Linux. Below is a list of popular programs. Many are free to download and a few are included with the operating system or distributions.
Windows
To locate the COM port, open the Windows Device Manager and expand Ports (COM & LPT).
Port J22:
When connecting a USB Micro-B connecter to port J22, look for JLink CDC UART Port and note the COM port number. You will use this to configure the terminal emulator. You will also need to set:
- Baud: 115200
- Data Bits: 8
- Parity: None
- Stop Bits: 1
Port J24:
When connecting a USB-FTDI cable to port J24, look for USB Serial Port (COM) and note the COM port number. You will use this to configure the terminal emulator. You will also need to set:
- Baud: 115200
- Data Bits: 8
- Parity: None
- Stop Bits: 1
macOS
- Screen
- Find the serial port: $ ls /dev/tty.*
- To run: $ screen /dev/tty.usbmodemFD121 115200
- To quit: $ Control-a $ Control-\
- Minicom
- Serial
- Available from the Apple App Store
- CoolTerm
Open the CoolTerm application and note the ports that are available in the Port selection. You will also need to set:
- Baud: 115200
- Data Bits: 8
- Parity: None
- Stop Bits: 1
Linux
- minicom
- PuTTY
- You can install minicom and putty from the command line. $ sudo apt-get install putty
- You will need to set:
- Baud: 115200
- Data Bits: 8
- Parity: None
- Stop Bits: 1
To find the USB port, execute dmesg on the command line:
Port 22
$ dmesg
usb 3-1: New USB device found, idVendor=1366, idProduct=0105
usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-1: Product: J-Link
usb 3-1: Manufacturer: SEGGER
usb 3-1: SerialNumber: 000483029459
cdc_acm 3-1:1.0: ttyACM0: USB ACM device
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Port 24
$ dmesg
usb 1-3: New USB device found, idVendor=0403, idProduct=6001
usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-3: Product: TTL232R-3V3
usb 1-3: Manufacturer: FTDI
usb 1-3: SerialNumber: FTFXZ39X
ftdi_sio 1-3:1.0: FTDI USB Serial Device converter detected
usb 1-3: Detected FT232RL
usb 1-3: FTDI USB Serial Device converter now attached to ttyUSB0
If you are not able to access the serial port, try adding the user to dialout group. This will give the user access to USB ports under the dialout group.
$ sudo adduser user_name dialout
Connecting Host to Target
Connect to port J22:
Power up the evaluation kit by connecting a 5VDC external power supply to J1 -or- you can apply power by connecting a micro USB cable to J7. Connect the host PC to the J-Link CDC serial port (J22) using a USB Micro-B connector. The host PC will enumerate as a CDC Class device.
If there is no SD Memory Card installed, the J-Link Onboard LED (D9) will flash green and the RGB LED (LD1) will flash red.
If SD Memory Card with a Linux image installed, the RGB LED (LD1) will flash blue indicating proper operation of the Linux Operating System.
Connect to port J24:
Power up the evaluation kit by connecting a 5VDC external power supply to J1 -or- you can apply power by connecting a micro USB cable to J7. Connect the host PC to the Serial UART Debug port J24 using a FTDI-based cable
The black wire of the FTDI cable goes to the GND of port J24.
If there is no SD Memory Card installed, RGB LED (LD1) will flash red.
If SD Memory Card with a Linux image installed, the RGB LED (LD1) will flash blue indicating proper operation of the Linux Operating System.
Serial Communication Established
Once you connect the Host PC to your target, open the terminal emulation program with its serial settings configured. Press the Reset Button (SW3) on the SAM9X60-EK.
On the terminal emulation screen, you will see RomBOOT indicating the first-stage bootloader did not find an image to load and the SAM-BA Monitor is running and awaiting a command.
Congratulations! Serial communication is successfully established.
Booting a Linux Image
The J-Link CDC or UART Debug serial port are used as the Linux Console when booting a Linux Image. For more information, see the following topics:
Summary
The J-Link CDC and UART Debug serial port are serial communications port for the Target Console. The serial port communicates with a host computer running a terminal emulation program. The Console provides status information from Operating Systems, such as Linux, and debug information from utility programs (for example, from SAM-BA Applets). This facilitates users in programming and debugging.