HOWTO: Prepare A SD Card For Linux Boot Of S32V234-EVB Using BSP From VSDK

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

HOWTO: Prepare A SD Card For Linux Boot Of S32V234-EVB Using BSP From VSDK

HOWTO: Prepare A SD Card For Linux Boot Of S32V234-EVB Using BSP From VSDK

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

   b) 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.

Comments

Thanks for the tutorial. I had a doubt from step 17 onwards. It seems one of the steps is missing regarding the mount point.

Hello dakshina.dasari@gmail.com‌,

As the Vision SDK now comes with BSP image provided, this document is no longer necessary to setup your SD card. It is much simpler to just write the image. If the /media/user directory is not existing prior to step 17, then probably it is being created for you when the command sudo cp Image /media/user/boot is issued. Were you not successful in the SD card setup when you completed all of the steps?

Best Regards,

Mike

Thanks for the help @Mike Doidge . I was able to follow the instructions and bring up the board!

No ratings
Version history
Last update:
‎07-19-2017 02:22 PM
Updated by: