Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

In this document, it will demonstrate how to use an USB2.0 / USB3.0 serial gadget as a console.

Table of Contents

Kernel Setup

It is more convenient to adapt precomposed configurations than configfs for the serial gadget console support.

Enter the kernel configuration by running the following command in the top directory of project.

# make kconfig

  1. Select submenus for USB 2.0 controller : Device Drivers > USB support > USB support > USB Gadget Support > USB Peripheral Controller. Select <*> for “Sunplus USB 2.0 Device Controller“.

image-20240624-061527.png

  1. Select submenus for USB 3.0 controller : Device Drivers > USB support > USB support >. Select <*> for “DesignWare USB3 DRD Core Support“ and select “Gadget Only mode“ for “Deware USB3 DRD Core Support“. Note that for USB gadget precomposed configurations, there is only 1 UDC configured as a gadget. Here selecting “Gadget Only mode“ for “DesignWare USB3 DRD Core Support“ will configure USB3 as the serial gadget and selecting “Dual Role mode“ for “DesignWare USB3 DRD Core Support“ will configure USB2 as the serial gadget due to the USB2 and USB3 device drivers probed sequence.

image-20240624-054804.png

  1. Select submenus for USB Gadget procomposed configurations : Device Drivers > USB support > USB support > USB Gadget Support > USB Gadget precomposed configurations. Select <*> for “Serial Gadget (with CDC ACM and CDC OBEX support)“.

image-20240624-020407.png

  1. Select submenus for USB Gadget Support : Device Drivers > USB support > USB support . Select <*> for “Serial gadget console support“.

image-20240624-021719.png
  1. Modify the environment variable b_c configurations to “b_c=console=ttyGS0,115200 earlycon\0“ in boot\uboot\include\configfs\pentagram_common_sp7350.h.

image-20240624-022848.png

  1. Execute the make command to build the Linux image.

Implementing Serial gadget console

Take USB2.0 serial gadget for example.

  1. Update the image and boot the system, the kernel messages will stop when “printk: console [ttyGS0] enabled“ and “printk: bootconsole [sunplus_uart0] disabled“. Here sunplus_uart0 is COM4.

image-20240624-063941.png

  1. Connect the SP7350 platform and a Windows PC with an USB OTG cable, “USB Serial Device (COM8)“ will show up in “Ports (COM & LPT)” of Device Manager.

image-20240624-064908.png

  1. Open Putty in COM8 and it can send text output to the user and receive text input from the user.

image-20240624-065532.png

  • No labels