Skip to content

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

  1. Download and install the S32 Flash Tool.
  2. Use the Flash Tool to install the firmware binaries to the Quad Serial Peripheral Interface (QSPI) flash memory.
  3. Build or download a prebuilt AutoSD image and install it to an SD Card.
  4. 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

Build the firmware binaries

You can rebuild these Red Hat AutoSD firmware binaries from source code:

  • bl2_w_dtb.s32
  • fip.bin
  • s32g399a-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

  1. Log in to or create your My NXP account on the NXP website.

  2. Navigate BSP for S32 Microcontrollers and Processors page.

  3. Locate and download the Linux BSP archive.

  4. Scroll down to the Downloads section.

  5. 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

  6. Download the compressed archive containing the Linux BSP binaries: s32g3_linuxbsp_46.0.0_binaries.tgz.

  7. Extract the contents of the archive:

    console $ tar xvzf s32g3_linuxbsp_46.0.0_binaries.tgz

    This 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.

  8. Locate the ddr_fw_ecc_off.bin file in the s32g3_linuxbsp_46.0_binaries/s32g399ardb3 directory.

  9. Download the source code:

    console $ git clone https://gitlab.com/CentOS/automotive/rpms/s32g-vendor-boot.git $ cd s32g-vendor-boot $ ./download-sources.sh

  10. Copy the DDR firmware from the Linux BSP:

    console $ cp s32g3_linuxbsp_46.0_binaries/s32g399ardb3/ddr_fw_ecc_off.bin $PWD

  11. Copy the source code and the additional patches to the rpmbuild build environment:

    console $ mkdir -p ~/rpmbuild/SOURCES $ cp s32g-vendor-boot.tar.xz ~/rpmbuild/SOURCES/ $ cp *.patch aarch64-boards ~/rpmbuild/SOURCES/

  12. Build the package:

    console $ rpmbuild -D "ddrbin $PWD/ddr_fw_ecc_off.bin" -bb s32g-vendor-boot.spec

  13. If the system prompts you to install additional package dependencies, install the missing packages, and restart the build.

  14. Extract the firmware binaries from the RPM package:

    console $ rpm2cpio ~/rpmbuild/RPMS/s32g-vendor-boot-bsp46.0-3.fc43.aarch64.rpm | cpio -idumv

  15. 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

  1. Log in to or create your My NXP account on the NXP website.

  2. Navigate to the S32 Flash Tool for S32 Platform page.

  3. Locate and download the S32 Flash Tool package:

  4. Scroll to the Downloads section.

  5. 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

  6. Review and accept the license.

  7. Download the Linux Installer package and the Release Notes: S32FT_2.3.4_RFP_Installer.bin S32FT_2.3.4_RFP_Release_Notes.pdf

  8. 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

  1. Log in to or create your My NXP account on the NXP website.

  2. Navigate to PFE Driver + Standard Firmware.

  3. 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

  4. Extract the contents of the archive:

    console $ unzip PFE-FW_S32G_1.5.0.zip

    This action creates a new directory, PFE-FW_S32G_1.5.0, which contains the PFE Linux device driver and firmware binaries.

  5. Locate the PFE-FW_S32G_1.5.0/s32g_pfe_class.fw file.

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

  1. 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.

  2. To determine the character device to use, connect the board’s UART0 port to the machine where you installed the S32 Flash Tool. Use the S32FlashTool to determine which /dev/ttyUSBx character 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-port0

    where:

    • </dev/ttyUSBx> is the character device that you use in all subsequent commands

    Refer to the documentation in the S32FlashTool_2.3.4/doc subdirectory for more information about how to use the tool.

  3. 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.

  4. 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>

  5. Flash the bl2_w_dtb.s32 binary:

    console $ ./bin/S32FlashTool -t ./targets/S32G3xx.bin -fprogram \ -f bl2_w_dtb.s32 -addr 0x0 -i uart -p </dev/ttyUSBx>

  6. Flash the fip.bin binary containing the U-Boot secondary bootloader:

    console $ ./bin/S32FlashTool -t ./targets/S32G3xx.bin -fprogram \ -f fip.bin -addr 0xd0000 -i uart -p </dev/ttyUSBx>

  7. Flash the s32g399a-rdb3.dtb file, 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>

  8. (Optional) Flash the s32g_pfe_class.fw PFE 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

  1. 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
  2. Power cycle the board, and confirm the UART0 console boots up from the QSPI flash.

  3. 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

  4. 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

  1. Flash the AutoSD image to the SD card:

    console xzcat <my-image>.raw.xz | sudo dd of=/dev/sdX bs=4M status=progress

    where:

    • <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.

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

  2. 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

Procedure

  1. Create the build container:

    console $ aib build-builder --distro autosd10

  2. Build the disk image, setting --target to ebbr:

    console $ aib-dev build \ --distro autosd10 \ --target ebbr \ --format raw <path>/<manifest>.aib.yml \ <my-image>.img

    where:

    • <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-dev mode of Automotive Image Builder. It produces a packaged-based AutoSD image that is suitable for development and testing but not production. For production, use aib build to 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

  1. 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.

  2. 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 ~]# ```