SAMA7G54-EK – Console Serial Communications

Last modified by Microchip on 2023/11/27 21:52

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

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. 

Photo of SAMA7G54-EK highlighting debug connections

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. 

For more information, see the "SAMA754 Series Boot Process" page. 

Back to Top

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. 

Jumper J25 must be open to enable serial communications between the SAMA7G54 and ATSAM3U. 

Back to Top

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.  

Take care to align Pin 1 (GND) of the header J20 to the USB-to-Serial adapter Pin 1 (look for an arrow on the connector and a black wire). 

A terminal emulation program running on a host computer provides a user interface to interact with the target console. 

Back to Top

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. 

Back to Top

Windows

To locate the COM port, open the Windows Device Manager and expand Ports (COM and LPT).  

Back to Top

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 

Screen capture of Windows Device Manager for J-Link+CDC

Back to Top

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 

Screen capture of Windows Device Manager for USB Serial

Back to Top

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 

Screen capture of Mac OS CoolTerm

Back to Top

Linux

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: 

Back to Top

J-Link CDC Serial Port (J24)

$ 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 

Back to Top

Serial Debug Port (J20)

$ 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 

Note the USB port with the Product ID of J-Link. The device will be enumerated as a USB ACM device

If you are not able to access the serial port, try adding the user to the dialout group. This will give the user access to USB ports under the dialout group. $ sudo adduser user_name dialout 

Back to Top

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. 

Ensure there is no SD memory card installed. 

Diagram showing the connections between host PC and target for J-Link+CDC

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.  

Take care to align Pin 1 (GND) of the header J20 to the USB-to-Serial adapter Pin 1 (look for an arrow on the connector and a black wire). 

Ensure there is no SD memory card installed. 

Diagram showing the connections between host PC and target for Serial Port

Back to Top

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. 

Screen capture of terminal program showing RomBOOT

Congratulations! Console serial communication is successfully established. 

Back to Top

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.

Back to Top

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. 

Back to Top

Learn More

Back to Top