👹
Carlos's Tech Blog
  • 🧔ECUs
    • ZYNQ_Documents
      • [ZYNQ] 构建ZYNQ的BSP工程
      • [ZYNQ] 启动流程
      • [ZYNQ] Secure Boot Flow
      • [ZYNQ] Provisioning Guideline
      • [ZYNQ] Decrypting Partition by the Decrypt Agent Using PUF key
      • [ZYNQ] enabling the cryptsetup on ramdisk
      • [ZYNQ] Encrypt external files based on file system using PUF key
      • [ZYNQ] Loading an Encrypted Linux kernel at U-Boot with a KUP Key
      • [ZYNQ] cross-compile the cryptsetup on Xilinx ZYNQ aarch64 platform
      • [ZYNQ] Linux Linaro系统镜像制作SD卡启动
    • S32G_Documents
      • [S32G] Going through the s32g hard/soft platform
      • [S32G] S32g247's Secure Boot using HSE firmware
        • S32g2 HSE key config
        • How S32g verify secure boot image
        • S32g secure boot signature generation
        • How to download and build S32g Secure boot image
        • [S32G] OTA with Secure Boot
    • RT117x_Documents
      • [RT-117x]IMX RT1170 Provisioning Guideline
      • [RT-117x] Going through the MX-RT1170 hard/soft platform
      • [RT-117x] i.MX-RT1170's Secure Boot
        • [RT-117x]Signing image with the HSM (SignServer)
    • LS104x_Documents
      • [LS104x] bsp project
      • [LS104x] boot flow
      • [LS104x] secure boot
      • [LS104x] Application Note, Using the PKCS#11 in TCU platform
      • [LS104x] 使用ostree更新rootfs
      • [LS104x] ostree的移植
      • [LS104x] Starting with Yocto
      • [LS104x] 使用FIT的kernel格式和initramfs
    • IMX6/8_Documents
      • [IMX6] Defining A U-Boot Command
      • NXP IMX6 嵌入式板子一些笔记
      • NXP-imx6 initialization
    • Vehicle_Apps
      • [SecOC] Tree
        • [SecOC] SecOC Freshness and MAC Truncation
  • 😾TECH
    • Rust Arm OS
      • ARMv7m_Using_The_RUST_Cross_Compiler
    • ARM
      • ARM-v7-M
        • 01_ARMv7-M_处理器架构技术综述
        • 02_ARMv7-M_编程模型与模式
        • 03_ARMv7-M_存储系统结构
        • 04_ARMv7-M_异常处理及中断处理
      • ARM-v8-A
        • 02_ARMv8_基本概念
        • 03_ARMv8_指令集介绍_加载指令集和存储指令集
        • 04_ARMv8_指令集_运算指令集
        • 05_ARMv8_指令集_跳转_比较与返回指令
        • 06_ARMv8_指令集_一些重要的指令
        • 0X_ARMv8_指令集_基于汇编的UART驱动
        • 07_ARMv8_汇编器Using as
        • 08_ARMv8_链接器和链接脚本
        • 09_ARMv8_内嵌汇编(内联汇编)Inline assembly
        • 10_ARMv8_异常处理(一) - 入口与返回、栈选择、异常向量表
        • 11_ARMv8_异常处理(二)- Legacy 中断处理
        • 12_ARMv8_异常处理(三)- GICv1/v2中断处理
        • 13_ARMv8_内存管理(一)-内存管理要素
        • 14_ARMv8_内存管理(二)-ARM的MMU设计
        • 15_ARMv8_内存管理(三)-MMU恒等映射及Linux实现
        • 16_ARMv8_高速缓存(一)cache要素
        • 17_ARMv8_高速缓存(二)ARM cache设计
        • 18_ARMv8_高速缓存(三)多核与一致性要素
        • 19_ARMv8_TLB管理(Translation Lookaside buffer)
        • 20_ARMv8_barrier(一)流水线和一致性模型
        • 21_ARMv8_barrier(二)内存屏障案例
      • ARM Boot Flow
        • 01_Embedded_ARMv7/v8 non-secure Boot Flow
        • 02_Embedded_ARMv8 ATF Secure Boot Flow (BL1/BL2/BL31)
        • 03_Embedded_ARMv8 BL33 Uboot Booting Flow
      • ARM Compiler
        • Compiler optimization and the volatile keyword
      • ARM Development
        • 在MACBOOK上搭建ARMv8架构的ARM开发环境
        • Starting with JLink debugger or QEMU
    • Linux
      • Kernel
        • 0x01_LinuxKernel_内核的启动(一)之启动前准备
        • 0x02_LinuxKernel_内核的启动(二)SMP多核处理器启动过程分析
        • 0x21_LinuxKernel_内核活动(一)之系统调用
        • 0x22_LinuxKernel_内核活动(二)中断体系结构(中断上文)
        • 0x23_LinuxKernel_内核活动(三)中断体系结构(中断下文)
        • 0x24_LinuxKernel_进程(一)进程的管理(生命周期、进程表示)
        • 0x25_LinuxKernel_进程(二)进程的调度器的实现
        • 0x26_LinuxKernel_设备驱动(一)综述与文件系统关联
        • 0x27_LinuxKernel_设备驱动(二)字符设备操作
        • 0x28_LinuxKernel_设备驱动(三)块设备操作
        • 0x29_LinuxKernel_设备驱动(四)资源与总线系统
        • 0x30_LinuxKernel_设备驱动(五)模块
        • 0x31_LinuxKernel_内存管理(一)物理页面、伙伴系统和slab分配器
        • 0x32_LinuxKernel_内存管理(二)虚拟内存管理、缺页与调试工具
        • 0x33_LinuxKernel_同步管理_原子操作_内存屏障_锁机制等
        • 01_LinuxDebug_调试理论和基础综述
      • Userspace
        • Linux-用户空间-多线程与同步
        • Linux进程之间的通信-管道(上)
        • Linux进程之间的通信-管道(下)
        • Linux进程之间的通信-信号量(System V)
        • Linux进程之间的通信-内存共享(System V)
        • Linux进程之间的通信-消息队列(System V)
        • Linux应用调试(一)方法、技巧和工具 - 综述
        • Linux应用调试(二)工具之coredump
        • Linux应用调试(三)工具之Valgrind
        • Linux机制之内存池
        • Linux机制之对象管理和引用计数(kobject/ktype/kset)
        • Linux机制copy_{to, from}_user
        • Linux设备树 - DTS语法、节点、设备树解析等
        • Linux System : Managing Linux Services - inittab & init.d
        • Linux System : Managing Linux Services - initramfs
      • Kernel Examples
        • Linux Driver - GPIO键盘驱动开发记录_OMAPL138
        • 基于OMAPL138的Linux字符驱动_GPIO驱动AD9833(一)之miscdevice和ioctl
        • 基于OMAPL138的Linux字符驱动_GPIO驱动AD9833(二)之cdev与read、write
        • 基于OMAPL138的字符驱动_GPIO驱动AD9833(三)之中断申请IRQ
        • Linux内核调用SPI驱动_实现OLED显示功能
        • Linux内核调用I2C驱动_驱动嵌套驱动方法MPU6050
    • OPTEE
      • 01_OPTEE-OS_基础之(一)功能综述、简要介绍
      • 02_OPTEE-OS_基础之(二)TrustZone和ATF功能综述、简要介绍
      • 03_OPTEE-OS_系统集成之(一)编译、实例、在QEMU上执行
      • 05_OPTEE-OS_系统集成之(三)ATF启动过程
      • 06_OPTEE-OS_系统集成之(四)OPTEE镜像启动过程
      • 07_OPTEE-OS_系统集成之(五)REE侧上层软件
      • 08_OPTEE-OS_系统集成之(六)TEE的驱动
      • 09_OPTEE-OS_内核之(一)ARM核安全态和非安全态的切换
      • 10_OPTEE-OS_内核之(二)对安全监控模式的调用的处理
      • 11_OPTEE-OS_内核之(三)中断与异常的处理
      • 12_OPTEE-OS_内核之(四)对TA请求的处理
      • 13_OPTEE-OS_内核之(五)内存和cache管理
      • 14_OPTEE-OS_内核之(六)线程管理与并发
      • 15_OPTEE-OS_内核之(七)系统调用及IPC机制
      • 16_OPTEE-OS_应用之(一)TA镜像的签名和加载
      • 17_OPTEE-OS_应用之(二)密码学算法和安全存储
      • 18_OPTEE-OS_应用之(三)可信应用的开发
      • 19_OPTEE-OS_应用之(四)安全驱动开发
      • 20_OPTEE-OS_应用之(五)终端密钥在线下发系统
    • Binary
      • 01_ELF文件_目标文件格式
      • 02_ELF文件结构_浅析内部文件结构
      • 03_ELF文件_静态链接
      • 04_ELF文件_加载进程虚拟地址空间
      • 05_ELF文件_动态链接
      • 06_Linux的动态共享库
      • 07_ELF文件_堆和栈调用惯例以ARMv8为例
      • 08_ELF文件_运行库(入口、库、多线程)
      • 09_ELF文件_基于ARMv7的Linux系统调用原理
      • 10_ELF文件_ARM的镜像文件(.bin/.hex/.s19)
    • Build
      • 01_Script_makefile_summary
    • Rust
      • 02_SYS_RUST_文件IO
    • Security
      • Crypto
        • 1.0_Security_计算机安全概述及安全需求
        • 2.0_Security_随机数(伪随机数)
        • 3.0_Security_对称密钥算法加解密
        • 3.1_Security_对称密钥算法之AES
        • 3.2_Security_对称密钥算法之MAC(CMAC/HMAC)
        • 3.3_Security_对称密钥算法之AEAD
        • 8.0_Security_pkcs7(CMS)_embedded
        • 9.0_Security_pkcs11(HSM)_embedded
      • Tools
        • Openssl EVP to implement RSA and SM2 en/dec sign/verify
        • 基于Mac Silicon M1 的OpenSSL 编译
        • How to compile mbedtls library on Linux/Mac/Windows
    • Embedded
      • eMMC启动介质
  • 😃Design
    • Secure Boot
      • JY Secure Boot Desgin
    • FOTA
      • [FOTA] Module of ECUs' FOTA unit design
        • [FOTA] Tech key point: OSTree Deployment
        • [FOTA] Tech key point: repositories role for onboard
        • [FOTA] Tech key point: metadata management
        • [FOTA] Tech key point: ECU verifying and Decrpting
        • [FOTA] Tech key point: time server
      • [FOTA] Local-OTA for Embedded Linux System
    • Provisioning
      • [X-Shield] Module of the Embedded Boards initialization
    • Report
由 GitBook 提供支持
在本页
  • 1. Hardware
  • 1.1 Components layout
  • 2. Software
  • 2.1 Software Arch
  • 2.2 Tools
  • 2.3 Linux BSP Build
  • 2.4 Boot Flow
  1. ECUs
  2. S32G_Documents

[S32G] Going through the s32g hard/soft platform

上一页S32G_Documents下一页[S32G] S32g247's Secure Boot using HSE firmware

最后更新于1年前

1. Hardware

1.1 Components layout

1.1.1 S32G274RDB2

The reference board quick guide is shown in the link: .

1.1.2 S32G274EVB

When the S32G-PROCEVB3-S is stacked on the S32GRV-PLATEVB: Jumper J96 on the S32G-PROCEVB3-S should be in position 1-2, Only the S32GRVPLATEVB needs to be powered. Connect the power supply to the 12 V power jack P3 on S32GRV-PLATEVB.

1. Open Minicom on Linux Host. 2. Select the serial port to which the micro USB J58 of the S32G-PROCEVB3-S is connected and click OK. 3. Switch on the power switch SW1 on the S32GRV-PLATEVB and power switch SW10 on the S32G-PROCEVB3-S.

Booting from the SD card using serial RCON mode

2. Software

S32G2 vehicle network processors combine ASIL D safety, hardware security, high-performance real-time and application processing, and network acceleration. S32G2 supports the needs of new vehicle architectures: service-oriented gateways, domain controllers, zonal processors, safety processors, and more.

2.1 Software Arch

Quad Arm® Cortex®-A53 cores with Arm Neon™ technology are organized in two clusters of two cores with optional cluster lockstep for applications and services. Triple Arm Cortex-M7 lockstep cores for real-time applications. Hardware Security Engine (HSE) for secure boot and accelerated security services

2.2 Tools

Offered software support enables the S32G2 features running on the Arm Cortex-M7 and Cortex-A53, plus the accelerators. Explore the vast available software solutions to help users build their applications.

Tools

Reference Software

Standard Software

Premium Software

Integration Reference Examples Cortex-A53 Cortex-M7

S32G Board Diagnostic Tests

  • Increased key count

  • IDPS capability

  • IPsec

  • Customization services

2.3 Linux BSP Build

NXP Automotive Linux BSP follows the general layout of a BSP, containing bootloaders, Linux kernel and root file system, which can include various libraries and middleware, and sample applications. The objective is to enable more hardware platforms, to build on top of the NXP Automotive Linux BSP in order to add additional components like drivers, middleware or applications.

2.3.1 Components

This section contains a description of the NXP Automotive Linux BSP features covered by the following main components:

  • Firmware: Non-open-source firmware binaries - prerequisites for S32 accelerators support

    • PFE Firmware

    • HSE Firmware

    • LLCE Firmware

  • Bootloader

    • Arm Trusted Firmware

    • U-Boot

  • Linux Kernel

  • Root file system

  • Technologies

    • Virtualization

    • Power Management

    • Crypto, Security, and OP-TEE

  • Yocto Project-based distribution

    • Yocto root file system and Ubuntu-compatible root file system

    • Middleware and Stacks

    • Adaptive AUTOSAR Platform Demonstrator

2.3.2 BSP compiling

Download BSP

NOTE,

$: mkdir ~/bin
$: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo  > ~/bin/repo
$: chmod a+x ~/bin/repo
$: PATH=${PATH}:~/bin
$: mkdir fsl-auto-yocto-bsp
$: cd fsl-auto-yocto-bsp
$: repo init -u https://github.com/nxp-auto-linux/auto_yocto_bsp.git -b release/bsp36.0
$: repo sync -j16

Build All

Build YOCTO

$: ./sources/meta-alb/scripts/host-prepare.sh
$: source nxp-setup-alb.sh -m <machine>  # s32g274aevb,s32g254aevb,s32g233aevb,s32g274ardb2;
$: bitbake fsl-image-base

When this is done, a bitbake <imagename>, e.g. would be enough to completely build U-Boot, kernel, modules, the TF-A and a rootfs ready to be deployed. Look for a build result in <builddirectory>/tmp/deploy/images/. (Note, no optee-os in default). The user root with no password.

$: ./sources/meta-alb/scripts/host-prepare.sh
$: source nxp-setup-alb.sh -m s32g274aevbubuntu # s32g274aevbubuntu,s32g274ardb2ubuntu,s32g254aevbubuntu,s32g233aevbubuntu;
$: bitbake fsl-image-ubuntu-base

If targeting Ubuntu-18.04 images, add the following line in <builddirectory>/conf/local.conf. After deploying a Ubuntu image and booting the platform, please use the following credentials to log in:

  • user: bluebox

  • password: bluebox

Building OP-TEE OS Image

OP-TEE can be built and deployed by editing <builddirectory>/conf/local.conf and appending the following line:

DISTRO_FEATURES_append += "optee"

Building Images with M7 as Boot Target

Cortex-M7 booting flow is provided as an example for enabling lockstep operation mode. It is enabled by editing <builddirectory>/conf/local.conf and appending the following line

DISTRO_FEATURES_append += "m7boot"

When Cortex-M7 booting flow is enabled, the generated SD card or flash images can be used in the same way as for the default Cortex-A53 booting flow. These images include all the needed changes:

  • Image Vector Table (IVT) updates (In case IVT files needs to be deployed manually)

  • addition of Cortex-M7 software

when Cortex-M7 booting flow is enabled the files with .m7 (e.g. fip.m7) extensions should be used.

Manually Build Components

Toolchains

Once you have downloaded the toolchain package, in order to install it, you just need to untar it in a directory of your choice.

U-Boot

git clone git@github.com:nxp-auto-linux/u-boot.git
cd u-boot
git checkout bsp36.0-2022.04
ls
make CROSS_COMPILE=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu- <board>_defconfig
make CROSS_COMPILE=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu-

The values of <board> are given as in the following:

  • s32g274aevb using Memory Card, board is s32g2xxaevb

  • s32g274aevb using QSPI, board is s32g2xxaevb_qspi

  • s32g274ardb2 using Memory Card, board is s32g274ardb2

  • s32g274ardb2 using QSPI, board is s32g274ardb2_qspi

These commands should generate the U-Boot image with Program data (u-boot-nodtb.bin).

For OPTEE-OS:

While building U-Boot, one must make sure that CONFIG_OPTEE=y is set.

For s32g274aevb memory card, vim configs/s32g2xxaevb_defconfig

Linux Kernel

git clone git@github.com:nxp-auto-linux/linux.git
cd linux 
git checkout bsp36.0-5.15.85-rt
ls
make ARCH=arm64 CROSS_COMPILE=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu- s32cc_defconfig
make ARCH=arm64 CROSS_COMPILE=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu- -j16

For s32g274aevb, s32g254aevb, s32g233aevb, s32g274ardb2: s32gen1_defconfig.

This command should generate the kernel binary (Image) in arch/arm64/boot and the board device tree blobs (e.g.`32g2xx-evb.dtb` ...) in arch/arm64/boot/dts/freescale/

For OPTEE-OS:

Building Linux requires to be set.

CONFIG_TEE=y 
CONFIG_OPTEE=y
CONFIG_OPTEE_SHM_NUM_PRIV_PAGES=256
CONFIG_HAVE_ARM_SMCCC=y

OP-TEE

Certain configurations must be enabled for both U-Boot and Linux so that OP-TEE can communicate with Linux and allow user space applications to call for TAs execution.

Prerequisites:

sudo apt-get install python3-pip

pip3 install pyelftools pycryptodomex

Follow these steps to build optee_os:

git clone git@github.com:nxp-auto-linux/optee_os.git cd optee_os git checkout bsp36.0-3.18 make CROSS_COMPILE64=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu- PLATFORM=s32 \PLATFORM_FLAVOR=s32g2

The above steps should create the following two binary images:

  • out/arm-plat-s32/core/tee-header_v2.bin

  • out/arm-plat-s32/core/tee-pager_v2.bin

Since OP-TEE can only boot with TF-A support, these two binaries must be included in the FIP image generated when building the TF-A. For the FIP image, please refer to the next section.

OPTEE_Client

$ git clone git@github.com:OP-TEE/optee_client.git
$ cmake -DCMAKE_C_COMPILER=aarch64-none-linux-gnu-gcc -DCMAKE_INSTALL_PREFIX=`pwd`/out
$ make
$ make install

OPTEE_Example

Build the Host Application of hello_world example:

$ git clone https://github.com/linaro-swg/optee_examples.git
$ cd optee_examples/hello_world/host
 make CROSS_COMPILE=aarch64-linux-gnu- \
      TEEC_EXPORT=$(OPTEE_PATH)/optee_client/out/ \
      --no-builtin-variables
$ make install

After build completed, the Host Application image “optee_example_hello_world” can be found in “hello_world/host” folder.

Build the Trusted Application of hello_world example:

$ cd optee_examples/hello_world/ta
$ make CROSS_COMPILE=aarch64-linux-gnu- \
       TA_DEV_KIT_DIR=$(OPTEE_PATH)/optee_os/out/arm-plat-nuvoton/exportta_arm64

After build completed, the Trusted Application image “8aaaf200-2450-11e4-abe2-0002a5d5c51b.ta” can be found in “hello_world/ta” folder. “8aaaf200-2450-11e4-abe2-0002a5d5c51b” is the UUID of hello_world Trusted Application. The UUID is defined in “hello_world/ta/hello_world_ta.h”. When running Host Application, it can use this UUID to request OP-TEE to launch this TA.

To run an OP-TEE application, besides have the running OP-TEE OS, you should have teesupplication, the Trusted Application, and the Host Application. The Trusted Application will be loaded by tee-supplicant, and the default path is “rootfs/lib/optee_armtz” folder.

Do the following steps. First, copy the tee-supplicant to rootfs:

$ cp $(OPTEE_PATH)/optee_client/out/tee-supplicant/tee-supplicant rootfs/usr/bin

Copy the Host Application to rootfs:

$ cp $(OPTEE_PATH)/optee_examples/hello_world/host/optee_example_hello_world rootfs/usr/bin

Copy the Trusted Application to tee-supplicant known default folder:

$ cp $(OPTEE_PATH)/optee_examples/hello_world/ optee_examples/hello_world/ta/8aaaf200-2450-11e4-abe2-0002a5d5c51b.ta rootfs/lib/optee_armtz

Copy the OP-TEE client API library to rootfs:

$ cp $(OPTEE_PATH)/optee_client/out/export/usr/lib/libteec.so.1 rootfs/lib

Above should include all necessary components to run the OP-TEE application. Before running the OP-TEE application, you should have the tee-supplicant running in background. Such that, it can help OP-TEE to load the Trusted Application from “rootfs/lib/optee_armtz” folder.

$ /usr/bin/tee-supplicant &

Finally, you can run the hello_world example:

$ /usr/bin/optee_example_hello_world

ARM Trusted Firmware

sudo apt-get install libssl-dev openssl

dtc --version shall be more than 1.4.6

sudo apt-get install device-tree-compiler

Before building the TF-A, please note: The TF-A blob being built is a FIP image that contains both the TF-A boot stages and the U-Boot binary. Because of that, the TF-A build process depends on U-Boot being available and optionally optee_os. To that end, the BL33 parameter to the make command-line must be the path to the u-boot-nodtb.bin located in the directory where U-Boot has been built as part of the prerequisites. BL32 must be the path to the tee-header_v2.bin and BL32_EXTRA1 must be the path to the tee-pager_v2.bin, both located in the directory where optee_os has been built as part of the prerequisites.

Follow these steps to build the TF-A:

git clone git@github.com:nxp-auto-linux/arm-trusted-firmware.git
cd arm-trusted-firmware
git checkout bsp36.0-2.5
# For default TF-A FIP image (without OPTEE-os)
make CROSS_COMPILE=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu- \
ARCH=aarch64 PLAT=<plat> BL33=<path-to-u-boot-nodtb.bin>

# For OPTEE-OIS & TF-A image
make CROSS_COMPILE=/path/to/your/toolchain/dir/bin/aarch64-none-linux-gnu- \
ARCH=aarch64 PLAT=<plat> BL33=<path-to-u-boot-nodtb.bin> \
BL32=<path-to-tee-header_v2.bin> \
BL32_EXTRA1=<path-to-tee-pager_v2.bin> SPD=opteed

Depending on the target board, <plat> must be replaced with:

  • s32g274aevb: <plat> is s32g2xxaevb

  • s32g274ardb2: <plat> is s32g274ardb2

Deploy build//release/fip.s32 to the sdcard.

# Skip the partition table from the SD card and copy the rest of the fip image
# (TF-A and U-Boot).
# Presumably, if you are doing these steps, you are using a pre-partitioned SD card
# on which you are only replacing the TF-A and/or U-Boot image which you have manually built.
sudo dd if=<path/to/fip.s32> of=/dev/<sdcard_dev> skip=512 seek=512 \
        iflag=skip_bytes oflag=seek_bytes conv=fsync,notrunc

Note, if the boot target is M7, TF-A can be configured for a different memory layout. TF-A can read FIP image from a configurable location. For more information, please refer to the BSP user manual (3.2.4.1 Custom Build Parameters).

2.3.3 BSP burning

This chapter describes the steps to prepare an SD/MMC card and boot up for S32G2 EVB and S32G274A RDB2 boards. The boot modes of above boards are controlled by the boot configuration DIP switches and jumpers on the board.

2.3.3.1 Image Layout

The space between 0x0 and 0x1d_3000 is occupied by some or all of the following components:

  • IVT

  • QSPI Parameters

  • DCD

  • HSE_FW

  • SYS_IMG

  • Application Boot Code Header

  • TF-A FIP image

For SD/eMMC the partitioned space begins at 0x1d_3000.

For QSPI, the region after 0x1d_3000 is organized as follows:

  • Kernel [0x01f_0000 : 0x0ef_ffff]

  • FDT [0x0ff_0000 : 0x10e_ffff]

  • Ramdisk [0x10f_0000 : 0x2ff_ffff]

  • PFE Firmware [0x300_0000 : ]

2.3.3.2 SD Burning

Information found here describes the steps to prepare an SD/MMC card to boot up for S32G2 EVB and S32G274A RDB2 boards. The supported SD classes for SD are 4 and 10.

sudo dd if=./fsl-image-base-s32g274aevb.sdcard of=${DEVSD} bs=1M && syn

2.3.3.3 manually copy BSP binaries into the SD Card

Our SD Card will be split into two main partitions:

  • One for the kernel and board device tree blob;

  • Another for the root file system that will run on the board.

sudo mkfs.vfat -n boot ${DEVSD}1
sudo mkfs.ext3 -L rootfs ${DEVSD}2

Run the following commands to copy the necessary binaries onto an SD Card:

export SD_MOUNT_POINT=/media/public
cd <builddirectory>/tmp/deploy/images/<board_name>
sudo dd if=fip.s32 of=${DEVSD} conv=notrunc,fsync seek=512 skip=512 oflag=seek_bytes iflag=skip_bytes
sudo cp Image ${SD_MOUNT_POINT}/boot/
sudo cp <dtb_file> ${SD_MOUNT_POINT}/boot/<dtb_file>
sudo tar xf <rootfs> -C ${SD_MOUNT_POINT}/rootfs
sync

Unmount the file systems and eject cleanly the SD card.

Please note:

For some old EVB boards. there is a bit diff offset layout in the fip.s32:

  • Fixing offset by:

sudo dd if=fip.s32 of=fip_no_ivt.s32 bs=1 skip=4096 seek=0 count=256 conv=notrunc

  • Burning offset:

sudo dd if=fip_no_ivt.s32 of=/dev/sda conv=notrunc,fsync seek=0 bs=256 count=1 && sync && sudo dd if=fip_no_ivt.s32 of=/dev/sda conv=notrunc,fsync seek=1 bs=512 skip=1 && sync

2.4 Boot Flow

he secure boot is enabled in the default configuration of the Bootloader. For the First time boot after image deployment on S32G2, the secure boot is not enabled, it means, the BOOT_SEQ in the IVT is set to zero. When the bootloader runs for the first time, it detect this condition and configures the HSE for secure boot and then set BOOT_SEQ=1. After setting BOOT_SEQ=1, the bootloader issues a functional reset. For every following boot, secure boot is enabled.

The following figures show S32G2 boot flow examples for both non-secure and secure boot.

2.4.1 IVT image

The Image Vector Table (IVT) image is a set of pointers to other images which are required by the BootROM. It typically contains the following images, though not all are required to create a valid IVT image:

  • DCD

  • Self-Test DCD

  • HSE

  • Application Bootloader

The IVT Tool enables the configuration and generation of the IVT image as specified in the BootROM reference manual.

The reference board quick guide is shown in the link:

Including Config Tools

Host PC Real-Time Debugging Tool

Cortex®-A53

Cortex®-A53

Cortex-M7

Cortex-M7

Cortex-M7

Cortex-M7 Including EB tresos Studio

Cortex-M7

Cortex-A53 Cortex-M7

NDA required

NDA required

Cortex-A53 Cortex-M7 Safety concept implementation

Cortex-A53

For more information about the BSP, please refer to the link

You can get the Linux BSP from the . The NXP official website provides documents, a BSP project tarball, and a license, which can be downloaded freely.

NXP’s code center has been dropped. All the bsp code is hosted on the github . Please note that the newest NXP’s BSP user manual still use the .

This Linux BSP has been built and tested using GCC 10.2 toolchain. The link for GCC 10.2.0 toolchain, as delivered by Arm at:

Please refer to the link

🧔
https://www.nxp.com/document/guide/get-started-with-the-s32g-vehicle-network-processing-evaluation-board-3:GS-S32G-VNP-EVB3
https://www.nxp.com/docs/en/product-brief/S32LINUXPB.pdf
https://www.nxp.com/design/software/embedded-software/linux-software-and-development-tools/bsp-for-s32-microcontrollers-and-processors:BSP-S32
https://source.codeaurora.org/
https://github.com/nxp-auto-linux/auto_yocto_bsp/tree/release/bsp36.0
codeaurora.org
https://developer.arm.com/-/media/Files/downloads/gnu-a/10.2-2020.11/binrel/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu.tar.xz?revision=972019b5-912f-4ae6-864a-f61f570e2e7e&la=en&hash=B8618949E6095C87E4C9FFA1648CAA67D4997D88
https://github.com/nxp-auto-linux/u-boot/tree/release/bsp36.0-2022.04
https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/HOWTO-Use-IVT-Tool-To-Create-A-Blob-Image/ta-p/1108863
S32 Design Studio for S32 Platform
FreeMASTER Run-Time Debugging Tool
Linux BSP
FreeRTOSTM
USB Stack
TCP/IP Stack
SDHC Stack
S32 Real-Time Drivers (RTD)
Safety Peripheral Drivers (SPD)
Inter-Platform Comm Framework (IPCF)
PFE Driver + Standard Firmware
LLCE Driver + Firmware
HSE Standard Firmware
S32 Security
S32 Safety
S32 Safety Software Framework (SAF)
Structural Core Self-Test (SCST)
https://www.nxp.com/document/guide/getting-started-with-the-s32g-reference-design-board-2-for-vehicle-network-processing:GS-S32G-VNP-RDB2
S32G2 Processors for Vehicle Networking Block Diagram
S32G2 Processors for Vehicle Networking Software Ecosystem Block Diagram
BSP arch
https://github.com/nxp-auto-linux/linux/tree/release/bsp36.0-5.15.85-rt
https://github.com/nxp-auto-linux/optee_os/tree/release/bsp36.0-3.18
https://github.com/nxp-auto-linux/arm-trusted-firmware/tree/release/bsp36.0-2.5