4.2.1.2. Setting up the serial console

The debug console can be used to follow the boot process:

  1. FSBL (if debug mode is enabled)

    The serial console can also be used to see the output of other bare metal applications, for example, the memory test.

  2. U-Boot

    During the boot process, U-Boot will show status and debug information.

    After FSBL starts U-Boot, there is a 3-second delay before U-Boot starts the Linux kernel. If during this time a key is pressed, U-boot will stop the boot process and give the user access to its shell.

  3. Linux console

    During the boot process, Linux will show status and debug information.

    When systemd reaches multi-user.target a login prompt will appear.

    User name: root Password: root

4.2.1.2.1. Hardware setup

Here is a list of additional hardware you will need to set up the serial console:

  • All STEMlab 125-14 and SDRlab 122-16 models - USB to micro USB cable.

  • SIGNALlab 250-12 - USB to USB-C cable

  • STEMlab 125-10 - serial to USB adapter (the pins must first be soldered onto the board)

The following instructions are written for the STEMlab 125-14. For other boards, the procedure is the same, but the cable connection may differ.

../../../../_images/console-connector.png

Connect your Red Pitaya and PC with a micro USB to USB-A cable and follow the instructions for your OS.

../../../../_images/pitaya-USB-connection-300x164.png

4.2.1.2.2. Software requirements

4.2.1.2.2.1. Windows

Download and install the FTDI driver on your PC. After installation, a new COM port will appear in the Device Manager, which you can use in Hyperterminal or another terminal utility to connect to Red Pitaya. Connect your Red Pitaya to the micro USB port on the board. In your terminal utility, fill in the serial port name and set the speed to 115200.

To adjust the connection settings for serial communication, right-click on the COM port and select Properties.

../../../../_images/device_manager.png
../../../../_images/Comm_port.png

Boot reference must be done through Minicom or a similar serial console application.

One of the options is to install the WSL (Windows Subsystem for Linux) and then install the relevant tools for the console interface (usbipd). Here are the relevant links:

Here is a quick reference guide for using the WSL to connect to the Red Pitaya console:

  1. Open Windows terminal and type wsl to start the Windows Subsystem for Linux (from now on reffered to as WSL terminal). This window will be used to establish the serial console connection.

  2. Open a separate instance of Windows terminal, which we will use for connecting the USB device to the WSL (from now on reffered to as Windows terminal).

  3. In the Windows terminal list all available USB devices. Find the “bus-id” of the Red Pitaya console. It should be listed as USB Serial Converter:

    usbipd list
    
  4. Bind the Red Pitaya console to the WSL.

    usbipd bind --busid <bus-id>
    
  5. Attach the USB serial converter to the WSL.

    usbipd attach --wsl --busid <bus-id>
    

    Here is a visual representation of the commands so far:

    ../../../../_images/windows_terminal_commands.png
  6. In the WSL terminal, list all available USB devices. The Red Pitaya console should be listed as ttyUSB0:

    lsusb
    
    ../../../../_images/wsl_lsusb.png
  7. Continue to the Establishing serial console connection chapter

  8. To disconnect the Red Pitaya console from the WSL, use the following commands in the Windows terminal:

    usbipd detach --busid <bus-id>
    

The full instructions are available on the Connect USB devices page.

4.2.1.2.2.2. Linux and Mac

There is broad support for USB-to-serial converters in the Linux kernel, so in most cases the converter will be detected soon after it is plugged in.

  • Minicom, screen or a similar program for setting up a remote serial console.

4.2.1.2.3. Establishing serial console connection

At this point you should have the Red Pitaya connected to your PC via a USB-to-serial converter and are able to access the Linux terminal either throught the WSL or naturally from the Linux.

Check the driver output in the kernel log using dmesg:

$ dmesg
...
[95074.784075] usb 1-2.4.3: new full-speed USB device number 20 using ehci-pci
[95074.885386] usb 1-2.4.3: New USB device found, idVendor=0403, idProduct=6015
[95074.885399] usb 1-2.4.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[95074.885406] usb 1-2.4.3: Product: FT231X USB UART
[95074.885411] usb 1-2.4.3: Manufacturer: FTDI
[95074.885416] usb 1-2.4.3: SerialNumber: DN003P0Q
[95074.890105] ftdi_sio 1-2.4.3:1.0: FTDI USB Serial Device converter detected
[95074.890228] usb 1-2.4.3: Detected FT-X
[95074.891157] usb 1-2.4.3: FTDI USB Serial Device converter now attached to ttyUSB0

The first Red Pitaya board connected to your PC will create a device named /dev/ttyUSB0. If N USB or serial devices are connected, they will appear as /dev/ttyUSBn, where n is {0, 1, …, N-1}. To access these devices, programs should be run with sudo.

Minicom or a similar serial console application must be used to view the boot reference log.

4.2.1.2.3.1. minicom

Minicom is a text-based modem control and terminal emulation program. It is commonly used for setting up a remote serial console.

To configure minicom use the -s option.

sudo minicom -s

A configuration menu will open.

+-----[configuration]------+
| Filenames and paths      |
| File transfer protocols  |
| Serial port setup        |
| Modem and dialing        |
| Screen and keyboard      |
| Save setup as dfl        |
| Save setup as..          |
| Exit                     |
| Exit from Minicom        |
+--------------------------+

Go to Serial Port Setup, press Enter, and set up the next options:

  • Serial Device: /dev/ttyUSB0 (device index 0 or a higher number)

  • Bps/Par/Bits: 115200 8N1 (baud rate, byte length, parity, and stop bits)

  • Hardware/Software Flow Control: No (flow control should be disabled)

+-----------------------------------------------------------------------+
| A -    Serial Device      : /dev/ttyUSB0                              |
| B - Lockfile Location     : /var/lock                                 |
| C -   Callin Program      :                                           |
| D -  Callout Program      :                                           |
| E -    Bps/Par/Bits       : 115200 8N1                                |
| F - Hardware Flow Control : No                                        |
| G - Software Flow Control : No                                        |
|                                                                       |
|    Change which setting?                                              |
+-----------------------------------------------------------------------+

Minicom requires some special Control+A key sequences to operate. The most common commands you will need are:

  • Control+A followed by X to exit Minicom

  • Control+A followed by Z to open the help menu

Please see the Minicom manual for details.

After you have configured the details, exit the settings. At this point Minicom should be connected to your Red Pitaya:

../../../../_images/Minicom_connected.png

If you are asked to log in into the Red Pitaya, please use the following credentials:

  • User name: root

  • Password: root

Leave the Minicom open and unplug Red Pitaya from power. After plugging it back in, you should see the boot sequence for Red Pitaya.

At the begginning of the boot sequence, you can press any key to stop the autoboot process and enter the Zynq U-Boot shell. This is useful for debugging and changing the boot parameters.

../../../../_images/Minicom_zynq_boot.png

If you are not able to see the boot sequence, please check the connection between the Red Pitaya and your PC, and the settings in Minicom.

4.2.1.2.3.2. screen

GNU screen is, in general, a terminal multiplexer. It also supports connecting to a serial console and provides syntax to configure the serial connection’s baud rate, byte length, parity, and flow control.

Compared to Minicom, it provides better fonts and support for terminal window resizing.

$ sudo screen /dev/ttyUSB1 115200 cs8

Similar to Minicom, screen requires some special Control+A key sequences to operate. Please see the screen manual for details.

The configuration is the same as for Minicom. Please refer to the previous section for details.

4.2.1.2.4. Reference boot sequence

You can compare these reference boot sequences against yours.

4.2.1.2.4.1. U-Boot

U-Boot 2016.01 (Nov 16 2016 - 12:23:28 +0100), Build: jenkins-redpitaya-master-156

Model: Red Pitaya Board
Board: Xilinx Zynq
I2C:   ready
DRAM:  ECC disabled 480 MiB
I2C:EEPROM selection failed
MMC:   sdhci@e0100000: 0
In:    serial@e0000000
Out:   serial@e0000000
Err:   serial@e0000000
Model: Red Pitaya Board
Board: Xilinx Zynq
Net:   ZYNQ GEM: e000b000, phyaddr 1, interface rgmii-id
eth0: ethernet@e000b000
Hit any key to stop autoboot:  0
Running script from SD...
Device: sdhci@e0100000
Manufacturer ID: 19
OEM: 4459
Name: 00000
Tran Speed: 25000000
Rd Block Len: 512
SD version 1.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading u-boot.scr
1203 bytes read in 17 ms (68.4 KiB/s)
## Executing script at 02000000
Set devicetree and ramdisk high loading address to 0x20000000
Loading from SD card (FAT file system) to memory
Device: sdhci@e0100000
Manufacturer ID: 19
OEM: 4459
Name: 00000
Tran Speed: 25000000
Rd Block Len: 512
SD version 1.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading u-boot.scr
1203 bytes read in 17 ms (68.4 KiB/s)
## Executing script at 02000000
Set devicetree and ramdisk high loading address to 0x20000000
Loading from SD card (FAT file system) to memory
Device: sdhci@e0100000
Manufacturer ID: 19
OEM: 4459
Name: 00000
Tran Speed: 25000000
Rd Block Len: 512
SD version 1.0
High Capacity: Yes
Capacity: 3.7 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uImage
4590664 bytes read in 404 ms (10.8 MiB/s)
reading devicetree.dtb
17342 bytes read in 19 ms (890.6 KiB/s)
Booting Linux kernel with ramdisk and devicetree
## Booting kernel from Legacy Image at 02004000 ...
   Image Name:   Linux-4.4.0-xilinx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4590600 Bytes = 4.4 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 04000000
   Booting using the fdt blob at 0x4000000
   Loading Kernel Image ... OK
   Loading Device Tree to 1d33c000, end 1d3433bd ... OK

4.2.1.2.5. FAQ

4.2.1.2.5.1. I cannot see the boot sequence on the serial console.

  1. Make sure that the serial console is connected to the correct port and that the baud rate is set to 115200.

  2. Check whether the FTDI drivers for Windows are installed correctly.

  3. Check the status LEDs on Red Pitaya:

    • If the green and blue LEDs are ON and the other status LEDs are working correctly, unplug the power and repower the board. If the issue persists, please double-check the serial console instructions above or use a different cabel.

    • If the green LED is ON, but no other LEDs are visible, this means that the boot process is stuck:

      • Please check whether the Red Pitaya OS is installed on the SD card.

      • If the OS is installed correctly and the boot log is not visible, the Zynq SoC might be damaged. In this case, please contact Red Pitaya support (support@redpitaya.com). If the board is still under warranty, we will replace it.

    • If the green LED is OFF, please check whether the power supply is connected and working correctly. If the power supply is good, then the board might be damaged.