SAMA7G54-EK – Console Serial Communications
Contents
Introduction
In this training topic, you will learn how to connect a host computer running a terminal emulation program to the SAMA7G54 Serial Port on the SAMA7G54-EK Evaluation Kit to view the console.
There are two methods to access the target console:
- J-Link CDC (J24)
- Serial Debug (J20)
The target console (also known as DEBUG, Device console, Target Console, Applet Console, or simply Console) is a serial communications port (generally a Universal Asynchronous Receiver Transmitter (UART)) on the target device (thus the term Target Console or Device Console) 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 such as SAM-BA® applets.
What you will need:
- SAMA7G54-EK Evaluation Kit
- Personal computer (Windows®, macOS®, Linux) running a terminal emulation program
- If you will use the J-Link CDC (J24) port, you will need a Micro-B USB cable (included)
- If you will use the Serial Debug (J20) port, you will need a USB-to-Serial (3.3 or 5 VDC) TTL Level adapter with a 6-pin single-in-line 0.1” pitch connector
- To power the SAMA7G54-EK you will either:
- Connect a Micro-B USB cable to the USB-A port (J7) (included)
- Connect an external 5 VDC power supply to J1
Prerequisites
- Familiarity with the features of the SAMA7G54-EK Evaluation Kit
- Knowledgeable of the SAMA7G5 Series Boot Process
SAMA7G54 Serial Port
The SAMA7G54 MPU serial port on the SAMA7G54-EK is hardwired to I/O pins PD16 (DBGU_TX) and PD17 (DBGU_RX). The serial port is accessible via either the J-Link CDC USB Port (J24) or the Serial Debug Port (J20). Details of both are mentioned below.
The choice of console serial port is chosen during the boot process. The Boot Configuration Packet selects the FLEXCOMn serial (UART) port and input/output pins (IOSET). By default, FLEXCOM3 IOSET 5 is selected.
J-Link CDC Serial Port (J24)
The J-Link CDC USB Port (J24) provides a virtual COM port using the Segger J-Link On-Board (OB) + CDC Debug Probe. The ATSAM3U (U26) microcontroller provides USB CDC class serial communications between the SAMA7G54 serial port and Micro-B USB connector J24.
When the host computer is connected to J24, the SAMA7G54-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.
Serial Debug Port (J20)
The Serial Debug (J20) port is a TTL-level serial port connection between the SAMA7G54 and J20. A level shifter (U23) allows either 3.3 or 5 VDC levels. To interface between J20 and the host computer, you will need a USB-to-Serial (3.3 or 5 VDC) TTL level adapter with a 6-pin single-in-line 0.1” pitch connector.
A terminal emulation program running on a host computer provides a user interface to interact with the target console.
Terminal Emulation
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 and LPT).
J-Link CDC Serial Port (J24)
When connecting a USB Micro-B connector to port J24, 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
Serial Debug Port (J20)
When connecting a USB-to-Serial (3.3 or 5 VDC) TTL level adapter to port J20, 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
- Perform an Internet search: “minicom for macOS”
- Serial
- Available from the Apple App Store
- CoolTerm
To locate the serial port, you can open the CoolTerm application and note the available 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:
J-Link CDC Serial Port (J24)
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
Serial Debug Port (J20)
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
Note the USB port with the Product ID of J-Link. The device will be enumerated as a USB ACM device.
Connecting Host to Target
J-Link CDC Serial Port (J24)
Power up the SAMA7G54-EK by connecting either a 5 VDC external power supply to J1 -or- you can apply power by connecting a micro-USB cable to USB-A Port (J7). Connect the host PC to the J-Link CDC serial port (J24) using a USB Micro-B connector. The host PC will enumerate as a CDC Class device.
Serial Debug Port (J20)
Power up the SAMA7G54-EK by connecting either a 5 VDC external power supply to J1 -or- you can apply power by connecting a micro-USB cable to USB-A Port (J7). Connect the host PC to the Serial UART Debug port J20 using a USB-to-Serial (3.3 or 5 VDC) TTL level adapter with a 6-pin single-in-line 0.1” pitch connector.
Serial Communication Established
Once you connect the Host PC to your target, open the terminal emulation program with its serial settings configured. Press the nRST (Reset) Button (SW2) on the SAMA7G54-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.
Booting a Linux Image
The J-Link CDC or Serial Port is used as the Linux Console when booting a Linux Image. For more information, see the "SAMA7G54-EK – Booting Demo Linux Image" page.
Summary
In this training, you learned how to connect a host computer running a terminal emulation program to the SAMA7G54-EK Evaluation Kit serial port to access the console. 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.