Flashing images on NXP S32G-VNP-RDB3
Flash AutoSD 10 on NXP S32G-VNP-RDB3 using the S32 Flash Tool¶
Install and boot AutoSD 10 on the NXP S32G Vehicle Networking Processing (VNP) Reference Design Board 3 (RDB3) equipped with an S32G3 System on Chip (SoC).
- Download and install the S32 Flash Tool.
- Use the Flash Tool to install the firmware binaries to the Quad Serial Peripheral Interface (QSPI) flash memory.
- Build or download a prebuilt AutoSD image and install it to an SD Card.
- Boot the board from the QSPI flash, which then chain-loads AutoSD from the SD Card.
Firmware binaries¶
To install AutoSD on the NXP S32G-VNP-RDB3, you need the following firmware binary files:
bl2_w_dtb.s32(Red Hat custom build)fip.bin(Red Hat custom build)s32g399a-rdb3.dtb(Red Hat custom build)s32g_pfe_class.fw(NXP PFE firmware package)
The first three binary files are specially prepared by Red Hat to boot AutoSD. If you are a Red Hat Automotive partner, you can obtain these files directly from Red Hat. Otherwise, you must build these files from source code. In both cases, you must have permission to access and download the NXP S32 Linux Board Support (BSP) packages.
To obtain s32g_pfe_class.fw, download the PFE firmware package from the NXP web site.
Next steps
- Download and install the S32 Flash Tool or build the firmware binaries from source
- Download the optional PFE firmware
Build the firmware binaries¶
You can rebuild these Red Hat AutoSD firmware binaries from source code:
bl2_w_dtb.s32fip.bins32g399a-rdb3.dtb
This build method uses the rpmbuild package building tool.
While manual building is technically possible without rpmbuild, it is not the preferred option.
If you cannot use rpmbuild, contact Red Hat.
The layout of the RPM package is subject to change. The precise placement of the firmware binaries and the device tree file might be different in the final package.
Prerequisites
- An aarch64 build machine running Fedora with internet access
Procedure
-
Log in to or create your My NXP account on the NXP website.
-
Navigate BSP for S32 Microcontrollers and Processors page.
-
Locate and download the Linux BSP archive.
-
Scroll down to the Downloads section.
-
Follow this path to the correct version:
console ➡ Automotive SW for S32G3 – Linux BSP ➡ Automotive SW - S32G - Linux BSP (Cortex-A53) ➡ SW32G3 Linux BSP version 46.0.0 -
Download the compressed archive containing the Linux BSP binaries:
s32g3_linuxbsp_46.0.0_binaries.tgz. -
Extract the contents of the archive:
console $ tar xvzf s32g3_linuxbsp_46.0.0_binaries.tgzThis action creates a new directory,
s32g3_linuxbsp_46.0_binaries, which contains the BSP binaries and prebuilt NXP Linux images organized in board-specific subdirectories. -
Locate the
ddr_fw_ecc_off.binfile in thes32g3_linuxbsp_46.0_binaries/s32g399ardb3directory. -
Download the source code:
console $ git clone https://gitlab.com/CentOS/automotive/rpms/s32g-vendor-boot.git $ cd s32g-vendor-boot $ ./download-sources.sh -
Copy the DDR firmware from the Linux BSP:
console $ cp s32g3_linuxbsp_46.0_binaries/s32g399ardb3/ddr_fw_ecc_off.bin $PWD -
Copy the source code and the additional patches to the
rpmbuildbuild environment:console $ mkdir -p ~/rpmbuild/SOURCES $ cp s32g-vendor-boot.tar.xz ~/rpmbuild/SOURCES/ $ cp *.patch aarch64-boards ~/rpmbuild/SOURCES/ -
Build the package:
console $ rpmbuild -D "ddrbin $PWD/ddr_fw_ecc_off.bin" -bb s32g-vendor-boot.spec -
If the system prompts you to install additional package dependencies, install the missing packages, and restart the build.
-
Extract the firmware binaries from the RPM package:
console $ rpm2cpio ~/rpmbuild/RPMS/s32g-vendor-boot-bsp46.0-3.fc43.aarch64.rpm | cpio -idumv -
Copy the following binaries to a directory in your working directory:
console $ cd usr/share/s32g-vendor-boot/ $ cp fdts/s32g399a-rdb3.dtb </to/some/work/dir/> $ cp s32g399ardb3_qspi/s32g399ardb3/release/bl2_w_dtb.s32 </to/some/work/dir/> $ cp s32g399ardb3_qspi/s32g399ardb3/release/fip.bin </to/some/work/dir/>where:
</to/some/work/dir/>is your working directory
Download and install the S32 Flash Tool¶
S32 Flash Tool is a flash programming utility used to transfer binary files in flash and RAM memory over standard communication interfaces like UART, Ethernet, and CAN.
Prerequisites
- An aarch64 build machine running Fedora with internet access
Procedure
-
Log in to or create your My NXP account on the NXP website.
-
Navigate to the S32 Flash Tool for S32 Platform page.
-
Locate and download the S32 Flash Tool package:
-
Scroll to the Downloads section.
-
Follow this path to the latest S32 Flash tools:
console ➡ S32 Flash Tool 2.3.3 – Windows/Linux S32 ➡ Flash Tool for public devices 2.3.4 RFP -
Review and accept the license.
-
Download the Linux Installer package and the Release Notes:
S32FT_2.3.4_RFP_Installer.binS32FT_2.3.4_RFP_Release_Notes.pdf -
Refer to the S32 Flash Tool Release Notes for instructions on how to unpack and install the S32 Flash Tool.
Download PFE firmware (optional)¶
The optional Packet Forwarding Engine (PFE) is a programmable network accelerator that accelerates packet routing with minimal CPU load. Its embedded network packet processor executes a specific firmware binary.
Enabling the PFE functionality also requires the manual installation of the NXP PFE kernel device driver (the steps for which are outside the scope of this procedure). Without both the firmware and the driver installed, the PFE function will not be available.
Prerequisites
- The NXP PFE kernel device driver
- An aarch64 build machine running Fedora with internet access
Procedure
-
Log in to or create your My NXP account on the NXP website.
-
Navigate to PFE Driver + Standard Firmware.
-
Select the latest version of the S32G PFE Firmware Standard package (1.5) and download the compressed archive containing the PFE firmware binaries:
PFE-FW_S32G_1.5.0.zip -
Extract the contents of the archive:
console $ unzip PFE-FW_S32G_1.5.0.zipThis action creates a new directory,
PFE-FW_S32G_1.5.0, which contains the PFE Linux device driver and firmware binaries. -
Locate the
PFE-FW_S32G_1.5.0/s32g_pfe_class.fwfile.
Flash the firmware to QSPI¶
Flash the firmware binaries to the internal QSPI flash memory using the S32 Flash Tool to upload them to the NXP S32G-VNP-RDB3 and copy them to the flash memory.
Prerequisites
- An NXP S32G-VNP-RDB3 equipped with an S32G3 SoC
Procedure
-
Set the board Dual In-Line Package (DIP) switches to Serial Boot Mode:
Settings SW3 SW4[1:8] SW5[1:8] SW6[1:8] SW7[1:8] SW8 SW9 SW10 Serial 1 00000010 00000000 00000000 00000100 1 00 00 Refer to the S32G-VNP-RDB3 User Guide and S32G3 Linux BSP 46 Quick Start documents for more information about switch settings.
-
To determine the character device to use, connect the board’s
UART0port to the machine where you installed the S32 Flash Tool. Use theS32FlashToolto determine which/dev/ttyUSBxcharacter device is required to communicate with the board:console $ cd /path/to/S32FlashTool_2.3.4 $ ./bin/S32FlashTool -i uart -p \?The following message displays:
console List of found UART ports: </dev/ttyUSBx>,usb-FTDI_FT232R_USB_UART_AU0426M6-if00-port0where:
</dev/ttyUSBx>is the character device that you use in all subsequent commands
Refer to the documentation in the
S32FlashTool_2.3.4/docsubdirectory for more information about how to use the tool. -
Confirm that the board is set to Serial Boot Mode by uploading a test application:
console $ ./bin/S32FlashTool -t ./targets/S32G3xx.bin \ -ping -i uart -p </dev/ttyUSBx>If the board is correctly set to Serial Boot Mode, the following message is displayed:
console Checking connection ... Board is connected. -
Upload
MX25UW51245G.bin, an application that implements general I/O functions for operating with flash-device-specific functions:console $ ./bin/S32FlashTool -t ./targets/S32G3xx.bin \ -a ./flash/MX25UW51245G.bin -i uart -p </dev/ttyUSBx> -
Flash the
bl2_w_dtb.s32binary:console $ ./bin/S32FlashTool -t ./targets/S32G3xx.bin -fprogram \ -f bl2_w_dtb.s32 -addr 0x0 -i uart -p </dev/ttyUSBx> -
Flash the
fip.binbinary containing the U-Boot secondary bootloader:console $ ./bin/S32FlashTool -t ./targets/S32G3xx.bin -fprogram \ -f fip.bin -addr 0xd0000 -i uart -p </dev/ttyUSBx> -
Flash the
s32g399a-rdb3.dtbfile, which contains the device tree that describes the hardware platform to U-Boot and to the Linux kernel:console $ ./bin/S32FlashTool -t ./targets/S32G3xx.bin -fprogram \ -f s32g399a-rdb3.dtb -addr 0x1380000 -i uart -p </dev/ttyUSBx> -
(Optional) Flash the
s32g_pfe_class.fwPFE firmware binary:console $ ./bin/S32FlashTool -t ./targets/S32G3xx.bin -fprogram \ -f s32g_pfe_class.fw -addr 0x32c0000 -i uart -p </dev/ttyUSBx>
Configure the QSPI boot¶
Configure QSPI boot mode so that the S32G-VNP-RDB3 boots from the QSPI flash memory. The firmware flashed to the QSPI flash initializes the hardware, then U-Boot chain-loads AutoSD from the SD card.
Prerequisites
- An NXP S32G-VNP-RDB3 equipped with an S32G3 SoC
Procedure
-
Set the board DIP switches to QSPI Boot Mode as follows:
Settings SW3 SW4[1:8] SW5[1:8] SW6[1:8] SW7[1:8] SW8 SW9 SW10 QSPI 1 00110000 00000000 00000000 00000100 1 00 10 -
Power cycle the board, and confirm the UART0 console boots up from the QSPI flash.
-
Interrupt the boot process and access the U-Boot prompt by pressing any key when you see the following message:
Hit any key to stop autoboot: 2 -
From the U-Boot prompt, update the default boot command in the U-Boot environment:
console => setenv bootcmd "sf probe 6:0; mtd read DTB ${fdt_addr}; load mmc 0:1 ${loadaddr} /EFI/BOOT/BOOTAA64.EFI; bootefi ${loadaddr} ${fdt_addr}" => saveenv
Install AutoSD on an SD Card¶
Prerequisites
- A prebuilt or custom AutoSD image for NXP S32G-VNP-RDB3
- An aarch64 build machine running Fedora with internet access
Procedure
-
Flash the AutoSD image to the SD card:
console xzcat <my-image>.raw.xz | sudo dd of=/dev/sdX bs=4M status=progresswhere:
<my-image>is the name of your image
Next steps
Download a prebuilt AutoSD image¶
Download the latest prebuilt AutoSD 10 image from the AutoSD nightly image repository. These images comply with the Arm Embedded Base Boot Requirements (EBBR) specification and are updated nightly.
-
Identify the latest nightly EBBR image:
console $ latest=$(curl -s 'https://autosd.sig.centos.org/AutoSD-10/nightly/EBBR/?C=M;O=D' | sed -n \ 's|.*href=".*\(auto-osbuild-ebbr[^"]*\.raw\.xz\)".*|\1|p' | head -n1) -
Download the image from the Automotive SIG nightly builds repository:
console $ wget "https://download.autosd.sig.centos.org/AutoSD-10/nightly/EBBR/$latest"
Next steps
Build an AutoSD image for NXP S32G-VNP-RDB3¶
To build a custom AutoSD image, use Automotive Image Builder, which is available in the
automotive-image-builder repository.
Prerequisites
- An AArch64 host machine running CentOS Stream, Fedora, or RHEL with internet access
- Podman
- Automotive Image Builder installed as an RPM or run as a container
- A custom manifest that adheres to the conventions described in Automotive Image Builder manifests, as demonstrated by the sig-docs/demos
Procedure
-
Create the build container:
console $ aib build-builder --distro autosd10 -
Build the disk image, setting
--targettoebbr:console $ aib-dev build \ --distro autosd10 \ --target ebbr \ --format raw <path>/<manifest>.aib.yml \ <my-image>.imgwhere:
<path>/<manifest>is the path to your manifest file, for example:examples/simple.aib.yml
<my-image>is the name of your image
Note
This command is
aib-devmode of Automotive Image Builder. It produces a packaged-based AutoSD image that is suitable for development and testing but not production. For production, useaib buildto immutable, atomically updatable container image.
Next steps
Additional resources
Boot AutoSD on NXP S32G-VNP-RDB3¶
Prerequisites
- An NXP S32G-VNP-RDB3 equipped with an S32G3 SoC
- An SD card flashed with a prebuilt or custom AutoSD image for NXP S32G-VNP-RDB3
Procedure
-
Insert the AutoSD SD card, and then power on the board.
The NXP S32G-VNP-RDB3 board boots from the QSPI flash. The firmware flashed to the QSPI flash initializes the hardware, then U-Boot chain-loads AutoSD from the SD card.
-
Log in using the ‘root’ user name and ‘password’ password:
```console Automotive Stream Distribution 10 Kernel 6.12.0-rt on an aarch64
localhost login: root Password: password [root@localhost ~]# ```