下载官方镜像
https://www.nxp.com/design/design-center/software/embedded-software/linux-software-and-development-tools/bsp-for-s32-microcontrollers-and-processors:BSP-S32#downloads
刷机
cat /proc/partition
or
df -lh //查看sdcard卡再/dev目录挂在点
export DEVSD=/dev/sdb
sudo dd if=fsl-image-auto-s32g274ardb2.sdcard of=${DEVSD} bs=1M && sync
以上将SD-card插入就可以将开发板启动,串口接UART1,进入Linux,输入root,密码无
构建
https://github.com/nxp-auto-linux/linux-bsp-utils
cd linux-bsp-utils/codeaurora_migration
./migrate.sh --full --work_path ./bsp32.0 --release_branch release/bsp32.0
source nxp-setup-alb.sh -m s32g274ardb2
如果是ubuntu18请在 /conf/local.conf 中添加UBUNTU_TARGET_VERSION = "18.04.5"
bitbake fsl-image-base
集成
cd tmp/work/<mchine>-fsl-linux/linux-s32/<kernel_version>-r0/git
修改某个文件比如:/drivers/iio/adc/s32_adc.c
git add drivers/iio/adc/s32_adc.c
git commit -s -m "<提交标题>"
git format-patch -l //将生成0001-test-sar-adc-repackage.patch
将patch复制到 meta-alib/recipes-kernel/linux/linux-s32文件夹中
编辑meta-alib/recipes-kernel/linux/linux-s32中的 linux-s32-<kernel_version>.bb文件,加入补丁文件,例如
SRC_URI += "file://0001-test-sar-adc-repackage.patch"
返回编译目录,运行一下命令清除先前的sstate:
bitbake vertual/kernel -c cleansstate
bitbake vertual/kernel
离线构建yocto
bitbake fsl-image-auto --runall=do_fetch
BB_NO_NETWORK = "1"
BB_SRCREV_POLICY = "cache"
bitbake fsl-image-auto -c clean && bitbake fsl-image-auto