HOWTO: Prepare A SD Card For Linux Boot Of S32V234-EVB2 Using BSP For VisionSDK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOWTO: Prepare A SD Card For Linux Boot Of S32V234-EVB2 Using BSP For VisionSDK

HOWTO: Prepare A SD Card For Linux Boot Of S32V234-EVB2 Using BSP For VisionSDK

While the S32V234-EVB2 comes shipped with an SD card preloaded with a Linux Board Support Package(BSP), it does not support the Vision Software Development Kit(VSDK). This you will have to load yourself. There are two methods for installing the S32V234 BSP for VSDK to your SD card:

1) Download the image file from your Software Account on nxp.com and write the file to the SD card, or

2) Create the image on the SD card from ubuntu installed on a PC or virtual machine

Download the image file and write it to SD card

This is the simplest method, but does not allow for much customization. It is an excellent choice for those users who do not have much experience with Linux or just need something quick to get up and running with S32 Design Studio, try out the application examples, etc.

Procedure

1) Login to your account on NXP.COM (if you do not already have an account, then just register for one)

2) Go to Vision SDK Software 

3) Accept the license agreement

4) Select the version of VSDK you wish to use

pastedImage_8.png

5) Check the box next to 'VisionSDK RTM x.x.x pre-built SD Card image based on Yocto rootfs' and click 'Download selected files'. This will download the .gz file to your PC.

pastedImage_7.png

6) Unpack the VisionSDK_S32V2_RTM_x_x_x_img_yocto.tar.gz archive file

7) Unpack the VisionSDK_S32V2_RTM_x_x_x_img_yocto.tar archive file

8) Navigate to the '\build_content\v234_linux_build\s32v234evb' folder, then unpack the sdcard-evb.tar.bz2 file

9) Unpack the sdcard-evb.tar file

10) The resulting file is sdcard-evb.img. You can use an image writing tool (such as Win32 Disk Imager download | SourceForge.net) to write this image file to the SD card. You will need to use the SD card adapter to insert the microSD card into the SD card slot on your PC, if available. If you do not have an SD card slot on your PC, there are many SD card-to-USB adapters available on the market.

pastedImage_9.png

11) The SD card is now ready to inserted into the SD card slot on the S32V234-EVB2 SD card slot.

Create the image on SD card from ubuntu

This is a better choice for more advanced users who wish to customize the BSP.

To prepare an SD card for a Linux boot, it is necessary to connect the SD card to a machine with Linux OS. If a Linux OS machine is not available, then a virtual machine installed to a Windows OS machine may be used.

If you have access to a Linux OS machine, skip to step 4.

Procedure

1) Download and install a virtual machine

pastedImage_3.png

pastedImage_4.png

2) Download Ubuntu. This tutorial uses the Ubuntu version 14.04.5.  The image will be ubuntu-14.04.5-desktop-amd64.iso.

pastedImage_2.png

3) Launch VMware or Virtual Box and create a new virtual machine

pastedImage_4.png

Use downloaded Ubuntu image when requested for installer disc image file

pastedImage_5.png

Hit Next and select Linux as the guest operating system and select Ubuntu for the version.

pastedImage_3.png

Hit Next and name your virtual machine and specify where you want to store it.

pastedImage_4.png

Increase the disk size to 40 GB

pastedImage_6.png

Hit Finish and install VMware Tools for Linux, if asked

pastedImage_5.pngpastedImage_7.png

4) Within C:\NXP\S32DS_Vision_v2.0\S32DS\s32v234_sdk\os extract 'build_content.tar.gz', then extract 'build_content.tar' and navigate to the 'v234_linux_build' folder

pastedImage_4.png

5) Start virtual machine

pastedImage_8.png

May need to manually connect USB-mounted SD card reader

pastedImage_9.png

Log in to virtual machine

pastedImage_10.png

6) In files, go to 'Home' directory and create a folder "VSDK"

pastedImage_11.png

7) Within VSDK folder, copy the files image, u-boot.s32s32v234-evb.dtb, and rootfs.tar from the 'v234_linux_build' folder. 

Note: The file s32v234-evb.dtb and u-boot.s32 will have names with XXXXX-suffix for the schematic number printed on the evaluation board (EVB) you are using. Be sure to use the files which correspond to your EVB.

pastedImage_6.png

8) Load the card into the reader. If you are using a virtual machine, it is recommended to use a USB adapter instead of a built-in reader in the PC.

pastedImage_12.png

9) Within the virtual machine, launch the terminal program

pastedImage_13.png

10) Within the terminal program, enter command 'cat /proc/partitions' to view the names of the partitions and identify the names of the partitions on your SD card. Perhaps it is named 'sdb'.

pastedImage_14.png

11) Delete all existing partitions.

   a) Enter command 'sudo fdisk /dev/sdb'.

   b) Enter command 'd' and then the number of the partition to delete. Repeat as necessary until all partitions have been deleted

pastedImage_15.png

12) Create new partitions

   a) Enter command 'n' for new

   b) Enter 'p' (or just hit <enter>, as this is the default) for primary

   c) Enter '1' (or just hit <enter>, as this is the default) for partition number 1.

   d) Press <enter> to select the default value for the First sector

   e) Enter '+255M' to set the size

   f) Enter command 'n' again, for partition number 2, however, press <enter> to select the default value for the 'Last sector'

pastedImage_16.png

13) Set the partition type

   a) Enter command 't' for type

   b) Enter '1' for partition number 1

   c) Enter 'c' for partition type FAT32

   d) Enter command 't' again, for partition number 2, however, enter '83' for partition type LINUX

pastedImage_17.png

If you get error 16: Device or resource busy, as shown above, use commands 'umount /dev/sdb1' and 'umount /dev/sdb2' to free the pre-existing partitions.

pastedImage_18.png

Then try again and should be ok now

14) Write the new configuration, enter 'w'

pastedImage_2.png

15) Try to setup the filesystems. Enter 'sudo mkfs.vfat -n boot /dev/sdb1'. If you get the error '/dev/sdb1 contains a mounted filesystem', you will need to unmount the partition first.

pastedImage_9.png

To save time, unmount both /dev/sdb1 and /dev/sdb2. Enter 'umount /dev/sdb1' and then 'umount /dev/sdb2'

pastedImage_10.png

Now try 'sudo mkfs.vfat -n boot /dev/sdb1' again

pastedImage_11.png

16) It worked, so now enter 'sudo mkfs.ext3 -L rootfs /dev/sdb2'. It will take a minute or two for this to complete. Wait until you get the command prompt again.

pastedImage_12.png

17) Now it's time to load the BSP content from the VSDK. But first, change the directory to the one we created earlier for the BSP files. Enter 'cd /home/user/VSDK' or 'cd VSDK'.

pastedImage_13.png

Enter the following commands:

sudo dd if=u-boot.s32 of=/dev/sdb bs=512 seek=8 conv=fsync

sudo cp Image /media/user/boot

sudo cp s32v234-evb.dtb /media/user/boot

pastedImage_14.png

18) Now we need to extract the root filesystem, change the directory to its location

pastedImage_27.png

19) Enter command 'sudo tar -xvf /home/user/VSDK/rootfs.tar'

pastedImage_28.png

20) Once the files are extracted, enter command 'sync'

 

pastedImage_29.png

Now the SD card is ready to be used in the S32V234-EVB.

No ratings
Version history
Last update:
‎02-28-2019 11:09 AM
Updated by: