Astra Yocto Linux用户指南

Overview概述

This document describes the Synaptics Astra Linux OS environment and Board Support Package (BSP). It provides information on the components which make up the BSP and how to interface with them.
本文档介绍Synaptics Astra Linux操作系统环境, 以及板级支持包(BSP)。它提供了关于构成BSP的组件以及如何与它们对接的信息。

Supported Hardware支持的硬件

The following Reference Kits and platforms are covered by this guide:
本指南涵盖以下参考套件和平台:

  • Astra Machina (Foundation) SL1620Astra Machina(Foundation)SL1620

  • Astra Machina (Foundation) SL1640Astra Machina(Foundation)SL1640

  • Astra Machina (Foundation) SL1680Astra Machina(Foundation)SL1680

References参考资料

Introduction介绍

The Synaptics Linux Board Support Package (BSP) contains the software and firmware required to operate Astra Machina. It contains the components needed to boot OSes and interface with the hardware. This guide provides a description of these software components and information on how to interface with them. This document is useful for users who want to evaluate Astra Machina and build products using these processors.
Synaptics Linux板级支持包(BSP)包含操作Astra Machina所需的软件和固件。 它包含启动操作系统和与硬件接口所需的组件。本指南提供了这些软件组件的说明以及如何与它们进行接口的信息。本文对于想要评估Astra Machina并使用这些处理器构建产品的用户非常有用。

This document covers the components which are used by the Linux OS. For instructions on setting up the build environment and creating a Yocto-based image for Astra Machina, please see the Astra Yocto Linux Developer Guide.
本文档涵盖了Linux操作系统使用的组件。 为Astra Machina设置构建环境并基于Yocto创建映像的相关说明,请参阅 Astra Yocto Linux开发人员指南

Specific information about the Astra Machina hardware can be found on the Astra Machina Eval Platform page.
关于Astra Machina硬件的具体信息, 请参阅 Astra Machina评估平台 页面。

Interfacing with Astra MachinaAstra Machina接口

Several methods exist for interfacing with Astra Machina, including using a graphical desktop on an external display. Additionally, Shell access is available through SSH, ADB, and the serial console.
存在几种与Astra Machina交互的方法, 包括在外部显示器上使用图形桌面。此外,可以通过SSH、ADB和串行控制台进行Shell访问。

The Graphical Desktop图形桌面

Astra Machina’s graphical desktop is enabled be default. It can be displayed on an external display connected to the HDMI port or a MIPI display. Input can be provided by connecting a standard HID USB keyboard and mouse.
Astra Machina的图形桌面是默认启用的。 HDMI端口接入的外部显示器或MIPI显示器上可以显示。接入标准的HID USB键盘和鼠标可以输入。

../_images/wayland-desktop.jpg

The Wayland Desktop on Astra Machina


Astra Machina上的Wayland桌面

Clicking on the icon in the top left corner will open a terminal.
点击左上角的图标将打开一个终端。

../_images/wayland-terminal.jpg

The Wayland Desktop with a terminal open


打开终端的Wayland Desktop

Note注意

HDMI is not currently supported on SL1620当前SL1620不支持HDMI

The Shell with SSHSSH Shell

Astra Machina has ssh enabled by default. It will accept connections from ssh clients over the network. Login with the username root. No password is required:
Astra Machina默认启用ssh。 通过网络接受来自ssh客户端的连接。使用root用户名登录。无需密码:

ssh root@10.10.10.100

Note注意

In the examples above the Astra Machina’s address is 10.10.10.100. Please replace this IP with the IP address of your device.
在上面的示例中, Astra Machina的地址是10.10.10.100。请将此IP替换为您的设备IP地址。

The Shell with ADBADB Shell

Astra Machina supports Android Debug Bridge (ADB) over USB. ADB is used on Android devices and has been ported to Astra Machina. Google provides extensive documentation on ADB here.
Astra Machina支持USB上的Android Debug Bridge(ADB)。 ADB应用于Android设备,并已移植到Astra Machina上。谷歌在 这里 提供了大量关于ADB的文档。

To use ADB connect a USB cable from the host system to the USB Type-C USB 2.0 port on Astra Machina (next to the ethernet port).
要使用ADB,请将USB线将主机系统与Astra Machina的USB Type-C USB 2.0端口相连(靠近以太网口)。

../_images/usb-c.png

Astra Machina Component Diagram with USB Type-C USB 2.0 port highlighted


Astra Machina 组件图,红框为USB Type-C USB 2.0端口

Google provides versions of ADB for Mac, Linux, and Windows. Once ADB is installed run adb devices to see all ADB devices connected to the host. Then run:
Google为Mac、Linux和Windows提供了不同版本的ADB。安装ADB后,请运行adb devices以查看连接到主机的所有ADB设备。 然后运行:

adb shell

Or if there is more then one ADB device:或者,如果有多个ADB设备:

adb -s SL16x0 shell
../_images/powershell-adb.png

Using ADB with Windows Powershell


在Windows PowerShell中使用ADB

The Serial Console串行控制台

Astra Machina provides a serial console which displays bootloader and OS messages to a terminal emulator running on the host system. These messages are useful for determining the status of Astra Machina early in the boot process or when a display is not connected. It can also provides useful information during operation. The serial console is also needed during the firmware update process.
Astra Machina提供了一个串行控制台, 用于在运行在主机系统上的终端仿真器上显示来自Bootloader和操作系统的消息。 在启动过程的早期或显示器未连接时,这些消息有助于确定Astra Machina的状态。 它还可以在操作中提供有用的信息。在固件更新过程中,串行控制台也是需要的。

Setting up the Serial Console设置串行控制台

The Astra Machina (Foundation) SL16xx Developer Kits come with a USB-TTL board and a flying-wire style cable. Use the cable to connect the USB-TTL board to Astra Machina’s 40 pin GPIO header.
Astra Machina(Foundation)SL16xx开发套件配有USB-TTL板和飞线式电缆。 使用电缆将USB-TTL板连接到Astra Machina的40针GPIO接头。

USB TTL

Astra Machina

GND

6

RXD

8

TXD

10

../_images/usb-ttl-board.png

USB TTL board provided in Developer Kit


开发套件中提供USB TTL板

../_images/board-ports.png

Astra Machina with 40 GPIO Header labeled


含标注的40 GPIO接头的Astra Machina

../_images/40-pin-connector.png

Astra Machina’s 40 Pin GPIO Header pinout


Astra Machina的40针GPIO接头引脚分配

Windows and Mac hosts will require an additional driver to interface with the USB to UART chip on the USB-TTL board. Please download the appropriate driver for your host from Silicon Labs CP210x USB to UART Bridge VCP Drivers page. Linux hosts generally have support for this chip enabled by default.
Windows和Mac主机与USB-TTL板上的USB转UART芯片的连接需要额外的驱动程序。 请从 Silicon Labs CP210x USB to UART Bridge VCP Drivers 页面下载适用于您的主机的驱动程序。Linux主机通常支持默认启用该芯片。

Once the driver is installed the serial console can be accessed using a terminal emulator program such as Putty, HyperTerminal, Tera Term, Screen, or Minicom.
一旦安装了驱动程序, 串行控制台便可被Putty、HyperTerminal、Tera Term、Screen或Minicom这类的终端仿真程序访问。

../_images/putty.png

Putty terminal emulator on Windows


Windows上的Putty终端仿真器

../_images/configure-minicom.png

Minicon terminal emulator on Mac OS


Mac操作系统上的Minicon终端模拟器

Linux OS LoginLinux操作系统登录

After Linux successfully boots, a login prompt will be displayed in the serial console. To login use the username root. No password is required.
Linux成功启动后, 串行控制台中将显示登录提示。请使用root用户名登录。无需密码。

../_images/login-prompt.png

Successful boot seen in Minicom


在Minicom中看到的启动成功

Multimedia多媒体

The Astra Machina contains hardware and software components which accelerate the processing of multimedia workloads. The Linux BSP provides Gstreamer plugins which allow users to develop programs which utilize these multimedia components to improve multimedia performance. This section provides an overview on how to use the Gstreamer command line interface to build pipelines using these plugins. Information on the Gstreamer framework can be found at https://gstreamer.freedesktop.org/.
Astra Machina包含可加速处理多媒体工作负载的硬件和软件组件。 Linux BSP提供多个Gstreamer插件,用户可应用这些多媒体组件来开发程序以提升多媒体性能的。 本节概述了如何使用Gstreamer命令行界面来应用这些插件构建管道。 有关Gstreamer框架的信息,请访问 https://gstreamer.freedesktop.org/

Gstreamer PluginsGstreamer插件

Gstreamer uses plugin modules which are used to extend Gstreamer functionality. The Astra Machina uses plugins to allow its hardware components to be used in a Gstreamer pipeline. The tables below list plugins which are used by the codecs supported by the Astra Machina.
Gstreamer用插件模块来扩展Gstreamer功能。 Astra Machina用插件来使其硬件组件能被Gstreamer管道使用。 下表格列出了Astra Machina支持的编解码器所用的插件。

Video Codes视频编码

Codec编解码器

Parser Plugin解析器插件

Decoder Plugin解码器插件

Encoder Plugin编码器插件

H.264

h264parseh264parse

v4l2h264decv4l2h264dec

v4l2h264encv4l2h264enc

H.265

h265parseH265Parse

v4l2h265dec

None

VP8

N/A

v4l2vp8dec

v4l2vp8enc

VP9

vp9parsevp9parse

v4l2vp9dec

None

AV1

av1parseav1parse

v4l2av1dec

None

Audio Codecs音频编解码器

Codec编解码器

Parser Plugin解析器插件

Decoder Plugin解码器插件

Encoder Plugin编码器插件

AAC

aacparseaacparse

fdkaacdecfdkaacdec

fdkaacenc

Vorbis

N/A

vorbisdecvorbisdec

vorbisenc

Gstreamer ExamplesGstreamer示例

To run the following Gstreamer examples, please make sure to set the following variables in your environment. These variables may need to be set when running commands from the serial console or a remote shell:
要运行以下Gstreamer示例, 请确保在您的环境中设置以下变量。这些变量可能需要从串行控制台或远程shell运行命令设置:

export XDG_RUNTIME_DIR=/var/run/user/0
export WAYLAND_DISPLAY=wayland-1

The XDG_RUNTIME_DIR variable specifies the directory which contains the Wayland socket belonging to the user. The WAYLAND_DISPLAY variable specifies which Wayland compositor to connect to.
XDG_RUNTIME_DIR 变量指定了 包含属于用户的Wayland套接字的目录。WAYLAND_DISPLAY 变量指定了哪个Wayland合成器被连接。

The following examples use the gst-launch-1.0 command line program to construct a pipeline and begin playing it. The gst-launch-1.0 command takes in a list of element types separated by exclamation points. Elements can also contain optional properties. (see GStreamer documentation for more details). The examples below will show the structure of the command with a brief description. Followed by one or more examples.
以下这些示例,使用gst-launch-1.0命令行程序来构造一个管道并启动播放。 gst-launch-1.0命令接受一个由感叹号分隔的元素类型列表。 这些元素也可含有可选属性。(更多详情,请参阅 GStreamer文档)。 以下示例将显示该命令的结构,提供简要说明,随附一个或多个样例。

Media Playback媒体播放

Audio Sinks音频接收器

The following examples use the ALSA audio sink to output audio using the ALSA audio API (for more details refer to the Gstreamer documentation for more details). The examples use the device hw:0,7 which corresponds to the HDMI output device on SL1680. Hardware devices can be found in the file /proc/asound/pcm. Below is an example of the pcm devices on SL1680. Device 0-7 corresponds to the HDMI device and will be used in the examples below.
以下示例使用ALSA音频接收器通过ALSA音频API来输出音频 (更多详情,请参阅 Gstreamer文档)。 示例所用设备hw:0,7对应于SL1680上的HDMI输出设备。 硬件设备可以在文件/proc/asound/pcm中找到。 下面是SL1680上的pcm设备示例。 Device 0-7对应于HDMI设备,并在下面的示例中使用。

Example /proc/asound/pcm output from SL1680:
示例 SL1680的/proc/asound/pcm输出:

root@sl1680:~# cat /proc/asound/pcm
00-00: soc-i2so1 snd-soc-dummy-dai-0 :  : playback 1
00-01: soc-i2so3 snd-soc-dummy-dai-1 :  : playback 1
00-02: soc-dmic snd-soc-dummy-dai-2 :  : capture 1
00-03: soc-i2si2 snd-soc-dummy-dai-3 :  : capture 1
00-04: btsco-in snd-soc-dummy-dai-4 :  : capture 1
00-05: soc-i2s-pri-lpbk snd-soc-dummy-dai-5 :  : capture 1
00-06: soc-i2s-hdmi-lpbk snd-soc-dummy-dai-6 :  : capture 1
00-07: soc-hdmio snd-soc-dummy-dai-7 :  : playback 1
Video Sinks视频接收器

The following examples use the Wayland video sink to create a window and render the decoded frames (see GStreamer documentation for more details)
下面的示例使用Wayland视频接收器创建一个窗口并渲染解码的帧 (更多详情,请参阅GStreamer文档)。

Audio Playback音频播放

Playing audio files involves reading and parsing the encoded audio data, decoding the data, and outputting it to the audio sink. Some data formats and audio sinks may also need to convert and resample the data before sending it to the audio sink:
播放音频文件涉及读取和解析编码的音频数据, 解码数据,并将其输出到音频接收器。在将数据发送到音频接收器之前,某些数据格式和音频接收器可能还需要对数据做转换和重采样:

gst-launch-1.0 filesrc location=audio_file ! parser ! decoder ! [ convert ] ! [ resample ] ! audiosink

This example plays an MP3 file using the speakers of the attached HDMI device:
此示例使用外接HDMI设备的扬声器来播放MP3文件:

gst-launch-1.0 filesrc location=audio_file.mp3 ! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! alsasink device=hw:0,7

Video Playback视频播放

Playing a video file involves reading the file, demuxing a video stream, parsing the encoded data, and decoding the data using the video decoder. Finally, the decoded frames our output to the video sink:
播放视频文件涉及读取文件、 对视频流进行解复用、解析编码数据、以及使用视频解码器对数据进行解码。 最后,将解码后的帧输出到视频接收器:

gst-launch-1.0 filesrc location=video_file ! demux ! queue ! parser ! decoder ! videosink

The following example plays the main video stream of an MP4 file and displays the video using Wayland. In this example the video is encoded with H265:
以下示例播放MP4文件的主视频流, 并使用Wayland显示视频。本示例中,视频是H265编码的:

gst-launch-1.0 filesrc location=test_file.mp4 ! qtdemux name=demux demux.video_0 ! queue ! h265parse ! v4l2h265dec ! waylandsink fullscreen=true

A similar example, but with a file using AV1 encoding:
类似的示例,但文件采用AV1编码:

gst-launch-1.0 filesrc location=test_file.mp4 ! qtdemux name=demux demux.video_0 ! queue ! av1parse ! v4l2av1dec ! waylandsink fullscreen=true

Audio / Video File Playback音视频文件播放

Playing a file which contains both audio and video streams requires creating a pipeline which parses and decodes both streams:
播放同时包含音频流和视频流的文件, 需要创建解析和解码这两种流的管道:

gst-launch-1.0 filesrc location=test_file.mp4 ! qtdemux name=demux demux.video_0 ! queue ! av1parse ! v4l2av1dec ! waylandsink fullscreen=true

Play an MP4 file with a H265 encoded video stream and an AAC encoded audio stream:
播放带有H265编码的视频流和AAC编码的音频流的MP4文件:

gst-launch-1.0 filesrc location=test_file.mp4  ! qtdemux name=demux \
    demux.video_0 ! queue ! h265parse ! v4l2h265dec ! queue ! waylandsink fullscreen=true \
    demux.audio_0 ! queue ! aacparse ! fdkaacdec ! audioconvert ! alsasink device=hw:0,7

Recording录制

Audio Recording音频录制

Recording audio involves reading data from a capture device like a microphone, converting, encoding, and multiplexing the data before writing it to an output file:
音频录制包括从麦克风等捕获设备读取数据, 对数据进行转换、编码和多路复用后,再写入输出文件:

gst-launch-1.0 -v alsasrc device=device ! queue ! convert ! encode ! mux ! filesink location=output file

The following example records audio from the ALSA capture device 0,2. It then converts the raw data into a format which can encoded into the Vorbis codec by the encoder. Once the data is encoded, it is then multiplexed into an Ogg container and written to the file /tmp/alsasrc.ogg:
以下示例录制来自ALSA捕获设备0,2的音频。 然后编码器将原始数据转换为可被Vorbis编解码器编码的格式。一旦数据被编码,它就被多路复用到Ogg容器中并写入文件/tmp/alsasrc.ogg

gst-launch-1.0 -v alsasrc device=hw:0,2 ! queue ! audioconvert ! vorbisenc ! oggmux ! filesink location=/tmp/alsasrc.ogg

Camera摄像头

Astra Machina supports USB (UVC) cameras with the V4L2 driver stack. This stack can be used with Gstreamer to construct pipelines using a camera.
Astra Machina支持带有V4L2驱动程序栈的USB(UVC)摄像头。 该栈可与Gstreamer一起构建管道来使用摄像头。

To display video captured from a camera to output it to the video sink:
要将摄像头捕获的视频输出到视频接收器, 请执行以下操作:

gst-launch-1.0 v4l2src device=/dev/videoX ! "video data,framerate,format,width,height" ! video sink

The following example reads captured data from the V4L2 device /dev/video2 and applies the capabilities filter before sending the output to the wayland sink:
以下示例从V4L2设备/dev/video2读取捕获的数据, 并在输出到wayland接收器之前应用了多功能过滤器:

gst-launch-1.0 v4l2src device=/dev/video2 ! "video/x-raw,framerate=30/1,format=YUY2,width=640,height=480" ! waylandsink fullscreen=true

Gstreamer Playbin PluginGstreamer Playbin插件

Astra Machina contains the Gstreamer playbin plugin. This plugin can automatically determine what type of pipeline to construct based on automatic file type recognition (see Gstreamer documentation). This simplifies pipeline creation.
Astra Machina包含Gstreamer playbin插件。 该插件可以基于自动文件类型识别来自动确定构建何种类型的管道(参见 Gstreamer文档)。这简化了管道的创建。

Playbin will autodetect the media file located at the specified uri, and create a pipeline for it. It will then display the video on the video sink and render the audio on the audio sink. The video-sink and audio-sink parameters are optional. If the parameters are not included, default video and audio sinks will be used instead:
Playbin将自动检测位于指定uri的媒体文件, 并为其创建管道。然后,它将在视频接收器上显示视频,并在音频接收器上播放音频。 Video-sink和audio-sink的参数是可选的。 如果不带参数,则将使用默认的视频和音频接收器:

gst-launch-1.0 playbin uri=file:///path/to/file video-sink="video sink" audio-sink="audio sink"

Using playbin the example in Audio Sinks can be reduced to:
使用playbin,音频接收器 中的示例可以简化为:

gst-launch-1.0 playbin uri=file:///path/to/file video-sink="waylandsink fullscreen=true" audio-sink="alsasink device=hw:0,7"

GStreamer SyNAP PluginGStreamer SyNAP插件

Astra Machina provides a Gstreamer plugin which allows adding ML processing to Gstreamer pipelines. This plugin uses the SyNAP framework to interface with the hardware accelerators to improve the performance of ML processing. For information on SyNAP see Machine Learning with SyNAP below.
Astra Machina提供了一个Gstreamer插件, 可在Gstreamer管道中添加ML处理。该插件使用SyNAP框架与硬件加速器交互以提高ML处理的性能 ML处理。有关SyNAP的信息,请参阅 使用SyNAP进行机器学习

The SyNAP plugin works as a Gstreamer appsrc and appsink. It takes samples from the pipeline and uses the SyNAP framework to perform classification or detection on the frame using a neural network. It then outputs the results as JSON formatted data.
SyNAP插件可以作为Gstreamer appsrc和appsink。 它从管道中获取样本并使用SyNAP框架,应用神经网络对帧执行分类或检测。然后将结果输出为JSON格式的数据。

We provide a sample application which plays a video while simultaneously performing image classification on the video frames, and then overlaying labels of the results onto the video. A prebuilt version of the application is included in the Astra system image.
我们提供了 示例应用程序, 它在播放视频的同时,对视频帧执行图像分类,然后将结果叠加到视频上。该应用程序的预构建版本已包含在Astra系统映像。

Run the example application using the following command:
使用以下命令运行该示例应用程序:

gst-ai --appmode=IC --input=test_file.mp4 --output=screen --paramfile=/usr/share/gst-ai/ic.json

Machine Learning with SyNAP使用SyNAP进行机器学习

Astra Machina uses the SyNAP framework for execution of neural networks using the platforms hardware accelerators. This framework allows users to run programs which take advantage of the Neural Processing Unit (NPU) and Graphics Processing Unit (GPU) to accelerate the execution of neural networks. (see the SyNAP documentation for more details.)
Astra Machina使用SyNAP框架, 通过平台硬件加速器来执行神经网络。 该框架允许用户运行程序,利用神经处理单元(NPU)和图形处理单元(GPU)来加速神经网络的执行。(更多详情,请参阅 SyNAP文档。)

Connectivity连接

Bluetooth and Wi-Fi are supported on Astra Machina through on-board chip solutions and external hardware. The following table lists the various on-board chips and external solutions:
Astra Machina通过板载芯片解决方案和外部硬件来支持蓝牙和Wi-Fi。 下表列出了各种板载芯片和外部解决方案:

SL ProcessorSL处理器

Wireless Device无线设备

Physical Interface物理接口

(M.2 PCIe / M.2 SDIO)(M.2 PCIe/M.2 SDIO)

Software Information软件信息

SL1620

SYNA 43456

M.2 SDIO

  • wpa_supplicant v3.0 enterprise (excluding 192bit mode)

  • WIFI driver version:


  • wpa_supplicant v3.0企业版(不包括192位模式)

  • WIFI驱动程序版本:

SL1620

SYNA 43711

M.2 SDIO

  • wpa_supplicant v3.0 enterprise (excluding 192bit mode)

  • WIFI driver version:


  • wpa_supplicant v3.0企业版(不包括192位模式)

  • WIFI驱动程序版本:

SL1640

SYNA 43752

M.2 PCIe

  • wpa_supplicant v2.10

  • WIFI driver version: v101.10.478


  • wpa_supplicant v2.10

  • WIFI驱动版本:v101.10.478

SL1640

SYNA 43756E

M.2 PCIe

SL1680

SYNA 43752

M.2 PCIe

SL1680

SYNA 43756E

M.2 PCIe

The Synaptics Astra Linux BSP contains all of the drivers and firmware required to use the 43xxx modules with both PCIe and SDIO interfaces. Wireless network management is handled by the WPA Supplicant daemon which key negotiation with a WPA Authenticator. It supports WEP, WPA, WPA2, and WPA3 authentication standards. ( See wpa_supplicant for more details)
Synaptics Astra Linux BSP包含使用具备PCIe和SDIO接口的43xxx模块所需的所有驱动程序和固件。 无线网络管理由WPA Supplicant守护进程处理,该守护进程与WPA验证器进行密钥协商。它支持WEP、WPA、WPA2和WPA3身份验证标准。 (更多细节,请参阅 wpa_supplicant

Setting up Wifi with WPA Supplicant使用WPA Suppliant设置Wifi

The following section describes how to setup Wifi on Astra Machina using WPA Supplicant.
以下章节介绍在Astra Machina上如何使用WPA Supplicant设置Wifi。

Generate the WPA Pre-shared Key生成WPA预共享密钥

Generating a pre-shared key from a passphrase avoids having to store the passphrase in the WPA Supplicant config file.
从密码短语生成预共享密钥, 可避免将密码短语存储在WPA Supplicant配置文件中。

From the shell, use the wpa_passphrase command line tool to generate a WPA pre-shared key from a passphrase:
在shell中,使用wpa_passphrase命令行工具,从密码短语中生成WPA预共享密钥:

root@sl1680:^# wpa_passphrase network_name 12345678
network={
    ssid="network_name"
    psk=5ba83b0673ea069dafe5d5f1af8216771c13be6ad6f11dac9dc0e90b0c604981
}

Bringing up the WLAN Interface开启WLAN接口

Use ifconfig to instruct the kernel to bring up the wlan interface:
使用ifconfig指示内核开启wlan接口:

ifconfig wlan0 up

Creating the WPA Supplicant Configuration File创建WPA Supplicant配置文件

WPA Supplicant uses a config file to configure the Wifi connection. This configuration file is located in /etc/wpa_supplicant.
WPA Supplicant使用配置文件来配置Wifi连接。这个配置文件位于/etc/wpa_supplicant 中。

Create the /etc/wpa_supplicant directory:
创建/etc/wpa_supplicant目录:

mkdir -p /etc/wpa_supplicant

Create the file /etc/wpa_supplicant/wpa_supplicant-wlan0.conf with options for your Wifi Network.
创建文件/etc/wpa_supplicant/wpa_supplicant-wlan 0.conf,其中包含Wifi网络的选项。

Contents of an example wpa_supplicant-wlan0.conf:
wpa_supplicant-wlan 0.conf示例的内容:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1

network={
    ssid="network_name"
    psk=5ba83b0673ea069dafe5d5f1af8216771c13be6ad6f11dac9dc0e90b0c604981
    key_mgmt=WPA-PSK
    scan_ssid=1
}

Configure systemd-networkd配置systemd-networkd

The wlan interface needs to be enabled in the systemd-networkd system daemon configuration.
wlan接口需要在systemd-networkd系统守护进程配置中启用。

Create the new file /etc/systemd/network/25-wlan.network with the following contents:
创建新文件/etc/systemd/network/25-wlan.network,包含以下内容:

[Match]
Name=wlan0

[Network]
DHCP=ipv4

Enable Wifi Services启用Wifi服务

The network daemons need to be restarted to load the new configuration.
新配置的加载需要重启网络守护进程。

Restart network daemons:重新启动网络守护程序:

systemctl restart systemd-networkd.service
systemctl restart wpa_supplicant@wlan0.service

Enable wpa_supplicant on boot up:在启动时启用wpa_supplicant:

systemctl enable wpa_supplicant@wlan0.service

Performing throughput tests执行吞吐量测试

The following section describes how to run throughput tests using iPerf commands in TCP and UDP modes.
以下部分介绍如何在TCP和UDP模式下使用iPerf命令运行吞吐量测试。

TCP trafficTCP流量

Client Side:客户端:

$ iperf -c <IP address of iperf server> -i 1 -w 12M -t 60 -l 1470

Server side:服务器端:

$ iperf -s -i 1 -w 12M -l 1470

UDP trafficUDP流量

Client side:客户端:

$ iperf -c <IP address of iperf server> -i 1 -w 12M -u -b 1000M -t 60 -l 1470

Server side:服务器端:

$ iperf -s -i 1 -w 12M -l 1470

Using the Bluetooth A2DP source role使用蓝牙A2DP源角色

Searching and connecting to the headset搜索并连接到耳机

First you need to enter the Bluetooth console using the following command:
首先,您需要使用以下命令进入蓝牙控制台:

root@sl1640:~# bluetoothctl
[bluetooth]#

Once in the Bluetooth console you can run various commands to control the Bluetooth stack described in the following paragraphs.
一旦进入蓝牙控制台,您就可以运行各种命令来控制蓝牙协议栈, 如以下段落所述。

You can show information about the Bluetooth controller on the board with the show command:
您可以使用show命令显示主板上蓝牙控制器的信息:

[bluetooth]# show
Controller C0:F5:35:AA:7D:8F (public)
        Name: sl1640
        Alias: sl1640
        Class: 0x00000000
        Powered: no
        Discoverable: no
        DiscoverableTimeout: 0x000000b4
        Pairable: yes
        UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)
        UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
        UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
        UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Device Information        (0000180a-0000-1000-8000-00805f9b34fb)
        Modalias: usb:v1D6Bp0246d0541
        Discovering: no
        Roles: central
        Roles: peripheral
Advertising Features:
        ActiveInstances: 0x00 (0)
        SupportedInstances: 0x06 (6)
        SupportedIncludes: tx-power
        SupportedIncludes: appearance
        SupportedIncludes: local-name
        SupportedSecondaryChannels: 1M
        SupportedSecondaryChannels: 2M
        SupportedSecondaryChannels: Coded

In order to connect to the headset you first need to power on the bluetooth controller:
为了连接到耳机,首先您需要打开蓝牙控制器:

[bluetooth]# power on
[CHG] Controller C0:F5:35:AA:7D:8F Class: 0x00080000
Changing power on succeeded
[CHG] Controller C0:F5:35:AA:7D:8F Powered: yes

You then need to set the controller in pairable mode:
然后,您需要将控制器设置为可配对模式:

[bluetooth]# pairable on
Changing pairable on succeeded

You can then search for the headset (make sure the headset is in discoverable mode):
然后,您可以搜索耳机(请确保耳机处于可发现模式):

[bluetooth]# scan on
Discovery started
[CHG] Controller C0:F5:35:AA:7D:8F Discovering: yes
[NEW] Device 2D:9A:A9:4F:54:37 2D-9A-A9-4F-54-37
[NEW] Device 4E:E7:B0:20:2A:11 4E-E7-B0-20-2A-11
[NEW] Device 7F:84:A3:29:E9:E9 7F-84-A3-29-E9-E9
[NEW] Device 6A:B0:95:7E:58:79 6A-B0-95-7E-58-79
[NEW] Device 7E:4D:8F:C4:3B:6F 7E-4D-8F-C4-3B-6F
[NEW] Device 40:93:CE:4D:F1:8E 40-93-CE-4D-F1-8E
[NEW] Device 47:14:71:A3:79:A9 47-14-71-A3-79-A9
[NEW] Device 67:62:9C:4B:F9:7D 67-62-9C-4B-F9-7D
[NEW] Device 8C:F8:C5:BD:6F:1D DTKBTQ3
[NEW] Device 0A:73:76:09:55:C0 BT208

This command returns the MAC address of all the devices that are currently discoverable. You need to identify the one of the headset you want to pair.
此命令将返回当前连接的所有设备的MAC地址。 您需从中找出您要配对的那副耳机。

Once you found the headset you can pair to it by using the pair command with the MAC address of the headset:
找到该耳机后, 您可以使用带有该耳机MAC地址的pair命令进行耳机配对:

[bluetooth]# pair 0A:73:76:09:55:C0
Attempting to pair with 0A:73:76:09:55:C0
[CHG] Device 0A:73:76:09:55:C0 Connected: yes
[CHG] Device 0A:73:76:09:55:C0 Bonded: yes
[CHG] Device 0A:73:76:09:55:C0 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
[CHG] Device 0A:73:76:09:55:C0 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
[CHG] Device 0A:73:76:09:55:C0 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Device 0A:73:76:09:55:C0 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Device 0A:73:76:09:55:C0 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
[CHG] Device 0A:73:76:09:55:C0 ServicesResolved: yes
[CHG] Device 0A:73:76:09:55:C0 Paired: yes
Pairing successful
[CHG] Device 0A:73:76:09:55:C0 ServicesResolved: no
[CHG] Device 0A:73:76:09:55:C0 Connected: no

The next step is to mark the device as trusted:
下一步,将设备标记为可信:

[bluetooth]# trust 0A:73:76:09:55:C0
[CHG] Device 0A:73:76:09:55:C0 Trusted: yes
Changing 0A:73:76:09:55:C0 trust succeeded

The last step is to setup the connection with the headset:
最后一步,设置与耳机的连接:

[bluetooth]# connect 0A:73:76:09:55:C0
Attempting to connect to 0A:73:76:09:55:C0
[CHG] Device 0A:73:76:09:55:C0 Connected: yes
[NEW] Endpoint /org/bluez/hci0/dev_0A_73_76_09_55_C0/sep1
[NEW] Transport /org/bluez/hci0/dev_0A_73_76_09_55_C0/sep1/fd0
Connection successful
[BT208]# [  286.922414] input: BT208 (AVRCP) as /devices/virtual/input/input1
[CHG] Transport /org/bluez/hci0/dev_0A_73_76_09_55_C0/sep1/fd0 Volume: 0x0060 (96)
[DEL] Device D4:D2:D6:4F:80:60 445HD_BT_60
[CHG] Device 0A:73:76:09:55:C0 ServicesResolved: ye
[BT208]#

If we connection was successful the console prompt will show the name of device we connected to.
如果连接成功,控制台提示符将显示我们连接到的设备的名称。

We can now get the information about the device:
现在,我们可以获取该设备的信息:

[BT208]# info
Device 0A:73:76:09:55:C0 (public)
        Name: BT208
        Alias: BT208
        Class: 0x00240404
        Icon: audio-headset
        Paired: yes
        Bonded: yes
        Trusted: yes
        Blocked: no
        Connected: yes
        LegacyPairing: no
        UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
        UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
        UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
        UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
        RSSI: -69
        TxPower: 4

Playing music to the headset通过耳机播放音乐

In order to test playback you need to upload a sound file (in .wav format) to the board for instance using scp.
为了测试播放, 您需要上传一个声音文件(.wav格式)到板上,比如通过scp

The file can be played to the A2DP sink using the aplay command. The takes as parameter the MAC address of the headeset (in the example below 0A:73:76:09:55:C0) and the name of wave file (in the example below /home/root/example.wav):
可以使用aplay命令将文件播放到A2DP接收器。 其参数有 耳机的MAC地址(以下示例中为0A:73:76:09:55:C0)和wave文件的名称(以下示例中为/home/root/example.wav):

root@sl1640:~# aplay --verbose -D  bluealsa:DEV=0A:73:76:09:55:C0 -t wav /home/root/example.wav
Playing WAVE '/home/root/example.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Plug PCM: BlueALSA PCM: /org/bluealsa/hci0/dev_0A_73_76_09_55_C0/a2dpsrc/sink
BlueALSA BlueZ device: /org/bluez/hci0/dev_0A_73_76_09_55_C0
BlueALSA Bluetooth codec: SBC
Its setup is:
stream       : PLAYBACK
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 48000
exact rate   : 48000 (48000/1)
msbits       : 16
buffer_size  : 24000
period_size  : 6000
period_time  : 125000
tstamp_mode  : NONE
tstamp_type  : GETTIMEOFDAY
period_step  : 1
avail_min    : 6000
period_event : 0
start_threshold  : 24000
stop_threshold   : 24000
silence_threshold: 0
silence_size : 0
boundary     : 6755399441055744000

The Linux Boot ProcessLinux启动过程

Before the Linux Kernel begins executing on Astra Machina, low level firmware and software initializes the hardware and prepares the system for boot. This section provides an overview of the software components which prepare the system for booting the Linux Kernel.
在Linux内核开始在Astra Machina上执行之前, 底层固件和软件会对硬件初始化并准备启动系统。 本节概述了为系统启动Linux内核所准备的软件组件。

Software Overview软件概述

Astra Machina uses a multistage boot process. This section gives a brief description of each component.
Astra Machina使用多级启动过程。 这部分简要描述了每个组件。

Preboot Firmware预引导固件

The Preboot firmware is a collection of low level firmware which initializes specific hardware components and loads the software which runs in the Arm TrustZone environment. Once the Preboot firmware completes, execution will be transferred to the bootloader. The Preboot firmware is provided as binary images which are written to the boot device.
预引导固件是一个底层固件集, 用于初始化特定硬件组件并加载在Arm TrustZone环境中运行的软件。 预引导固件完成后,将跳转到bootloader中去执行。 预引导固件是以 可写入启动设备的二进制映像的方式 提供。

Bootloader

Astra Machina uses the Synaptics U-Boot (SUBoot) bootloader to do additional hardware initialization and to boot the Linux Kernel. SUBoot is based on the open source U-Boot project. (U-Boot Documentation)
Astra Machina使用Synaptics U—Boot(SUBoot) bootloader来执行剩余硬件的初始化,并启动Linux内核。 SUBoot是基于开源项目U—Boot的。(U—Boot文档

Linux Kernel and Device TreeLinux内核和设备树

Astra Machina primarily run OSes which use the Linux Kernel. The Linux Kernel provides the environment in which applications run and it manages resources such as CPU, memory, and devices. Generally, the Linux Kernel will be built as part of the Yocto build process described in the Astra Yocto User Guide.
Astra Machina主要运行使用Linux的操作系统内核。 Linux内核提供应用程序运行的环境,管理CPU、内存和设备等资源。 一般来说,Linux内核将作为《Astra Yocto用户指南》中描述的Yocto构建过程的一部分进行构建。

The Linux Kernel uses Device Tree data structures to describe the hardware components and their configurations on the system. The device tree source files are in the Linux Kernel source tree under that path arch/arm64/boot/dts/synaptics/. These files are maintained in the Astra Linux Kernel Overlay repository
Linux内核使用设备树数据结构来描述系统的硬件组件及配置。 设备树源文件位于Linux内核源代码树中,其路径为 arch/arm64/boot/dts/synaptics/。 这些文件放在 Astra Linux Kernel Overlay repository 中。

Root File System根文件系统

The root file system (rootfs) contains all the user space binaries and libraries needed to execute programs in the Linux OS along with system configuration files. The prebuilt images use Yocto to build the rootfs. Instructions on how to build and configure a rootfs using Yocto can be found in the Astra Yocto Linux Developer Guide.
根文件系统(rootfs)涵盖了Linux操作系统中执行程序所需的所有用户空间二进制文件和库以及系统配置文件。 预构建映像使用Yocto来构建rootfs。 有关如何使用Yocto构建和配置rootfs的说明,请参阅 Astra Yocto Linux开发人员指南

U-BootU—Boot

As mentioned above, Astra Machina uses U-Boot as its bootloader. There are three types of U-Boot which are used with Astra Machina. In addition to SUBoot, there are SPI U-Boot and USB U-Boot variants which are used to flash or recover a device.
如上所述,Astra Machina使用U-Boot作为其bootloader。 Astra Machina使用三种类型的U-Boot。除了SUBoot,还有 SPI U-Boot 和 USB U-Boot 变体,用于闪存或恢复设备。

image type映像类型

image usage映像用法

SPI U-BootSPI U—Boot

burn eMMC image via TFTP server or USB host通过TFTP服务器或USB主机烧录eMMC映像

USB U-BootUSB U-Boot

burn eMMC image via TFTP server of USB disk通过USB磁盘的TFTP服务器烧录eMMC映像

SUBoot

burn eMMC image via TFTP server or USB disk, Booting Linux
通过TFTP服务器或USB磁盘烧录eMMC映像,启动Linux

USB U-Boot and SPI U-Boot are used to boot a device which does not have an image written to the eMMC or to do a update which overwrites all of the contents of the eMMC.
USB U-Boot和SPI U-Boot用于启动eMMC未烧录映像的设备, 或者需要对emmc进行覆盖更新的设备。

USB U-Boot allows the board to receive a copy of the USB version of U-Boot over the USB interface. The host system runs the usb_boot tool to transfer the USB U-Boot image to the board and execute it. Once USB U-Boot is running on the board it can be used to write an image to the eMMC.
USB U-Boot允许板卡通过USB接口接收U-Boot的USB版本。 主机系统运行usb_boot工具来将USB U-Boot映像加载到板上并执行。一旦USB U-Boot在板上运行,可用它将映像文件写入eMMC。

SPI U-Boot is similar to USB U-Boot except that U-Boot runs from SPI flash. The SPI flash may be located on the main board of Astra Machina or it may be a located on a SPI daughter card which is plugged into the device. Once SPI U-Boot is running on the board it can be used to write an image to the eMMC.
SPI U—Boot类似于USB U—Boot, 不同之处在于该U—Boot是运行在SPI闪存上。 SPI闪存可以在Astra Machina的主板上,也可以在设备中所插的SPI子卡上。 一旦SPI U—Boot在板上运行,就可用它将映像文件写入eMMC。

Booting from SPI and SD Cards从SPI和SD卡启动

Astra Machina’s I/O board has a jumper labeled SD-Boot. This jumper controls whether the device boots from the eMMC or the internal SPI flash. If the jumper is attached then the device will boot from the internal SPI flash. Remove the jumper to boot from eMMC.
Astra Machina的I/O板有一个标记为SD-Boot的跳线。 这个jumper控制设备是从eMMC启动还是从内部SPI闪存启动。 如果连上跳线帽,设备将从内部SPI闪存启动。拔掉跳线帽,则从eMMC启动。

../_images/sd-boot-jumper.png

Astra Machina Component Diagram with SD-Boot jumper highlighted


Astra Machina组件图,突出显示SD-Boot跳线

Astra Machina’s internal SPI flash comes preprogrammed with SPI U-Boot. When the SD-Boot jumper is connected the device will either boot from SPI flash or from an SD Card if one is inserted in the SD Card slot.
Astra Machina的内部SPI闪存已预先烧录好SPI U-Boot。 当SD-Boot跳线被连上,设备将从SPI闪存或从SD卡(如果已插入SD卡插槽)启动。

Updating the Firmware更新固件

On power on, Astra Machina will read the firmware, bootloader, and the Linux Kernel from a boot device. The most common boot device is an eMMC device on the board. This section will discuss how to write a boot image to the eMMC.
上电后, Astra Machina将从启动设备中读取固件、bootloader和Linux内核。 最常见的启动设备是板载eMMC设备。 本节将讨论如何将启动映像文件写入eMMC。

The Astra System ImageAstra系统映像

../_images/astra_image.png

A screenshot of the Astra image


Astra映像的屏幕截图

The “Astra System Image” is a directory containing several subimg files and emmc_part_list, emmc_image_list, and emmc_image_list_full. The emmc_part_list describes the GUID Partition Table (GPT) which will be used for the eMMC. The emmc_image_list* files specify which sub image files should be written to which partition on the eMMC.
“Astra系统映像”是一个包含多个subimg文件以及emmc_part_list、emmc_image_list和emmc_image_list_full的目录。 emmc_part_list描述了将被用于eMMC的GUID分区表(GPT)。emmc_image_list*文件则指定哪些子映像文件应被写到emmc上的哪个分区。

Example SL1640 Partition Table:SL1640分区表示例:

Partition name分区名称

Contents内容

Can be removed是否可删除

Accessed by被谁访问

factory_settingfactory_setting

MAC address and other factory provisioned files, used by user space
用户空间使用的MAC地址和其他出厂设置文件

No不可

Linux user spaceLinux用户空间

key_akey_a

AVB keys, user keys (A copy)AVB密钥、用户密钥(A 副本)

Yes是的

Early boot (boot partition)初期启动(boot分区)

tzk_a

TrustZone Kernel (A copy)TrustZone 内核(A 副本)

Yes是的

Early boot (boot partition)初期启动(boot分区)

key_bkey_b

AVB keys, user keys (B copy)AVB秘钥,用户秘钥(B 副本)

Yes是的

Early boot (boot partition)初期启动(boot分区)

tzk_btzk_b

TrustZone Kernel (B copy)TrustZone 内核(B 副本)

Yes是的

Early boot (boot partition)初期启动(boot分区)

bl_abl_a

OEM Boot loader (A copy)OEM启动加载程序(A 副本)

Yes是的

Early boot (boot partition)初期启动(boot分区)

bl_bbl_b

OEM Boot loader (B copy)OEM启动加载程序(B 副本)

Yes是的

Early boot (boot partition)初期启动(boot分区)

boot_aboot_a

Linux Kernel, loaded by OEM bootloader (A copy)
Linux内核,由OEM bootloader加载(A 副本)

No不可

OEM boot loader (bl_a)OEM启动加载程序(bl_a)

boot_bboot_b

Linux Kernel, loaded by OEM bootloader (B copy)
Linux内核,由OEM bootloader加载(B 副本)

No不可

OEM boot loader (bl_b)OEM启动加载程序(bl_b)

firmware_afirmware_a

GPU / DSP / SM firmwares, loaded by early boot, required (A copy)
GPU/DSP/SM固件,由初期启动来加载,必须的(A 副本)

Yes是的

Early boot (boot partition)初期启动(boot分区)

firmware_bfirmware_b

GPU / DSP / SM firmwares, loaded by early boot, required (B copy)
GPU/DSP/SM固件,由初期启动来加载,必须的(B 副本)

Yes是的

Early boot (boot partition)初期启动(boot分区)

rootfs_a

Root file system, used by Linux, can be changed (A copy)
根文件系统,供Linux使用,可更改(A 副本)

No不可

Linux (boot_a)Linux(boot_a)

rootfs_brootfs_b

Root file system, used by Linux, can be changed (B copy)
根文件系统,供Linux使用,可更改(B 副本)

No不可

Linux (boot_b)Linux(boot_b)

fastlogo_a

Fast logo image, loaded by OEM bootloader, can be changed (A copy)
fast logo 映像,由OEM bootloader加载,可更改(A 副本)

No不可

OEM bootloader (bl_a)OEM bootloader(bl_a)

fastlogo_bfastlogo_b

Fast logo image, loaded by OEM bootloader, can be changed (B copy)
fast logo 映像,由OEM bootloader加载,可更改(B 副本)

No不可

OEM bootloader (bl_b)OEM bootloader(bl_b)

devinfodevinfo

Device information (such as serial number, mac address ) required
设备信息(如序列号、MAC地址),必须的

Yes是的

Early boot (boot partition)初期启动(boot分区)

miscMisc

Boot control settings, required启动控制设置,必须的

Yes是的

Early boot (boot partition)初期启动(boot分区)

homehome

Mounted in /home, can be customized挂载在/home下,可定制

No不可

Linux user spaceLinux用户空间

Updating the Firmware using USB使用USB更新固件

Astra Machina supports updating firmware using USB.
Astra Machina支持使用USB更新固件。

Setting up the USB Boot Environment设置USB启动环境

Booting from USB requires the usb_boot software tool to be the installed on a host system. Windows, Mac, and Linux hosts are supported. Windows systems also require the Synaptics WinUSB Driver. Mac and Linux systems do not require any additional drivers. USB Boot also requires setting up the serial console as described in the Setting up the Serial Console section above. This section covers how to configure the host system and prepare for USB booting.
从USB启动需要在主机系统上安装USB_boot软件工具。 支持Windows、Mac和Linux主机。 Windows系统还需要Synaptics WinUSB驱动。 Mac和Linux系统则不需要任何额外的驱动程序。 USB启动还需要按照前面的 设置串行控制台 章节中的说明来设置串行控制台。 本节介绍如何配置主机系统和准备USB启动。

Hardware Setup硬件设置

To run usb_boot you will need to connect the USB-TTL board and cable to Astra Machina as described in the Setting up the Serial Console section above. This will allow you to see console messages during the flashing process and input commands to the bootloader. You will also need to connect a USB cable from the host system to the USB Type-C USB 2.0 port on Astra Machina (next to the ethernet port).
要运行usb_boot, 您需要将USB-TTL板和电缆连接到Astra Machina, 如前面 设置串行控制台 章节中所述。 这将让您可以在烧录过程看到控制台消息,并向bootloader输入指令。 您还需要用USB线将主机系统连接到Astra Machina上的USB Type-C USB 2.0端口(靠近以太网端口)。

../_images/usb-c.png

Astra Machina Component Diagram with USB Type-C USB 2.0 port highlighted


Astra Machina 组件图,突出显示USB Type—C USB 2.0端口

Installing the WinUSB Driver (Windows Only)安装WinUSB驱动程序(仅限Windows)

Windows requires a special USB kernel driver to communicate with Astra Machina over USB. Please download the driver from GitHub. Linux and Mac hosts can access the Astra board from user space and do not need any additional kernel drivers.
Windows需要一个特定的USB内核驱动程序来通过USB与Astra Machina通信。 请从以下地址下载驱动程序 GitHub。 Linux和Mac主机可以从用户空间访问Astra板,不需要任何额外的内核驱动程序。

After downloading and decompressing the USB Boot software package, right click on the SYNA_WinUSB.inf file in the Synaptics_WinUSB_Driver directory. Select “Install” from the drop down menu.
下载并解压缩USB Boot软件包后, 右键单击Synaptics_WinUSB_Driver目录中的SYNA_WinUSB.inf文件。 从下拉菜单中选择“安装”。

../_images/install_driver_win.png

Install the driver


安装驱动程序

After installing the driver, the Astra Machina will show up in the Windows Device Manager as the “Synaptics IoT: Tools package USB Driver for Synaptics Processors” when operating in USB Boot mode.
安装驱动程序后, 在USB Boot模式下运行时,Astra Machina将在Windows设备管理器中显示为 “Synaptics IoT: Tools package USB Driver for Synaptics Processors”。

../_images/devices_win.png

Devices listed by the operating system after installing the driver


安装驱动程序后操作系统列出的设备

Running the USB Boot Tool运行USB Boot工具

Also included in the Synaptics usb-tool package is the usb_boot user space tool. This is the tool which communicates with Astra Machina over USB. Each Astra Machina variant will have its own usb_boot directory. Included in each directory will be a usb_boot binary and the run script used to run it. The directory will also contain an images directory which contains all of the image files needed to boot the board over USB. This include images which contain the USB U-Boot bootloader.
Synaptics usb工具包中还包括usb_boot用户空间工具。 这是通过USB与Astra Machina通信的工具。 每个Astra Machina变种都有自己的usb_boot目录。 每个目录中都包含一个usb_boot二进制文件和用来运行它的run脚本。 该目录还将包含一个映像目录,该目录包含通过usb启动板卡所需的所有映像文件。这些映像文件中包括USB U-Boot bootloader。

On Windows, double click on the run.bat file to launch the tool. This script will execute the binary using the specific options required for Astra Machina variant being used.
在Windows上, 双击run.bat文件以启动该工具。 该脚本将以所用Astra Machina变种需要的特定选项来执行二进制文件。

../_images/usb_user_tool_win.png

Directory containing the USBBoot tool on Windows


Windows上包含USBBoot工具的目录

After running the run.bat a window will open showing the status of the flash process.
运行run.bat后, 将打开一个窗口,显示flash进程的状态。

../_images/usbtool_output_win.png

Output of the usb_boot tool on Windows


Windows上usb_boot工具的输出

On Mac, right click on the directory which contains the version of usb_boot which matches the Astra Machina variant which you are about to boot. From the drop down select Services -> New Terminal at Folder.
在Mac上, 右键单击包含usb_boot版本的目录,该版本须与您即将启动的Astra Machina变种相匹配。 从下拉菜单中选择 Services -> New Terminal at Folder

../_images/mac-open-terminal.jpg

Opening a Terminal for USB Boot on Mac


在Mac上打开终端,用于USB启动

This will open a terminal inside of the selected usb_boot directory. From there run the run.sh script to run the tool. You may be prompted for your password since the script internally calls sudo. The tool requires additional permissions to interface with USB devices and access system resources.
这将打开所选usb_boot目录中的一个终端。 从那里运行run.sh脚本来运行该工具。 由于脚本内部会调用sudo,因此可能会提示您输入密码。 该工具需要额外的权限才能连接USB设备并访问系统资源。

../_images/mac-run-usbboot.png

Output of the usb_boot tool on Mac


Mac上usb_boot工具的输出

On Linux, right click on the directory which contains the version of usb_boot which matches the Astra Machina variant which you are about to boot. From the drop down select Open in Terminal.
在Linux上, 右键单击包含usb_boot版本的目录,该版本须与您将要启动的Astra Machina变体相匹配。 从下拉菜单中选择 Open in Terminal

../_images/linux-open-terminal.png

Opening a Terminal for USB Boot on Linux


在Linux上打开终端,用于USB启动

This will open a terminal inside of the selected usb_boot directory. From there run the run.sh script to run the tool. You may be prompted for your password since the script internally calls sudo. The tool requires additional permissions to interface with USB devices and access system resources.
这将打开所选usb_boot目录内的一个终端。 从那里运行run.sh脚本来运行该工具。 由于脚本内部调用sudo,因此可能会提示您输入密码。 该工具需要额外的权限才能连接USB设备并访问系统资源。

../_images/linux-run-usbboot.png

Output of the usb_boot tool on Linux


Linux上usb_boot工具的输出

Booting using USB Boot使用USB Boot启动

Once the usb_boot environment has been setup and the usb_boot tool is running on the host system, Astra Machina will need to be placed into USB Boot mode. To do that press and hold the “USB_BOOT” button on the I/O board. Then press and release the “RESET” button. Be sure to hold the “USB_BOOT” button long enough so that the board can reset and detect that the “USB_BOOT” button is pressed. After booting into USB Boot mode the U-Boot prompt “=>” will be displayed in the serial console.
一旦设置了usb_boot环境并且在主机系统上运行了usb_boot工具, Astra Machina需要被设置成 USB Boot 模式。 要执行此操作,请按住I/O板上的 “USB_BOOT” 按钮。 然后按下并松开 “RESET” 按钮。 确保按住 “USB_BOOT” 按钮足够长的时间,以便板卡可以复位并检测 “USB_BOOT” 按钮被按下。 启动进入 USB Boot 模式后,串行控制台中将显示 U-Boot 提示符 “=>”。

../_images/usb-boot-and-reset.png

Astra Machina Component Diagram with USB_BOOT and RESET buttons highlighted


Astra Machina组件图,突出显示USB_BOOT和RESET按钮

../_images/usb_boot_output_win.png

Output of the usb_boot tool and the serial console after successful boot


成功启动后,usb_boot工具和串行控制台的输出

../_images/putty-usb-boot.png

Serial Console after booting using USB Boot


使用USB Boot启动后的串行控制台

Note注意

Astra Machina will not show up in the Window’s Device Manager or be seen by the tool until putting the device into USB Boot Mode. Hold down the USB_BOOT and press the RESET button as described above.
只有设备进入USB Boot模式, Astra Machina才显示在窗口的设备管理器中,才能被工具看到。如上所述,按住USB_BOOT并按下RESET按钮。

Flashing Firmware to eMMC using USB Boot使用USB Boot将固件烧录到eMMC
../_images/emmc_flash_snapshot.png

Directory with files used to flash the eMMC image


包含用来烧录eMMC映像的文件的目录

When booting from USB, the usb_boot tool allows transferring the eMMC image directly over the USB interface. To flash the eMMC image via USB, copy the image files to the ‘images’ folder in your Astra Machina variant’s usb_boot tool directory.
从USB启动时, usb_boot工具允许直接通过USB接口传输eMMC映像文件。 要通过USB烧录eMMC映像,请将映像文件复制到Astra Machina变种的usb_boot工具目录下的“images”文件夹中。

Write the image to the eMMC using the command:
使用以下命令将映像文件写入eMMC:

=> l2emmc eMMCimg

The parameter eMMCimg is the name of the image directory under the usb_boot tool’s images directory.
参数 eMMCimg 是 usb_boot 下映像文件目录的名称。

Resetting复位

Astra Machina will boot into linux if a valid image has been written to the eMMC when the board is powered on. After writing an image to the eMMC, issue the reset command in U-Boot. Press the “RESET” button on the board, or power cycle the board to boot into Linux.
如果在主板上电时, eMMC中已写入有效的映像,Astra Machina将启动进入linux。 将映像文件写入eMMC后,请在U-boot中发出复位命令。 按下主板上的“RESET”按钮,或重启主板电源,来启动进入Linux。

U-Boot reset command:U-Boot复位命令:

=> reset

Note注意

Make sure that the SD-Boot jumper is not attached when booting from eMMC. Otherwise, the device will boot from internal SPI flash or an SD Card. See Booting from SPI and SD Cards.
确保从eMMC启动时未连接SD-Boot跳线。 否则,设备将从内部SPI闪存或SD卡启动。请参阅 从SPI和SD卡启动

Updating the Firmware from SPI从SPI更新固件

As described in Booting from SPI and SD Cards, Astra Machina has an internal SPI flash chip which contains the SPI U-Boot bootloader. This allows doing firmware updates without using a USB host system. Images can be loaded using an external USB drive or downloaded from a TFTP server on a local network.
从SPI和SD卡启动 中所述, Astra Machina有一个内部SPI闪存芯片,其中包含SPI U-Boot Bootloader。 这允许在不使用USB主机系统的情况下更新固件。 映像文件可以从外接的USB驱动器加载或从本地网络上的TFTP服务器下载。

Setting up the SPI Boot Environment设置SPI启动环境

Booting from the internal SPI flash does not require any additional software on the host besides the software for using the serial console as described in the Setting up the Serial Console section above.
从内部SPI闪存启动不需要在主机上安装任何附加软件, 除了前面 设置串行控制台 章节所述的使用串行控制台的软件以外。

Hardware Setup硬件设置

For SPI boot, you will need to connect the USB cable for the serial port as described in the Setting up the Serial Console section above. This will allow you to see console messages during the flashing process and input commands to the SPI U-Boot bootloader. You will also need a USB drive or Ethernet cable depending on where the eMMC image files are located. The USB drive can be inserted into any of the 4 USB Type-A USB 3.0 ports or the USB Type-C USB 2.0 port (may require USB Type-C to USB Type-A adaptor).
对于SPI启动, 您需要连接串行端口的USB线,如前面 设置串行控制台 章节所述。 这将允许您在烧录过程中看到控制台消息,并将命令输入给SPI U-Boot bootloader。 您还需要一个USB驱动器或以太网线,具体取决于eMMC映像文件的所在位置。 USB驱动器可以插入4个USB Type-A USB 3.0端口中的任一个,或USB Type-C USB 2.0端口(可能需要USB Type-C转USB Type-A的适配器)。

../_images/usb-and-ethernet-ports.png

Astra Machina Component Diagram with USB and Ethernet ports highlighted


Astra Machina组件图,突出显示USB口和以太网口

Flashing Images from a USB Drive从USB驱动器烧录映像

To flash an Astra system image from an external USB drive simply copy the image directory to the USB drive. The USB drive will need a partition with a Fat32 formatted file system and enough capacity to fit the Astra system image.
要从外接USB驱动器烧录Astra系统映像, 只需将映像目录复制到USB驱动器即可。 USB驱动器需要有一个 FAT32 格式的文件系统分区,且需要有足够的容量来容纳 Astra 系统映像。

Write the image to eMMC using the command:使用以下命令将映像写入eMMC:

=> usb2emmc eMMCimg

The parameter eMMCimg is the name of the image directory on the USB drive.
参数 eMMCimg 是USB驱动器上映像文件目录的名称。

Flashing Images from a TFTP Server从TFTP服务器烧录映像

To flash an Astra system image from a TFTP server you will first need to connect Astra Machina to a local network using the ethernet port. Copy the Astra image to the TFTP server so that it can be accessed by the device over the network. Once the device is connected to the network, boot to the U-Boot prompt.
要从TFTP服务器烧录Astra系统映像, 您首先需要通过以太网口将Astra Machina连接到本地网络。 将Astra映像复制到TFTP服务器上,这样,它可以通过网络被设备访问。 设备连接到网络后,启动到U-boot提示符。

Initialize networking and request an IP address from a DHCP server on the local network:
初始化网络,并从本地网络上的DHCP服务器获取IP地址:

=> net_init; dhcp; setenv serverip 10.10.10.10;

Write the image to eMMC from the TFTP server using the command:
使用以下命令,将映像文件从TFTP服务器写入eMMC:

=> tftp2emmc eMMCimg

The parameter eMMCimg is the name of the image directory on the TFTP server.
参数eMMCimg是TFTP服务器上映像文件目录的名称。

Note注意

In the examples above the TFTP server’s address is 10.10.10.10. Please replace this IP with the IP address of the server hosting TFTP.
在上面的示例中, TFTP服务器的地址是 10.10.10.10。请将此IP替换为承载TFTP的服务器IP地址。

Updating Internal SPI Flash Firmware更新内部SPI闪存固件

The internal SPI flash on Astra Machina can also be updated using the methods described above.
Astra Machina内部SPI闪存也可以使用上述方法进行更新。

Flashing Image from USB Boot从USB Boot烧录映像

To update the internal SPI flash firmware using usb_boot you must first follow the steps in section Setting up the USB Boot Environment.
要使用usb_boot更新内部SPI闪存固件, 必须首先按照设置USB启动环境 章节中的步骤进行操作。

../_images/spi_flash_snapshot.png

Directory with files used to flash the SPI flash


包含用来刷新SPI闪存的文件的目录

Once Astra Machina has booted U-Boot from USB, program the SPI flash by copying the SPI image file to the “images” directory in the usb_boot tool’s directory.
在Astra Machina通过USB启动U-Boot后, 将SPI映像文件复制到 usb_boot 工具目录下的 “images” 目录中,对SPI闪存进行烧写。

Then write the image to the SPI flash using the commands:
然后使用以下命令,将映像写入SPI闪存:

=> usbload spi_uboot_en.bin 0x10000000
=> spinit; erase f0000000 f02fffff; cp.b 0x10000000 0xf0000000 0x300000;

Flashing Image from an External USB Drive从外部USB驱动器烧录映像

To update the internal SPI flash firmware using an external USB drive, simply copy the image to the drive. Details on the how to setup the USB drive are covered in Flashing Images from a USB Drive.
要使用外接USB驱动器更新内部SPI闪存固件, 只需将映像复制到该驱动器即可。 有关如何设置USB驱动器的详细信息,请参阅 从USB驱动器烧录映像

Write the image to SPI flash using the following commands:
使用以下命令,将映像写入SPI闪存:

=> usb start; fatload usb 0 0x10000000 spi_uboot_en.bin;
=> spinit; erase f0000000 f02fffff; cp.b 0x10000000 0xf0000000 0x300000;

Flashing Image from TFTP Server从TFTP服务器烧录映像

To update the internal SPI flash firmware by downloading it from a TFTP server, simply copy the image to the TFTP server.
要通过从TFTP服务器下载来更新内部SPI闪存固件, 只需将映像复制到TFTP服务器。

Write the SPI image to the SPI flash from the TFTP server using the command:
使用以下命令,将SPI映像从TFTP服务器写入SPI闪存:

=> net_init; dhcp; setenv serverip 10.10.10.10;
=> tftpboot 0x10000000 spi_uboot_en.bin;
-> spinit; erase f0000000 f02fffff; cp.b 0x10000000 0xf0000000 0x300000;

Note注意

In the examples above the TFTP server’s address is 10.10.10.10. Please replace this IP with the IP address of the server hosting TFTP.
在上面的示例中, TFTP服务器的地址是 10.10.10.10。请将此IP替换为承载TFTP服务器的IP地址。