1. INTRODUCTION
In this article we are going to discuss about the HW and SW prerequisites needed to complete this course successful. At the end of this session the hardware setup and software environment should be ready for running a deep learning examples in simulations and on the real target represented by the NXP S32V234 Vision Processor.
This article explains the following topics:
Before we start with specific details, please make yourself familiar with the main features supported by NXP Vision Toolbox. The NXP Vision Toolbox for S32V234 is an NXP proprietary tool that is designed to helps you:
Throughout this course we are going to use the SBC type of S32V evaluation boards. Anyhow if you have the more expensive version of the S32V234EVB2 you can still follow up these articles, the only differences being the HW setup which can be found in the toolbox documentation and help: the Quick Start Guide that is also attached here for your reference.
The SBC-S32V234 is a cost-competitive evaluation board and development platform engineered for high-performance, safe computation-intensive front vision, surround vision, and sensor fusion applications. Developed in partnership with MicroSys and based on the Arm® Cortex®-A53 based S32V processors, it has an efficient form factor while covering most of the uses cases available for the S32V234. The SBC-S32V234 is the recommended starting evaluation board for S32V.
The SBC-S32V234 main features are:
For a more comprehensive view and a more detailed description regarding hardware specifications please check the SBC User Manual or visit this NXP webpage for the S32V Data Sheet. For a Quick Start Guide for the S32V234-SBC board please check this link: https://www.nxp.com/docs/en/quick-reference-guide/Quick-Start-Guide-SBC-S32V234.pdf
For this course on Machine Learning we are going to make use of the following peripherals and components hence make sure you have all of them available and you are familiar with their intended scope:
For more details please review the SBC-S32V User Manual.
Please read carefully this section since it contains all sort of tips and trick to have working setup for being able to generate the code from MATLAB scripts for NXP S32V and also to allow you perform various interactions with the real target. Due to the complexity of the software used to configure and control this processor we have to deal with 3 types of deliveries:
I think now you get a better picture why some manual steps are needed to configure host PC to address all software dependencies. Hence, let's start the process...
For convenience a step-by-step installer guide is available on MathWorks’s File Exchange website. Open MATLAB and select Get Add-Ons:
The Installer Guide contains instructions for downloading, installing and verification of all software components required for being able to develop vision application with MATLAB for NXP S32V234 automotive vision processors:
There are 2 main advantages of using this Installer Guide:
The next screen capture shows how the Installer Guide notify user of successful or failed actions. At the end of installation all push buttons should be green.
You can obtain the NXP Vision Toolbox for S32V234 by:
No matter which option is used, the NXP Vision Toolbox for S32V234 installation steps are similar: once you have the toolbox on your PC, double click on the *.mltbx file to start the MATLAB Add-ons installer that will automatically start the installation process.
You will be prompted with the following options:
The NXP Vision Toolbox for S32V234 is available free of charge, however, a valid license is required. You can obtain the NXP Vision Toolbox for S32V234 license free of charge by:
Perform the following steps to obtain the NXP Vision Toolbox for S32V234 license. For the first-time log-in, the “Software Terms and Conditions” page will be displayed. Click on “I agree” button to consent to the software license agreement.
In this section we presume, you already logged into your NXP account to download the toolbox prior to license generation step
In case you are using the Installer Guide, then you can save the license file anywhere and use the “Activate NXP Vision Toolbox” option to make sure the license is copied correctly in the appropriate toolbox location. Check if the license file is installed correctly by using the “Verify Vision Toolbox License” button. If everything is ok, then the Installer Guide will confirm the action.
Alternatively, you can check from command line is the license for NXP Vision Toolbox is activated. Run the command nxpvt_license_check. If there are issues with the license, this command will return the root-cause.
All the code generated by NXP Vision Toolbox is based on S32V234 Vision SDK package. This software package is also free of charge and apart of optimized kernels and libraries for the S32V automotive vision processors, it also contains the build tools to cross-compile the MATLAB generated code to ARM A53 and APEX cores. You can obtain the S32V234 Vision SDK free of charge by:
Perform the following steps to obtain and install the S32V234 Vision SDK and NXP Build Tools:
The last step required for software configuration is to set two system or user environmental variables APU_TOOLS and S32V234_SDK_ROOT that points to:
APU_TOOLS= C:/NXP/APU_Compiler_v1.0
S32V234_SDK_ROOT = C:/NXP/VisionSDK_S32V2_RTM_1_3_0/s32v234_sdk
Ensure system or user environment variables, corresponding to the compiler(s) you have installed, are defined to compiler path value as shown below:
Paths shown are for illustration, your installation path may be different. Once environmental variables are setup you will need to restart MATLAB to use these variables.
An alternative for setting the system paths manually is the “Set the environment variables” option from the NXP Vision Toolbox support package installer:
If the MATLAB is open with Administrator rights, then the “Set system wide” can be used to set the system variables. Othervise (most of the cases) use “Set user wide” to setup the environment variables
In order to use the Convolution Neural Networks the ARM_COMPUTELIB variable should also be set to point to the top of the arm_compute installation. More on the ARM Compute library installation in the following chapter.
The entire procedure for configuration and booting up the platform is described in the Vision SDK manuals. Unfortunately, not everyone has access to a Host PC with Linux OS to configure an SD card (formatting, uboot, filesystem, linux image copy). To do this, you must log into your NXP account at www.nxp.com and download the SD card images:
Unpack the downloaded file and the ‘build_content/v234_linux_build/s32v234sbc/’ folder will contain the sbc SD-card image which can be written directly from MATLAB.
Follow the next steps to create a bootable SD card for S32V234 SBC evaluation board:
This command will format the card and then it is going to copy all the required files from the *.bz2 image to the SD Card for booting up the Linux on S32V234 SBC.This example assumes you have untar the SD Card archive downloaded from the NXP website and you run the nxpvt_create_target command from the same directory as sdcard-sbc.tar.bz2 image
Before running any example on the S32V234 SBC you need to perform the following steps:
The ARM Compute Library is a collection of low-level functions optimized for Arm CPU and GPU architectures targeted at image processing, computer vision, and machine learning. It is available free of charge under a permissive MIT open source license. The library’s collection of functions includes:
Download ARM Compute by going to this site:
https://github.com/ARM-software/ComputeLibrary
The toolbox examples were built using version 18.03, so download this one to avoid any backward or forward compatibility issues - scroll down until you find Binaries section like in the image below:
After downloading and unpacking the ARM Compute image the ARM_COMPUTELIB should point to the top of the installation folder:
The ARM Compute library should contain the linux-arm-v8a-neon with the correct libraries:
To be able to run the CNN examples in the toolbox, the following MATLAB Add-Ons should be installed :
At this point you should be able to run all examples in the NXP Vision toolbox, including the ones containing Convolutional Neural Networks.
Your setup should now be configured with:
Hi,
it says I shall use the SD card image based on Yocto. Can I use the Debian image instead? I tried the Debian image (bsp19-debian-stretch-s32v234sbc.tar.bz2) but I can't login with "root". Do you know the correct user name and password for the pre-built SD card image based on Debian?
And there is another question. Is it possible to run ROS on this board?
Regards,
Hongjun Wang
Hi, hongjun.wang@mathworks.cn
You can use the debian version as well, but you have to perform a few extra steps and some of the features of the NXP Vision Toolbox, like automatically deploying on target and running bash commands from MATLAB will not be available for the moment. We will add support for debian as well in the near future. Nevertheless, you can still just copy the .elf resulted from codegen and the required extra files. I think it would be best to get the entire vision_toolbox/examples/data folder and have the whole folder in the same location as the .elf you would like to run.
The user and password for the debian distribution is vision and vis, respectively. You then need to enable networking:
Select, if you are using static or dhcp
Now start your interface
Run the dhclient command just to be sure. Now try to ping some public domain and your network should be available.
Then you should try to do:
sudo apt-get install vsdk-demos
It should install the dependencies and get things running. If you encounter any issues, please reply.
Thank you,
Vlad Dascau
Hi hongjun.wang@mathworks.cn,
Regarding installing ROS, we haven't tried that yet, but being that this is a Debian Stretch distribution it might be feasible. We will try it as well.
Thank you,
Vlad Dascau
Hi,
According to the above steps to make SD card, putty cannot input and has no information.Can you help me find out the problem? Thank you
Hi 751301185@qq.com,
Are you using the SBC board or the EVB board ? The steps you've taken are correct and it should work. Can you please check if maybe there's something wrong with the serial connection ? We've experienced something similar that was fixed by changing the USB port and MicroUSB cable. Also the connection in PuTTy needs to be opened with 115200 speed, not just the configuration in Device Manager:
Please let me know if any of these work. If not, we will try to investigate it further.
Thank you,
Vlad Dascau
Hi,Vlad Dascau
I use EVB board. When I follow this link to make a card, it can start working.
HOWTO: Prepare A SD Card For Linux Boot Of S32V234-EVB Using BSP From VSDK
When I create a bootable SD card for S32V234 EVB evaluation board based on Yocto,Through the following methods:
AI and Machine Learning Course #1: Hardware and Software Setup
PuTTY has no input.
Is this related to USB port and MicroUSB cable?
Thank you,
lilei
No, it is not related to USB port and MicroUSB cable if you are saying that you've got it working with the alternative procedure. nxpvt_create_target is writing the card with a tool that is similar to the dd command in linux. The sizes of the image file and dtb you've attached are the same as the ones I have on my working card so I assume the image was written correctly. Are you using the same card/card reader/usb port that worked with the other method ?
Thanks,
Vlad Dascau
Hi,Vlad Dascau
I use the same SD card, the same USB port
Well, for the moment I would suggest using the card that you have created with the other method, since this should work fine. Otherwise, we can continue to investigate it together if you would like that.
Thank you,
Vlad Dascau
The program compiled by MATLAB, when I run the application program on the s32v board, the following errors occur:
./face_detection.elf: error while loading shared libraries: libopencv_calib3d.so.3.4: cannot open shared object file: No such file or directory
Iulian Bulancea suggested that I use the Yocto SD card image provided with Vision SDK 1.4.0. So there are some problems mentioned above.
Kind regards,
lilei
The two ways of writing an image should be equivalent. Did you use the same yocto version from sdk 1.4.0 when writing the card with the virtual machine ? If so, it should work. Can you please do a ls in the lib folder and a uname -a in the command line:
Thank you,
Vlad Dascau
Hello Vlad Dascau,
It is mentioned in this document that at least 4GB class 10 micro SD-card is needed to configure the bootup and initialize the platform of SBC-S32V234. My question is: What is the maximum size of the SD card I can use on the SBC-S32V234 board? The NXP provided SD card is 4 GB in size and its almost full in our case. Therefore I want to replace this 4 GB micro SD card with 64 GB or 128 GB.
Best Regards
Md Anayatullah
Hello md.anayatullah@stud.hs-kempten.de,
Yes, you should be able to create an image with a 128GB SD-Card. If you need any assistance, please let us know.
Thank you,
Vlad Dascau
Hi md.anayatullah@stud.hs-kempten.de,
I'll paste here the answer that I got from brent_wylie:
On closer inspection of the device reference manual, the S32V2 supports both SD High Capacity (SDHC) and SD Extended Capacity (SDXC) cards:
Compatible with the SD Memory Card Specification version 3.0 and supports the Extended Capacity SD Memory Card
SDHC cards typically have a capacity from 4GB to 32GB, and SDXC cards have a capacity starting at 32GB with a theoretical maximum of 2TB.
Both are supported by the controller.
Best regards,
Paul