Get Started with the FRWY-LS1046A

1.1 Technical Specification

The FRWY-LS1046A is a high-performance, low-cost edge computing, evaluation, and development platform that supports the QorIQ LS1046A architecture quad-core 64-bit processor and is capable of supporting more than 40,000 CoreMark performance.

The FRWY-LS1046A platform supports onboard DDR4 memory, multiple gigabit Ethernet, USB3.0, and M2 Type E interfaces over PCIe® Gen3 for Wi-Fi. The platform can enable a wide range of high-compute applications including AI/ML, industrial gateway, smart building gateway, wireless gateway, and many more. There are two configurations available.

1.2. Hardware Kits Overview

Technical Specifications

Specification Description
Processor
  • FRWY-LS1046A: Arm Cortex A72, 64-bit CPU
  • Up to 1.6GHz Quad-Core
  • 32KB L1 data cache / 48KB L1 instruction cache
  • 2MB L2 Cache
Power Management
  • 12V / 5A Power connector
Connectivity
  • 4x Gigabit Ethernet
  • 2x M.2 Type E sockets (Wi-Fi, LTE, AI/ML)
  • 2x USB 3.0
  • Mikro-Click for expansion (NFC, BLE/ZigBee. LoRa)
  • Headers for 12C, SPI, Clocks, Interrupts, GPIO
  • MicroSD slot
Memory
  • 4GB DDR4 with ECC
  • 4GB NAND Flash
  • 64MB QSPI
Debug
  • Micro USB debug port
General
  • LED’s (Power, Ready. Fuse Prog)
  • LED’s Ethernet Link, Activity
Demonstration Kits
  • FRWY-LS1046A-AC
  • FRWY-LS1046A-TP

Hardware Kit

FRWY-LS1046A-TP FRWY-LS1046A-AC
Google TPU installed FRWY-LS1046A hardware assembly enclosed with casing
FRWY-LS1046A hardware assembly enclosed with casing Universal AC input adapter
Universal AC input adapter 12 V, 5 A DC power adapter
12 V, 5 A DC power adapter USB Type A to micro-B cable
USB Type A to micro-B cable Programmed 32 GB TF (micro-SD) card
Programmed 32 GB TF (micro-SD) card Quick reference card
Quick reference card Shunt jumpers (10)
Shunt jumpers (10) Antennas (2)
Antennas (2) Wi-Fi card (WNFQ-255ACN(BT))
Wi-Fi card (WNFQ-255ACN(BT)) -
Arm Cores + offload engine PCIe Connectivity Ethernet/1588 DDR Software
  • 8 lane SerDes
  • 4x PCIe Gen3
  • Up to 2x 10GbE
  • Up to 3x 2.5GbE
  • Up to 5x 1GbE
  • IEEE 1588 time stamping
1x 64b DDR4/3L @ 2100MT/s
  • LSDK open source
  • BHR ASK
  • uCode programmable offload engine
  • 1.3. Getting Started with FRWY

    1. Insert the SD-Card in the SD-socket. This is required for the FRWY-LS1046A system to boot.
    2. Mount the provided Wi-Fi antennas into the SMA plugs on the FRWY-LS1046A system.
    3. Plug in the USB webcam to either one of the two USB ports on FRWY-LS1046A board.
    4. Power on the board by plugging in the power supply to the barrel connector with the included 12V power supply.
    5. Wait for 2 minutes for the board to boot up and broadcast the Wi-Fi SSID, which comes up automatically.
    6. Connect mobile phone, tablet, personal computer etc. to the SSID “FRWY-LS1046A-[MAC ADDRESS]”, with password "frwyls1046a". The [MAC ADDRESS] can be found as the last four digits of the first Ethernet MAC address labelled on the sticker at the bottom surface of board.
    7. 7. Open a web browser on your device and type in 192.168.99.1 to demonstrate the use cases for Performance Benchmarking, Data Analytics, Machine Learning and Demo Videos. Make sure you enable pop-ups in your browser, or you will not be able to view the results of these demonstrations.

    Note:

    • If you are using a mobile phone, please turn off the mobile data as the above URL is local to the board.
    • Ethernet port “1G PORT2” can also be used to access GUI at the same URL above, in case Wi-Fi is not available on board.

    This video provides an overview of the FRWY-LS1046A. For details about the features of the board, refer to Layerscape LS1046A Freeway Board Reference Manual..


    The Layerscape® LS1046A Freeway (FRWY-LS1046A) board is a highperformance development platform that supports the QorIQ® LS1046A architecture processor capable of supporting more than 32000 CoreMark® performance. This document describes different board components and explains how to set up and boot the board.

    The FRWY-LS1046A functions with an integrated development environment (IDE), such as CodeWarrior Development Studio.

    For instructions on how to work with the CodeWarrior Development Studio IDE, see CodeWarrior Development Studio for QorIQ LS series - ARM V8 ISA, Targeting Manual.

    Read more

    How to's

    2.1 Jupyter Notebook

    Jupyter Notebook

    • The Jupyter Notebook is an open source web application that you can use to create and share documents that contain live code, equations, visualizations, and text.
    • Jupyter Notebooks are a spin-off project from the IPython project, which used to have an IPython Notebook project itself. The name, Jupyter, comes from the core supported programming languages that it supports: Julia, Python, and R. Jupyter ships with the IPython kernel, which allows you to write your programs in Python.
    • The Notebook server and Python execution environment runs in containers on the FRWY-LS1046A. The code can be modified and executed right in the notebook.

    Advantages of Jupyter Notebook

    • Offload work: On LS platform, one can deploy Jupyter Notebook and access it from web browser, so that LS board won’t get heavy running Python itself.
    • Ease in implementation and solve problems: With a Jupyter Notebook, you can view code, execute it, and display the results directly in your web browser.
    • Tutorial and documentations: Jupyter enables the combination of code with more detailed documentation and results. This can be effective for multiple purposes, like with working on creating a AI/ML model, including tutorials which you might have already come across.
    • Access to shell: Jupyter notebook also provides access to terminal over the web browser, and one can modify the files on go, if needed, without getting worried about the console or board access or to switch the screen in between.

    Configure Jupyter notebook on LS Platform

    Some of the packages to be download:

    • apt install python3-pip python3-dev
    • pip3 install --upgrade pip
    • pip3 install virtualenv
    • pip install jupyter

    Run the below command with user permission on LS platform to start jupyter notebook:

    $ jupyter notebook

    Output:

    [I 21:23:21.198 NotebookApp] Writing notebook server cookie secret to /run/user/1001/jupyter/notebook_cookie_secret
    [I 21:23:21.361 NotebookApp] Serving notebooks from local directory: /home/nxp/my_project_dir
    [I 21:23:21.361 NotebookApp] The Jupyter Notebook is running at:
    [I 21:23:21.361 NotebookApp] http://localhost:8888/?token=1fefa6ab49a498a3f37c959404f7baf16b9a2eda3eaa6d72
    [I 21:23:21.361 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
    [W 21:23:21.361 NotebookApp] No web browser found: could not locate runnable browser.
    [C 21:23:21.361 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time, to login with a token:

    http://localhost:8888/?token=1fefa6ab49a498a3f37c959404f7baf16b9a2eda3eaa6d72

    2.2 VNC Remote Desktop

    • Virtual network computing (VNC) is a type of software that makes remote control of a computer possible. It allows a user to view the desktop display of another computer remotely from their computer, and control the computer over the network.
    • IT professionals use VNC to fix computer issues, and other users can remotely access their own computers while on the road.
    • It presents a graphical desktop (Gnome or LXDE) running on the FRWY-LS1046A.
    • It removes the need for a physical display next to the system. This server can run natively or in a container.

    Configure VNC server on LS Platform

    Some of the packages to be download:

    • apt-get install tigervnc-standalone-server
    • apt-get install lxde-common
    • apt-get install openbox-lxde-session
    • apt-get install emacs

    Set configuration and password for VNC.

    Run the below command with user permission on LS platform to start vncserver:

    • /usr/bin/perl /usr/bin/vncserver -localhost no -geometry 1024x768

    Note:

    • Export display: export DISPLAY=:0
    • To run the demo using VNC, image should have support of OpenCV
    • Python script should imshow, for streaming the output.
    • Download the vncviewer for X86 machine, use port 1 for connection

    2.3 TigerVNC

    TigerVNC Remote Desktop

    • TigerVNC is a high-performance, platform-neutral implementation of VNC (Virtual Network Computing), a client/server application that allows users to launch and interact with graphical applications on remote machines.
    • The default desktop shipped with FRWY-LS1046A is the LXDE desktop environment
    • This server can be enabled to start automatically. On FRWY-LS1046A console issue: # systemctl enable vncserver-user@:1.service
    • Connection to FRWY-LS1046A vncserver is possible using: $ vncviewer 192.168.99.1:1

    Advantages of TigerVNC

    • Virtual display with development environment: LS board supports VNC server, which will provide desktop experience similar as x86, with support of basic tools like GMAC, terminal, web browser, file manager etc.
    • User Friendly: User can modify the code directly opening the file in edit window, can copy paste the file from one location to another and even run video/camera stream.
    • Highly secure: Full session encryption, multi-factor authentication and many other security features.
    • Support multiple device: VNC is a light weighted tool and can be easily ported to any LS platform family.
    • Multiple user support: One can cr eate multiple users on LS platform with different access permission, so that each user can access the area they have to work on.

    2.4 Docker

    What is Docker?

    • An open platform for developing, shipping, and running applications
    • Separate applications from infrastructure so one can deliver software quickly
    • Provides the ability to package and run an application in a loosely isolated environment called a container
    • Docker provides tooling and a platform to manage the lifecycle of the containers:
      • Develop the application and its supporting components using containers.
      • The container becomes the unit for distributing and testing the application.
      • When a container is ready, deploy the application into the production environment, as a container. This works the same whether the production environment is a local data centre, a cloud provider, or a hybrid of the two.

        For more Docker information visit: docs.docker.com.

    2.5 AI/ML

    AI/ML on FRWY-LS1046A

    Artificial intelligence (AI) and machine learning (ML) requires an inseparable combination of processing power and software. The shift of high-performance processing from the cloud to the edge significantly decreases bandwidth requirements, reduces latency, and maintains privacy.

    AI opens entirely new opportunities for the automotive industry to help solve global mobility challenges. Working in close collaboration with leading academic institutions, research organizations and pioneering technology firms – NXP is at the forefront in the development of automotive AI solutions.

    Machine Learning Terms

    • Machine learning (ML)- is a category of algorithm that allows software applications to become more accurate in predicting outcomes without being explicitly programmed. The basic premise of machine learning is to build algorithms that can receive input data and use to predict an output while updating outputs as new data becomes available.
    • OpenCV- Open Source Computer Vision Library is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.
    • TensorFlow- TensorFlow is a free and open-source software library for dataflow and differentiable programming across a range of tasks. It is a symbolic math library and is also used for machine learning applications such as neural networks. It allows developers to create large-scale neural networks with many layers. TensorFlow is mainly used for: Classification, Perception, Understanding, Discovering, Prediction and Creation.
    • YOLO- You Only Look Once uses deep learning and convolutional neural networks (CNN) for object detection, it stands out from its “competitors” because, as the name indicates it only needs to “see” each image once. This allows YOLO to be one of the fastest detection algorithms (naturally sacrificing some accuracy).

    2.6 TPU

    Google Edge TPU

    • Edge TPU is Google’s purpose-built ASIC designed to run AI at the edge
    • It delivers high performance in a small physical and power footprint, enabling the deployment of high-accuracy AI at the edge

    Why Edge TPU:

    • End-to-end AI infrastructure
    • High performance in a small physical and power footprint
    • A broad range of applications

    It is an open, end-to-end infrastructure for deploying AI solutions.

    2.7 NFC

    • NFC click is a mikroBUS™ add-on board with a versatile near field communications controller from NXP — the PN7120 IC.
    • NFC devices are used in contactless payment systems, electronic ticketing, smartcards, but also in retail and advertising — inexpensive NFC tags can be embedded into packaging labels, flyers or posters.
    • NFC and its three distinct operating modes: Card emulation, Read/Write, P2P.
    • NFC click can be set to behave either as an NFC reader, or a tag, or to establish a two-way connection with another NFC device.

    2.8 Accelerometer

    • The ADXL345 is a small, thin, low power, 3-axis accelerometer with high resolution (13-bit) measurement at up to ±16 g.
    • Accessible through either a SPI (3 or 4 wire) or I2C digital interface.
    • It measures the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion or shock.
    • Configuration for adxl module
    • i2cset -y 7 0x1d 0x2d 0x08
    • # To set measurement mode, By default it is in standby mode so it will not measure the acceleration.
    • i2cset -y 7 0x1d 0x38 0x80
    • # fifo mode stream mode, in this current data will store and old will deleted

    2.9 Secure Boot

    Secure boot process uses a digital signature validation routine already present in Internal BOOT ROM. This routine performs validation using HW bound RSA public key to decrypt the signed hash and compare it to a freshly calculated hash over the same system image. If the comparison passes, the image can be considered as authentic.

    Requirement for build and Secure Root Key generation

    Build LSDK 19.09 as per instructions from LSDK User Guide. On LSDK19.09 build source path.

    Set enviornment for build:

    $ source setup.env

    Compile CST application:

    $ flex-builder -c cst -a arm64

    Enable secure boot in RCW if not enable:

    $ cd packages/firmware/rcw/ls1046afrwy/NN_NNQNNPNP_3040_0506

    For SD-boot mode:

    $ vi rcw_1600_sdboot_sben.rcw
    BOOT_HO=0
    SB_EN=1

    Build SD secure firmware:

    $ flex-builder -i mkfw -m ls1046afrwy -b sd -s

    Build QSPI secure firmware:

    $ flex-builder -i mkfw -m ls1046afrwy -b qspi -s

    Check SRK Key from build path:

    $ cat packages/apps/cst/srk_hash.txt

    Build secure bootpartition:

    $ flex-builder -i mkbootpartition -a arm64 -m ls1046afrwy -s

    All the images for preparing card will be in the build path

    $ cd build/images

    Procedure to run secure boot

    With non-secure firmware Power ON the board and stop at U-boot.

    Check SNVS state

    =>md 0x1e90014
    002b0088

    Note: The second nibble indicates that the OTPMK is not blown

    Raise POVDD by executing below two commands

    =>mw 0x2320000 80000000
    =>mw 0x2320008 f01c0000

    Program OTPMK

    =>mm 0x01E80234
    01e80234: 00000000 ? 11111111
    01e80238: ffffffff ? 22222222
    01e8023c: ffffffff ? 33333333
    01e80240: ffffffff ? 44444444
    01e80244: ffffffff ? 55555555
    01e80248: ffffffff ? 66666666
    01e8024c: ffffffff ? 77777777
    01e80250: ffffffff ? 88888888
    01e80254: 00000000 ? .

    Check SNVS state

    =>md 0x1e90014
    00290080

    Now you can see ‘0’ in second nibble.

    Check for parity error

    =>md 0x1e80024
    00000000

    Note: Parity error state should be all zero. Non-zero value indicate parity error, then Please rewrite OTPMK value and cross check POVDD is raised properly.

    Program SFP registers

    Get SRK Key from build path:

    $ cat packages/apps/cst/srk_hash.txt

    SRK (Public Key) Hash:

    43b38d3660ddf23067842974875f8af9ecfa2c3ad9d243abe6f4e18448eee0b7

    => mm 0x1e80254
    01e80254: 00000000 ? 368db343
    01e80258: 00000000 ? 30f2dd60
    01e8025c: 00000000 ? 74298467
    01e80260: 00000000 ? f98a5f87
    01e80264: 00000000 ? 3a2cfaec
    01e80268: 00000000 ? ab43d2d9
    01e8026c: 00000000 ? 84e1f4e6
    01e80270: 00000000 ? b7e0ee48
    01e80274: 00000000 ? .

    Check for parity error

    =>md 0x1e80024
    00000000

    Note: Parity error state should be all 0. Non-zero value indicate parity error, Please rewrite OTPMK value and cross check POVDD is raised properly.

    Blow the OTPMK to fuses if no parity error is found.

    =>mw 1e80020 0x02000000

    Note - The fuse programming is permanent so make sure there is no parity error before running the above command.

    2.9.1 Validation of Secure Boot.

    Switch Setting

    After flashing image into SD card, insert the SD-card to board.

    And make sure the switch setting for sd/qspi respective booting mode:

    QSPI NOR boot : 0_0100_0100_0
    SD boot : 0_0100_0000_0

    Now boot the board.

    On U-Boot log, you should be able to see “validating secureboot” and “esbc_validate command successful”.

    At linux, check SEC_MON register whether Board is booted in Secure mode:

    root@localhost:~# busybox devmem 0x1e90014
    0x00AD0080

    2.10 SD card preparation

    Steps for flashing the signed SD boot image

    Follow the below commands to flash the images on SD card.

    $ flex-installer -f firmware_ls1046afrwy_uboot_sdboot_secure.img -b
    >bootpartition.tgz< -r >rootfs.tgz< -m ls1046afrwy -d >/dev/sdx<

    Steps for flashing the signed qspi boot image

    Follow the below commands to flash the images on SD card.

    $ flex-installer -b >bootpartition.tgz< -r >rootfs.tgz< -m ls1046afrwy -d >/dev/sdx<

    Once SD-card is ready, plug the console of the board to the X86 machine/Laptop and open the minicom using:

    $ sudo minicom -sw

    Make sure the minicom setting should be same as below output

    • 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

    Save and exit from minicom

    Steps for flashing the qspi secure firmware

    Unplug the SD card from Linux pc and insert in to FRWY-LS1046A board, stop at U-boot follow below steps.

    Program the secure firmware to flash at 0x0:

    =>ext2load mmc 0:x 0xa0000000 firmware_ls1046afrwy_uboot_qspiboot_secure.img
    =>sf probe 0:0
    =>sf erase 0x0 +$filesize
    =>sf write 0xa0000000 0x0 $filesize
    =>reset

    Machine Learning/ Video Analytic Using Local Docker

    Overview

    • Video analytics showcase the FRWY-LS1046A board's capability in field of Artificial Intelligence and Machine learning. 
    • Machine Learning and Artificial Intelligence capabilities packed in docker container for easy deployment.
    • Live people counting, Object detection, Face Recognition, Pose Detection, we can demonstrate the boards performance in terms of machine learning.

    Face Recognition Demo(CPU)

    • Face Recognition Demo using NCNN and MobileFaceNet shows we can train any number of people and store names in database for future use.
    • Multi face detection at single time

    People Counting Demo(CPU)

    • A pre-trained coco model is used for people counting.
    • The model can detect upto 80 objects.
    • ML/AI capabilities powered by TensorFlow and OpenCV which provide ease of use and smooth deployment and development options to users.

    Industrial Safety & Security Demo(CPU)

    • Industrial Safety demo using TensorFlow shows Machine learning and AI capabilities of FRWY-LS1046A. 
    • Trained model for almost any object can be added using this method.
    • ML/AI capabilities powered by TensorFlow and OpenCV which provide ease of use and smooth deployment and development options to users.

    Pose Detection Demo(TPU)

    • Industrial Safety demo using TFLite shows Machine learning and AI capabilities of FRWY-LS1046A. 
    • With the help of TPU we can process approx 30 frame per second and detection speed is very good
    • In this demo, we are showing the count of google detection on UI.

    Pose Detection Demo(TPU)

    • Pose Detection Demo is use for the activity and position of user.
    • This demo is running on TPU so we can process approx 30 frames per second.
    • ML/AI capabilities powered by TFLite and OpenCV which provide ease of use and smooth deployment and development options to users.

    Downloads

    Demos

    4.1 CPU benchmarking

    CoreMark is a benchmarking tool that measures the performance of central processing units (CPUs) used in embedded systems.

    CoreMark is a simple, yet sophisticated benchmark that is designed specifically to test the functionality of a processor core. Running CoreMark produces a single-number score allowing users to make quick comparisons between processors.

    Coremark contains implementations of the following algorithms: list processing (find and sort), matrix manipulation (common matrix operations), state machine (determine if an input stream contains valid numbers), and CRC (cyclic redundancy check).

    COREMARK
    Iteration/sec CPU Usage Power value (Watts)
    9646 96.32 4.60
    19835 98.50 5.60
    30078 98.78 6.2
    40390 99.08 7.60

    CPU Benchmarking Using Dhrystone

    • Developed in 1984 by R.P. Wecker, Dhrystone is a benchmark program written in C or Pascal (and now even in Java) that tests a system's integer performance.
    • Dhrystone is a benchmark software program used to test a computer's processor's integer performance. Each Dhrystone is a measurement of how many times the program can run each second.
    • For example, '1234 Dhrystones per second' indicate the program could run 1,234 times in a one-second period.
    DHRYSTONE
    DMIPS CPU Usage Power value (Watts)
    8913 97.67 4.60
    1784 98.60 5.60
    26759 99.11 6.60
    35813 99.01 7.60

    4.2 Edge computing

    Cold Storage Data Analytic Demo

    Data Analytics demo shows the compute power of FRWY-LS1046A. User can choose from among 400 simulated refrigerators to check internal temperature, external temperature, deviation from set-point.

    The Gateway will flag any refrigerator that is not performing within specified range of temperature. Local database is used to check past performance upto 24hrs.

    24000 data-points processed and pushed to local database per minute.

    ACCELEROMETER Demo

    • The ADXL345 is a small, thin, low power, 3-axis accelerometer with high resolution (13-bit) measurement at up to ±16 g.
    • Accessible through either a SPI (3 or 4 wire) or I2C digital interface.
    • It measures the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion or shock.
    • Configuration for adxl module
      • i2cset -y 7 0x1d 0x2d 0x08
      • # To set measurement mode, By default it is in standby mode so it will not measure the acceleration.
      • i2cset -y 7 0x1d 0x38 0x80
      • # fifo mode stream mode, in this current data will store and old will deleted

    Sensor Data Analysis Demo

    • We use accelerometer module to check position of the board.
    • Sensor Data Analytics demo shows the position of the board with respect to X, Y, Z axis.
    • If any sensor goes out of position, then it will show on UI.
    • This demo can run on both 2 or 4 core and we can check 40 sensors values in Sensor table

    4.3 Attendance tracking

    NFC Demo

    • Use Micro click NFC module for detecting the card.
    • NFC demo is showing the authentication capability of LS1046A-FRWY board.
    • We can add the persons details in database (like tag, name, employee id, designation).
    • Use micro click NFC module to detect the NFC card for authentication.

    NFC Module

    • NFC click is a mikroBUS add-on board with a versatile near field communications controller from NXP — the PN7120 IC.
    • NFC devices are used in contactless payment systems, electronic ticketing, smartcards, but also in retail and advertising — inexpensive NFC tags can be embedded into packaging labels, flyers or posters.
    • NFC and its three distinct operating modes: Card emulation, Read/Write, P2P.
    • NFC click can be set to behave either as an NFC reader, or a tag, or to establish a two-way connection with another NFC device.

    4.4 Video vault

    • Video Vault show case different demo videos stored on LS1046FRWY board (SD card).
    • We have stored videos of all the demos for basic understanding.
    • User can show case quick demos through video vault.

    6. How to videos