Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
i.MX 93 Pro Center: How to Install a Sequencer - Practical (Japanese Blog) Previously, we have explained the i.MX 93 in the following example of aセキュアブートの仕組みについて解説を行いました。 (Please refer to the following for previous notes).  Journalism: i.MX 93 Prospectus: Signatures and Certifications for SequiaBoot (Japanese Logo) This time, the Secure boot is actually installed in a hanzion form. table of contents i.MX 93 Secure Boot Hands-on 1. Hands-on environment 2. Host PC Center (Linux) 3. Download Code Signing Tool 4. SRK generation 5. git center 6. i.MX Linux BSP downloads 7. meta-imx-frdm downloads 8. meta-nxp-security-reference-design downloads 9. Center for Virtual Environment (CVE) 10. IMAGE VIDEO 11. occasions when the bitbake is reopened while in transit 12. Occasions for signing the signature 13. ramdisk signature 14. Host PCs and guesthouse connections 15. UUU Institutes (Linux) 16. UUU Institutes (Windows) 17. シリアルコンソール (Linux) 18. シリアルコンソール (Windows) 19. Linux Startup Tasks (1) 19.1. Serial DownloadでLinux Startup 19.2. SDまたはeMMCでLinux startup 20. Written on SRK hash. 21. Linux Startup Tasks (2) 22. Moving on OEM Closed 23. Linux Startup Tasks (3) 24. References i.MX 93 Secure Boot Hands-on¶ The i.MX 93 Pro Center introduces the manual for installing the Advanced High Assurance Boot (AHAB) using the セキュアブート. 1. Hands-on environment¶ Host PC. YoctoBuilder is available for Linux PCs and Windows PCs in a virtual environment (WSL2, VMware, VirtualBox, etc.). The OS is Ubuntu 22.04. A connection to the network is necessary. The capacity of the disk is 100GB. (In the case of FRDM-IMX93 with core-image-minimal) UUU, コンソールによる作はLinux PCもしくはWindows PCでも可能です。 UUU is available for Linux and Windows. The シリアルコンソール is available for Linux PCs with screen and minicom, and for Windows PCs with TeraTerm and PuTTY. Target. FRDM-IMX93 microSD もしくはeMMC を使用します。 The Host PC and Target are connected to each other by 2 USB cables. i.MX Linux BSP 6.6.36-2.1.0 (GitHub) meta-imx-frdm (branch: lf-6.6.36-2.1.0, tag: imx-frdm-4.0) (GitHub) meta-nxp-security-reference-design (branch: scarthgap-6.6.23-2.0.0) (GitHub) 2. Host PC center (Linux )¶ Host PC's OS is Ubuntu 22.04. The system has been updated with the latest state. $ sudo apt-get -y update $ sudo apt-get -y upgrade Yoctoでイメージをビルドするために必要なパッケージをインストールします。 The Dockerfile of imx-docker を参考にしています。 $ sudo apt-get -y install gawk wget git-core diffstat unzip texinfo \ gcc-multilib build-essential chrpath socat file cpio python3 \ python3-pip python3-pexpect xz-utils debianutils iputils-ping \ libsdl1.2-dev xterm tar locales net-tools rsync sudo vim curl zstd \ liblz4-tool libssl-dev bc lzop libgnutls28-dev efitools git-lfs \ bsdmainutils This time, we will work on the top ディレクトリ at HOMEディレクトリ直下の ~/imx93-secure-boot とします。 The place or name of the data center is optional, but you should read and replace it if necessary. $ mkdir ~/imx93-secure-boot $ cd ~/imx93-secure-boot The ultimate ディレクトリツリー for Host PC is the following. imx93-secure-boot ├── IMX_CST_TOOL_NEW.tgz ├── cst-4.0.1 │ ├── ... │ ├── keys │ ├── crts │ └── linux64 │ └── bin ├── backup-cst └── yocto ├── ... ├── bin ├── build-imx93-11x11-lpddr4x-frdm │ ├── ... │ ├── conf │ └── tmp │ └── deploy │ └── images │ └── imx93-11x11-lpddr4x-frdm ├── downloads └── sources ├── ... ├── meta-imx ├── meta-imx-frdm └── meta-nxp-security-reference-design   3. Download the Code Signing Tool The Code Signing Tool (CST) is based on the i.MX Processor's High Assurance Boot (HAB) and Advanced High Assurance Boot (AHAB) functions. NXPのwebサイトから最新版がダウンロードできます。 Code Signing Tool (latest version) i.MX Software and Development Tools Link to Code Signing Tools below this page. 最新版をダウンロードすると、 IMX_CST_TOOL_NEW.tgz というファイルなので、最上位ディレクトリに保存してから、展します。 $ cd ~/imx93-secure-boot $ cp ~/Downloads/IMX_CST_TOOL_NEW.tgz . $ tar xf IMX_CST_TOOL_NEW.tgz 展開すると(2025/08現在の最新バージョンである) cst-4.0.1 というディレクトリに展されます。 バージョンが異なる場場は読み替えてください。 4. SRK generation¶ Generate a Super Root Key (SRK) for the CST using secure boot. Please refer to the following information for details. UG10106, Code Signing Tool User Guide, Rev. 4.0.1 - 27 June 2025 cst-4.0.1/docs/UG10106_Rev4.0.1.pdf On the other hand, it is not a good idea to have a good time. ahab_pki_tree.shでSRKを生成します。 Optionally, the following options can be selected. The existing CA key can be used to select a CA key by y/n. Use the CA key name and CA certificate name. SRK key type をrsa, rsa-pss, eccから選択します。 rsa、rsa-pssの場場、keyのビット長を2048, 3072, 4096から選択します。 eccの場場、keyのビット長をp256, p384, p521から選択します。 digestアルゴリズムをsha256, sha384, sha512から選択します。 SRK is effective for a number of years. SRK is generated by CA certificate, and y/n is selected to check SRK. This time, SRK is generated with the following settings. existing CA or make a difference key type = ecc key length = p384 digest algorithm = sha384 Period = 10 years Certificates of User and Generation ahab_pki_tree.shでインタラクティブにSRKの生成を行う場は、以下のようななります。 $ cd ~/imx93-secure-boot $ cd cst-4.0.1/keys $ ./ahab_pki_tree.sh ... Do you want to use an existing CA key (y/n)?: n Do you want to use Elliptic Curve Cryptography (y/n)?: y Enter length for elliptic curve to be used for PKI tree: Possible values p256, p384, p521: p384 Enter the digest algorithm to use: sha384 Enter PKI tree duration (years): 10 Do you want the SRK certificates to have the CA flag set? (y/n)?: n ... $ cd - If you want to specify the number of quotes in ahab_pki_tree.sh, please do the following. $ cd ~/imx93-secure-boot $ cd cst-4.0.1/keys $ ./ahab_pki_tree.sh -existing-ca n -kt ecc -kl p384 -da sha384 -duration 10 -srk-ca n $ cd - Next, the hash value of the certificate is generated by srktool on the i.MX processor'sヒューズ. $ cd cst-4.0.1/crts $ ../linux64/bin/srktool -a -d sha256 -s sha384 -t SRK_1_2_3_4_table.bin \ -e SRK_1_2_3_4_fuse.bin -f 1 \ -c SRK1_sha384_secp384r1_v3_usr_crt.pem,SRK2_sha384_secp384r1_v3_usr_crt.pem,SRK3_sha384_secp384r1_v3_usr_crt.pem,SRK4_sha384_secp384r1_v3_usr_crt.pem Warning The 4 files that are designated by the -c OPCSIN are not included in the text of Conmar's Mickey, and the text of the Spaces are included in the text of the Spaces. The SRK_1_2_3_4_table.bin and SRK_1_2_3_4_fuse.bin are generated. These two files are generated correctly and confirmed. The sha256 digest of SRK_1_2_3_4_table.bin is represented. $ openssl dgst -binary -sha256 SRK_1_2_3_4_table.bin | hexdump -e '/4 "0x"' -e '/4 "%08x""\n"' This digest and SRK_1_2_3_4_fuse.bin have the same content. $ hexdump -e '/4 "0x"' -e '/4 "%08x""\n"' SRK_1_2_3_4_fuse.bin | tee srk_fuse.txt Same as the above, SRK_1_2_3_4_table.bin and SRK_1_2_3_4_fuse.bin are generated correctly, and are considered to be the same as the SRK_1_2_3_4_fuse.bin. The value of i.MX 93 is written in the certificate's hash value, and the content of Sunawachi srk_fuse.txt is written in the certificate's hash value. ヒューズを書き込むためのu-bootコマンドをファイルとして作成しておきます。 Initially, the following ファイル をu-boot_cmd_temp.txtというファイル名で作成します。 This is a program for i.MX 93, Bank 16, and Word 0-7, and it is programmed in a computerized format. fuse prog -y 16 0 fuse prog -y 16 1 fuse prog -y 16 2 fuse prog -y 16 3 fuse prog -y 16 4 fuse prog -y 16 5 fuse prog -y 16 6 fuse prog -y 16 7 u-boot_cmd_temp.txtにヒューズ値が書かれたsrk_fuse.txtを右側に貼り付けて、u-boot_cmd.txtというファイルを生成します。 $ paste -d" " u-boot_cmd_temp.txt srk_fuse.txt | tee u-boot_cmd.txt The following form of u-boot_cmd.txt is generated. If you want to write the file, please refer to the following form. fuse prog -y 16 0 fuse prog -y 16 1 fuse prog -y 16 2 fuse prog -y 16 3 fuse prog -y 16 4 fuse prog -y 16 5 fuse prog -y 16 6 fuse prog -y 16 7 This time, Yoctoビルド has automatically generated the secure boot ためのバイナリします。 その過程でnxp-cst-signerというツールが実行されます。 nxp-cst-signerはCSTディレクトリの直下にある設定ファイル(csf_ahab.cfg)を参考するルールになっているため, ~/imx93-secure-boot/cst-4.0.1/csf_ahab.cfg The following is a summary of the results of the study. $ cd ~/imx93-secure-boot $ cd cst-4.0.1 $ edit csf_ahab.cfg The following notes are kept in the setup file. #Header header_version=1.0 #Install SRK srktable_file=SRK_1_2_3_4_table.bin srk_source=SRK1_sha384_secp384r1_v3_usr_crt.pem srk_source_index=0 srk_source_set=OEM srk_revocations=0x0 #Install Certificate sgk_file= sgk_permissions= The CST setting is complete. This CSTディレクトリは、ヒューズを書き込んだi.MX 93デバイスのソフトウェアに署名をする時に必要なりますののでをずバックアップを取得し、安全な場な場なに長-termななタビジネトください。 $ cd ~/imx93-secure-boot $ mkdir backup-cst $ tar cf backup-cst/cst-4.0.1_$(date +"%Y%m%d-%H%M%S").tar.gz cst-4.0.1/   5. git centers¶ If you are interested in Yocto's video, please register your git user name and password with us, or register with us on any other occasion. $ git config --global user.name "Your Name" $ git config --global user.email "[email protected]"   6. i.MX Linux BSP downloads¶ Yoctoビルド ディレクトリを作成します。 $ cd ~/imx93-secure-boot $ mkdir yocto $ cd yocto repoツールをダウンロードします。 $ mkdir bin $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > bin/repo The right to use PATH is granted by the repo. $ chmod a+x bin/repo $ PATH=${PATH}:$(pwd)/bin repoでi.MX Linux BSP 6.6.36-2.1.0のレシピをダウンロードするための初期化を行います。 $ repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-scarthgap -m imx-6.6.36-2.1.0.xml repoでi.MX Linux BSP 6.6.36-2.1.0のレシピをダウンロードします。 $ repo sync   7. meta-imx-frdm downloads¶ Additional meta layer for FRDM-IMX93 is downloaded. $ cd sources $ git clone https://github.com/nxp-imx-support/meta-imx-frdm -b imx-frdm-4.0 $ cd ..   8. meta-nxp-security-reference-design downloads¶ Yoctoによるsecure bootの自動ビルドを行うための追加meta layerをダウンロードします。 このレイヤにはi.MX Linux BSP 6.6.36-2.1.0用は存在しませんが、近近のscarthgap-6.6.23-2.0.0.0ブランチを使用します。 $ cd sources $ git clone https://github.com/nxp-imx-support/meta-nxp-security-reference-design -b scarthgap-6.6.23-2.0.0 $ cd .. This レイヤーをFRDM-IMX93に適すると、署名を行う時にi.MX 93 EVKのdtbが使われてしまう不具合があるため修正をしておきましょう。 (This submission is for reference only. < https://github.com/nxp-imx-support/meta-nxp-security-reference-design/pull/2 > ) diff --git a/meta-secure-boot/recipes-secure-boot/imx-mkimage/imx-boot_%.bbappend b/meta-secure-boot/recipes-secure-boot/imx-mkimage/imx-boot_%.bbappend index 1bbc7b2..6a2f069 100644 --- a/meta-secure-boot/recipes-secure-boot/imx-mkimage/imx-boot_%.bbappend +++ b/meta-secure-boot/recipes-secure-boot/imx-mkimage/imx-boot_%.bbappend @@ -15,7 +15,7 @@ do_compile:append:ahab() { mv ${BOOT_STAGING}/flash.bin ${BOOT_STAGING}/flash.bak # Invoke mkimage again to Get container info - make SOC=${IMX_BOOT_SOC_TARGET} flash_kernel + make SOC=${IMX_BOOT_SOC_TARGET} ${MKIMAGE_EXTRA_ARGS} flash_kernel # Rename kernel image name and move back the imx-boot flash image name mv ${BOOT_STAGING}/flash.bin ${BOOT_STAGING}/flash_os.bin   9. Site Map of the Verde Environment¶ Yoctoビルドのプロジェクトのセッアップを行います。FRDM-IMX93の場場は以下コマンドになります。 $ MACHINE=imx93-11x11-lpddr4x-frdm DISTRO=fsl-imx-xwayland EULA=1 source sources/meta-imx-frdm/tools/imx-frdm-setup.sh -b build-imx93-11x11-lpddr4x-frdm The comand ended normally and build-imx93-11x11-lpddr4x-frdm ディレクトリに移動しています。 次のコマンドで、 meta-nxp-security-reference-design/meta-secure-boot をlayerとして追加します。 This is necessary to automate the signing of the secure boot. $ bitbake-layers add-layer ../sources/meta-nxp-security-reference-design/meta-secure-boot The program settings (local.conf) are added to the program. Open local.conf in Edita. $ edit conf/local.conf Append the next 1 line to the end of local.conf. The rootfs of rambootするためが追加で生成されます。 IMAGE_FSTYPES:append = " cpio.gz.u-boot" Append the next line to the end of local.conf. Set the absolute CST defaults for the CST_PATH variable. The meta-nxp-security-reference-design is necessary to refer to the CST defaults. CST_PATH = Add the next 1 line to the end of local.conf. The problem with i.MX 93 EVK's dtb was avoided when meta-nxp-security-reference-design was signed to FRDM-IMX93's kernel and dtb. MKIMAGE_EXTRA_ARGS:imx93-11x11-lpddr4x-frdm = "KERNEL_DTB=imx93-11x11-frdm.dtb" Edit to save local.conf.   10. IMAGE VELDO¶ This time, the size is minimized, and the signatures of the katsu and secure boot are automatically executed on core-image-minimal-secure-boot をbitbakeします。 The process takes several hours to complete. $ bitbake core-image-minimal-secure-boot -k The image video has ended normally and the following 2 files have been generated. 1 file is a signature payki bootloader, and the other file is a combination of linux kernel and dtb, which is a signature payki OS console. $ stat tmp/deploy/images/imx93-11x11-lpddr4x-frdm/signed-imx-boot-imx93-11x11-lpddr4x-frdm-sd.bin-flash_singleboot $ stat tmp/deploy/images/imx93-11x11-lpddr4x-frdm/os_cntr_signed.bin Signed and dated Bootloader and Signed and dated OSコンテナを組み込んだイメージファイルも生成されています。 This wic file is activated by SD or eMMC. $ stat tmp/deploy/images/imx93-11x11-lpddr4x-frdm/core-image-minimal-secure-boot-imx93-11x11-lpddr4x-frdm.rootfs.wic.zst Serial DownloadでLinuxを起する時に使用するramdiskも生成されています。 This file is signed later. ( Signature of ramdisk ) $ stat tmp/deploy/images/imx93-11x11-lpddr4x-frdm/core-image-minimal-secure-boot-imx93-11x11-lpddr4x-frdm.rootfs.cpio.gz.u-boot   11. occasions where bitbake is reopened while in transit ¶¶ If the bitbake is interrupted on the way, or if another shell is reopened, it is necessary to set the number of environment changes in Yocto. Also, you can use the following scripts. $ cd ~/imx93-secure-boot $ cd yocto $ source setup-environment build-imx93-11x11-lpddr4x-frdm   12. Occasions for signatures¶ When SRK is regenerated, the signatures will be cleaned and rebranded at imx-boot , imx-boot-signature , linux-imx-signature and the 4 pairs of images (this time core-image-minimal-secure-boot ). $ bitbake imx-boot imx-boot-signature linux-imx-signature core-image-minimal-secure-boot -c cleanall $ bitbake core-image-minimal-secure-boot -k   13. ramdisk's signature¶ イメージのビルドが正常終了すると、deployディレクトリに2つのツールが存在します。 mkimage_imx8は起動コンテナを作成するツールです。 cst_signerはコンテナに署名を行うツールです。 $ stat tmp/deploy/images/imx93-11x11-lpddr4x-frdm/imx-boot-tools/mkimage_imx8 $ stat tmp/deploy/images/imx93-11x11-lpddr4x-frdm/imx-boot-tools/cst_signer また、deployディレクトリにramdiskファイルも存在します。 $ stat tmp/deploy/images/imx93-11x11-lpddr4x-frdm/core-image-minimal-secure-boot-imx93-11x11-lpddr4x-frdm.rootfs.cpio.gz.u-boot mkimage_imx8とcst_signerを使って、ramdiskファイルに署名をします。 Initially mkimage_imx8 でramdiskをコンテナにします。 The form of the ramdisk is as follows. $ INITRD= $ INITRD_ADDR= $ mkimage_imx8 -soc IMX9 -container -data ${INITRD} a55 ${INITRD_ADDR} -out The specifics are as follows. $ tmp/deploy/images/imx93-11x11-lpddr4x-frdm/imx-boot-tools/mkimage_imx8 \ -soc IMX9 \ -container \ -data tmp/deploy/images/imx93-11x11-lpddr4x-frdm/core-image-minimal-secure-boot-imx93-11x11-lpddr4x-frdm.rootfs.cpio.gz.u-boot \ a55 \ 0x83800000 \ -out initrd_cntr.bin The second cst_signer is signed by コンテナ. The form of the cst_signer is as follows. $ CST_PATH= cst_signer -d -i -c /csf_ahab.cfg The specifics are as follows. $ CST_PATH=/home/nxp/imx93-secure-boot/cst-4.0.1 \ tmp/deploy/images/imx93-11x11-lpddr4x-frdm/imx-boot-tools/cst_signer \ -d \ -i initrd_cntr.bin \ -c /home/nxp/imx93-secure-boot/cst-4.0.1/csf_ahab.cfg Signed ramdisk or deployディレクトリに移動しておきます。 $ mv signed-initrd_cntr.bin tmp/deploy/images/imx93-11x11-lpddr4x-frdm/ The environment in which this secure boot will be implemented is a Bildungsroman.   14. Host PCs and guesthouses The Host PC and Target are connected to each other by 2 USB cables. Fig. 1 Link between Host PC and Tartar Gateway ¶   15. UUU Institutes (Linux )¶ Linux version of UUU is configured on the following sites: uuu をダウンロードして、 /usr/local/bin などのPATHの通った場場に配置します。 UUU Releases (latest version) <https://github.com/nxp-imx/mfgtools/releases/latest> In the following section, you can set the settings for the sudo なし でuuu を実行できるようにsettingファインストールします. $ sudo sh -c "uuu -udev > /etc/udev/rules.d/70-uuu.rules" $ sudo udevadm control --reload Host PC and FRDM-IMX93's USB1 port are connected to USB 続して、FRDM-IMX93をSerial Download modeに設定して电源ONすると以下のコマンドで接続されているFRDM-IMX93の情報が見えること確認えることします。 $ uuu -lsusb uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.201-11-gf2a4e3e Connected Known USB Devices Path Chip Pro Vid Pid BcdVersion Serial_no ==================================================================== 3:1224 MX93 SDPS: 0x1FC9 0x014E 0x0001 3A24F36BB35F4594   16. UUU Institutes (Windows )¶ Windows version of UUU is the following サイトから uuu.exe をダウンロードして、PATHの通った場場に配置します。 UUU Releases (latest version) <https://github.com/nxp-imx/mfgtools/releases/latest> Host PC and FRDM-IMX93's USB1 port are connected to USB 続して、FRDM-IMX93をSerial Download modeに設定して电源ONすると以下のコマンドで接続されているFRDM-IMX93の情報が見えること確認えることします。 > uuu -lsusb uuu (Universal Update Utility) for nxp imx chips -- libuuu_1.5.201-11-gf2a4e3e Connected Known USB Devices Path Chip Pro Vid Pid BcdVersion Serial_no ==================================================================== 3:1224 MX93 SDPS: 0x1FC9 0x014E 0x0001 3A24F36BB35F4594   17. シリアルコンソール (Linux )¶ Host PCでシリアルコンソールを開きます。 For example, minicom can open the シリアルポート of FRDM-IMX93 on the following occasions. $ minicom -D/dev/ttyACM0   18. シリアルコンソール (Windows )¶ Windows シリアルコンソールのアプリケーションで、FRDM-IMX93の場場はComputer USB-Enhanced-SERIAL-A CH342 を開きます。 The i.MX 93 EVK is available in a 3-panel box with a 4-panel COM port.   19. Linux Startup Tasks (1 )¶ Bootloader and Linux を起動して、AHABのエラーを確認します。 BOOT_MODEによって方法が異なりますので、いずれかを選択してテストします。 Serial DownloadでLinux Startup SDまたはeMMCでLinux startup   19.1. Serial DownloadでLinux Startup¶ Serial Download de Bootloader and Linux bootstrap. The next 3 files are used. Signed Bootloaderファイル signed-imx-boot-imx93-11x11-lpddr4x-frdm-sd.bin-flash_singleboot Linux kernel and dtb combined with a signature payment file on 1 console os_cntr_signed.bin Signed ramdiskファイル signed-initrd_cntr.bin The presence of 3 files is confirmed by the following pas. $ cd ~/imx93-secure-boot $ cd yocto/build-imx93-11x11-lpddr4x-frdm/tmp/deploy/images/imx93-11x11-lpddr4x-frdm $ stat signed-imx-boot-imx93-11x11-lpddr4x-frdm-sd.bin-flash_singleboot $ stat os_cntr_signed.bin $ stat signed-initrd_cntr.bin $ cd - The UUU has made the スクリプトファイル sdp-ramboot-yocto-signed.uuu a reality. $ cd ~/imx93-secure-boot $ edit sdp-ramboot-yocto-signed.uuu The following items are noted for preservation. uuu_version 1.2.39 SDPS: boot -f yocto/build-imx93-11x11-lpddr4x-frdm/tmp/deploy/images/imx93-11x11-lpddr4x-frdm/signed-imx-boot-imx93-11x11-lpddr4x-frdm-sd.bin-flash_singleboot FB: ucmd ahab_status FB: ucmd setenv ramargs 'setenv bootargs ${jh_clk} console=${console} root=/dev/ram rw' FB: ucmd setenv ramboot 'echo Booting from initramfs ...; run ramargs; booti ${loadaddr} ${initrd_addr} ${fdt_addr};' FB: ucmd setenv fastboot_buffer ${cntr_addr} FB: download -f yocto/build-imx93-11x11-lpddr4x-frdm/tmp/deploy/images/imx93-11x11-lpddr4x-frdm/os_cntr_signed.bin FB: ucmd auth_cntr ${cntr_addr} FB: ucmd ahab_status FB: ucmd setenv fastboot_buffer ${cntr_addr} FB: download -f yocto/build-imx93-11x11-lpddr4x-frdm/tmp/deploy/images/imx93-11x11-lpddr4x-frdm/signed-initrd_cntr.bin FB: ucmd auth_cntr ${cntr_addr} FB: ucmd ahab_status FB: acmd run ramboot FB: done The UUU de-scrimp is practiced. $ uuu -d -v sdp-ramboot-yocto-signed.uuu FRDM-IMX93をSerial Downloadモードに設定して电源ONすると、BootloaderからLinuxが起動します。 AHABのエラーは、Linuxが起動する直前実行した ahab_status コマンドの結果で判断します。 Authenticate OS container at 0x98000000 ... Lifecycle: 0x00000008, OEM Open 0x0287fad6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) STA = ELE_SUCCESS_IND (0xD6) 0x0287fad6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) STA = ELE_SUCCESS_IND (0xD6) 0x0287fad6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) STA = ELE_SUCCESS_IND (0xD6) 0x0287fad6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) STA = ELE_SUCCESS_IND (0xD6) Detect USB boot. Will enter fastboot mode! Booting from initramfs ... ## Loading init Ramdisk from Legacy Image at 83800000 ... Image Name: core-image-minimal-secure-boot-i Created: 2011-04-05 23:00:00 UTC Image Type: AArch64 Linux RAMDisk Image (uncompressed) Data Size: 56894907 Bytes = 54.3 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 83000000 Booting using the fdt blob at 0x83000000 Working FDT set to 83000000 Using Device Tree in place at 0000000083000000, end 000000008300eaef Working FDT set to 83000000 fail to find output device probe video device failed, ret -19 Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x412fd050] [ 0.000000] Linux version 6.6.36-lts-next-g20aa8fc92c79 (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 13.3.0, GNU ld 4 [ 0.000000] KASLR disabled due to lack of seed [ 0.000000] Machine model: NXP i.MX93 11X11 FRDM board ... Linux ga startするまでに、u-boot-spl, u-boot, kernel+dtb, ramdiskの4次の認證が行われますが、まだSRK hashがヒューズに書かれていない状態では、4次の認證エラー ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) が発生したことが表示されます。 エラー ELE_NO_AUTHENTICATION_FAILURE_IND (0xEE) が出る場場は、「イメージに署名が無いので認證できなかった」という意味で、署名付きイメージのビルドが正しくできていない可能性があります。 Lifecycle: 0x00000008, OEM Open 0x0287eed6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_NO_AUTHENTICATION_FAILURE_IND (0xEE) STA = ELE_SUCCESS_IND (0xD6) SRK hashがヒューズに書かれて認證が正しく行われれば、AHABのエラーが無くなり、以下のように No Events Found! という表示になります。 Lifecycle: 0x00000008, OEM Open No Events Found!   19.2. SDまたはeMMCでLinux startup ¶ FRDM-IMX93のBOOT_MODEスイッチをSerial Downloadモードに設定して电源をONします。 SDブートの場場は書き込み可能なmicroSDカードをカードスロットに挿入ししてから、以下のコマンドでSDにイメージを書き込みます。 Listing 1 Writing in SD ¶ $ cd ~/imx93-secure-boot $ cd yocto/build-imx93-11x11-lpddr4x-frdm/tmp/deploy/images/imx93-11x11-lpddr4x-frdm/ $ uuu -b sd_all signed-imx-boot-imx93-11x11-lpddr4x-frdm-sd.bin-flash_singleboot core-image-minimal-secure-boot-imx93-11x11-lpddr4x-frdm.rootfs.wic.zst $ cd - In case of eMMCブート, please write down the eMMC messages in the following commemorations. Listing 2 Writing on eMMC ¶ $ cd ~/imx93-secure-boot $ cd yocto/build-imx93-11x11-lpddr4x-frdm/tmp/deploy/images/imx93-11x11-lpddr4x-frdm/ $ uuu -b emmc_all signed-imx-boot-imx93-11x11-lpddr4x-frdm-sd.bin-flash_singleboot core-image-minimal-secure-boot-imx93-11x11-lpddr4x-frdm.rootfs.wic.zst $ cd - The power supply of FRDM-IMX93 is OFF when the writing is finished. FRDM-IMX93のBOOT_MODEスイッチを、SDブートモードまたはeMMCブートモードに設定して电源ONします。 U-Boot's startup にコンソールでリターンキーを押すことで、起動を一時停止しプロンプトを表示できます。 The following code is certified with the signature OS IMAGE (kernel + dtb). Listing 3 Authentication of Signed OS Images ¶ u-boot=> mmc dev ${mmcdev} u-boot=> mmc rescan u-boot=> run loadcntr u-boot=> run mmcargs u-boot=> run auth_os ahab_status The Comanufactured AHAB's Elite is confirmed by the Comanufactured AHAB. Listing 4 Signature of Images Certified Elite ¶ u-boot=> ahab_status Lifecycle: 0x00000008, OEM Open 0x0287fad6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) STA = ELE_SUCCESS_IND (0xD6) 0x0287fad6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) STA = ELE_SUCCESS_IND (0xD6) 0x0287fad6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) STA = ELE_SUCCESS_IND (0xD6) Linux ga startするまでに、u-boot-spl, u-boot, kernel+dtbの3回の認證が行われますが、まだSRK hashがヒューズに書かれていない状態では、3回の認證エラー ELE_BAD_KEY_HASH_FAILURE_IND (0xFA) が発したことが表示されます。 エラー ELE_NO_AUTHENTICATION_FAILURE_IND (0xEE) が出る場場は、「イメージに署名が無いので認證できなかった」という意味で、署名付きイメージのビルドが正しくできていない可能性があります。 Listing 5 Signature Information ¶ Lifecycle: 0x00000008, OEM Open 0x0287eed6 IPC = MU APD (0x2) CMD = ELE_OEM_CNTN_AUTH_REQ (0x87) IND = ELE_NO_AUTHENTICATION_FAILURE_IND (0xEE) STA = ELE_SUCCESS_IND (0xD6) SRK hashがヒューズに書かれて認證が正しく行われれば、AHABのエラーが無くなり、以下のように No Events Found! という表示になります。 Listing 6 When AHAB is unavailable ¶ Lifecycle: 0x00000008, OEM Open No Events Found! Lastly, the following comanagers were confirmed to have been activated by the Linux Logline. Listing 7 Linux Startup ¶ u-boot=> run boot_os   20. Writing of SRK hash on a hikigome . i.MX 93のヒューズ Bank 16、Word 0-7の値が0x00000000であることここと確認します。 u-boot=> fuse read 16 0 u-boot=> fuse read 16 1 u-boot=> fuse read 16 2 u-boot=> fuse read 16 3 u-boot=> fuse read 16 4 u-boot=> fuse read 16 5 u-boot=> fuse read 16 6 u-boot=> fuse read 16 7 SRK Generation The contents of the u-boot_cmd.txt file generated by the SRK are confirmed. (The actual values of to and other notations are shown in the table below.) $ cd ~/imx93-secure-boot $ cat cst-4.0.1/crts/u-boot_cmd.txt fuse prog -y 16 0 fuse prog -y 16 1 fuse prog -y 16 2 fuse prog -y 16 3 fuse prog -y 16 4 fuse prog -y 16 5 fuse prog -y 16 6 fuse prog -y 16 7 u-boot_cmd.txt The SRK hash of the u-boot program is written in the ヒューズにヒき込みます。 (This is the actual value of 〜 and the notation.) Warning Hikari's writing is limited to one time, and the dollar is returned to this point. Very much to confirm that on Shita on the careful work to do を行ってください。 u-boot=> fuse prog -y 16 0 u-boot=> fuse prog -y 16 1 u-boot=> fuse prog -y 16 2 u-boot=> fuse prog -y 16 3 u-boot=> fuse prog -y 16 4 u-boot=> fuse prog -y 16 5 u-boot=> fuse prog -y 16 6 u-boot=> fuse prog -y 16 7   21. Linux Startup Tasks (2 )¶ Bootloader and Linux startup, AHAB's Elite is confirmed. Linux Bootstrap (1) The Linux bootloader and Linux bootstrap are available in the same way as the Linux bootstrap. Serial DownloadでLinux Startup SDまたはeMMCでLinux startup SRK hashのヒューズを書き込んだため、 ahab_status コマンドの結果が No Events Found! と表示されるはずです。 This means that the signature is paid by the Immigration Department. Lifecycle: 0x00000008, OEM Open No Events Found!   22. Relocation of OEM Closed¶ i.MX 93デバイスのLifecycleがOEM Closedに遷移移することで、署名付きイメージのみ起動できるようになり、署名の無いイメージや、不正な署名付きイメージは起動できなくなります。 署名付きイメージで起動して ahab_status コマンドで AHAB エラーが無いことを確認します。 u-boot=> ahab_status Lifecycle: 0x00000008, OEM Open No Events Found! ahab_close The company has implemented and relocated the OEM Closed. Warning The relocation of OEM Closed is limited to one time only, and the return of OEM Open is not allowed. Please make sure that you are very sure that you have done your work carefully. u-boot=> ahab_close Warning: Please ensure your sample is in NXP closed state, OEM SRK hash has been fused, and you are able to boot a signed image successfully without any SECO events reported. If not, your sample will be unrecoverable. Really perform this operation? y Change to OEM closed successfully u-boot=> The re-center is in line with the OEM Closed and Nari-masu at the time of the next start-up. Signed and paid イメージであれば再起動します。 u-boot=> reset resetting ... U-Boot SPL 2024.04+gde16f4f1722+p0 (Sep 02 2024 - 10:44:35 +0000) SOC: 0xa1009300 ... ahab_status The concept is being implemented and relocated by OEM Closed. u-boot=> ahab_status Lifecycle: 0x00000020, OEM closed No Events Found! u-boot=>   23. Linux Startup Tasks (3 )¶ Bootloader and Linux startup are confirmed. Linux Bootstrap (1) The Linux bootloader and Linux startup task (1) are confirmed by the same method as the bootloader. Serial DownloadでLinux Startup SDまたはeMMCでLinux startup Linuxまで起動できれば、Secure Bootに成功したことになります。   24. References¶ i.MX 93 Applications Processor Reference Manual i.MX 93 Applications Processor Security Reference Manual, Rev. 5, 2025-03-04 (入手は i.MX 93 サイト Secure DocumentationのSecurity Reference Manualのリンクからリクエストを送信して、認認が出るとNXPからダウンロードURLのメールが届きます。) UG10106, Code Signing Tool User Guide, Rev. 4.0.1 - 27 June 2025 (CSTのパッケージに含まれています。cst-4.0.1/docs/UG10106_Rev4.0.1.pdf) U-Boot AHAB documents AN12312, Secure Boot on AHAB Supported Devices UG10195, i.MX FRDM Software User Guide UM12181, FRDM-IMX93 Board User Manual meta-imx-frdm README (imx-frdm-4.0) meta-nxp-security-reference-design/meta-secure-boot README (scarthgap-6.6.23-2.0.0) This information is a reference for the use of NXP products. For more information, please refer to the official website. The contents of the record and the actual operation may be different depending on the difference in conditions such as the use of a flash drive or a USB flash drive. If you have any questions about the function of the product, please do not hesitate to contact us for inspection and test. ========================= The "Comment" columnof this submission should containa comment, which should be answered by the return mail now. Please contact us for the number of copies, and the questionnaire to be sent to us. NXP Technical Question for NXP -NXP's Technical Questionnaire. How to use the questionnaire ( Japanese Logo ) " Please refer toださい. (About Us) NXP Distributor, Moshiku NXP If you have any questions about NXP and its products, please contact us.) Previously, we have explained the i.MX 93 in the following example of aセキュアブートの仕組みについて解説を行いました。 (Please refer to the following for previous notes).  Journalism: i.MX 93 Prospectus: Signatures and Certifications for SequiaBoot (Japanese Logo) This time, the Secure boot is actually installed in a hanzion form. i.MX Processors Security Japanese Logo
View full article
i.MX6 での高保証ブート (HAB) <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 要約 セキュリティは、私たちが日常生活で耳にする避けられない言葉です。セキュリティのないテクノロジーは、多くの人にとって「信頼」のないテクノロジーです。私たちは皆、職場からソーシャルチャットまで、セキュリティが私たちの生活でどのように重要な役割を果たしているかを知っています。組み込みシステムであっても、機密データへの不正なアクセスを防ぐためのセキュリティを実装する必要があります。i.MX6 プラットフォームが認証されたイメージでのみ起動できるようにするには、どうすればよいですか。High Assurance Booting(HAB)という名前のクールなものを見てみましょう。これにより、ブートイメージが安全でシンプルになります。 紹介 デジタルセキュリティは、その誕生以来、私たちの生活の避けられない部分となっています。このケースは、特に機密データを扱う場合、どの組み込みシステムでも変わりません。銀行取引、防衛、医療、産業、自動車に使用されている多くの組み込みデバイスは、セキュリティを厳格に実装しています。 ほとんどすべての組み込みシステムは、フラッシュされた画像を通じて与えられる特定の命令に基づいて動作しています。ハッカーが自分の命令を組み込みデバイスにフラッシュできるとしたら、そのデバイスで何をする必要があるかを完全に制御できると想像してみてください。デバイスが銀行の目的で使用している場合、ハッカーはパスワードを含むすべての詳細を取得します。このシナリオは、デバイスが防衛または医療分野で使用されている場合、さらに悪化します。どうすればこのケースを防ぐことができますか?まあ、答えはそれほど簡単ではありません! 組み込みシステムOSイメージは、MMC、SDカード、SATA、イーサネットなどのさまざまなメディアからフラッシュできます。SDカードなどのメディアは簡単に交換できるため、メディアにセキュリティチェックを実装することは困難です。さらに、これらのメディアにフラッシュした後、OSイメージを変更できます。したがって、イメージをフラッシュする前だけにセキュリティチェックを実装するだけでは、この問題に対処するには不十分です。では、OSイメージが十分に安全であることを確認するためのセキュリティチェックをどのように実装できますか?その答えはHAB(High Assurance Boot)です。 フリースケールは、i.MX6Qプロセッサのオプション機能としてHABv4 (最新のHABバージョン4) を提供しました。HABはフリースケールのセキュリティブロックの一部であり、CAAMやTrustZoneなどの他のセキュリティ機能と連携できます。 HAB を使用する利点には、次のものが含まれますが、これらに限定されません。 HABv4 は、一度融合すると変更できないブート ROM レベルのセキュリティを実装しています。 効率的。 イメージがシステムを制御する前のセキュリティチェック。 複数のルート キーを許可します。 デジタル署名を利用する - OSイメージを保護する最も効率的な方法。 OSイメージの機能に影響を与えずに、セキュリティをOSイメージに直接追加します。 OS イメージの検証によるプロセッサ レベルのチェックにより、セキュア ブートが完全に保証されます。 HABの仕組みは? デジタル署名の原則に基づくHAB。デジタル署名は、コンテンツコンテキストに署名することにより、コンテンツを安全に保ちます。この署名プロセスには、最終的な結果を強化するために、複数のセキュリティ アルゴリズムを組み込む必要があります。 HAB デジタル署名は、open-ssl 認証、MD5 ハッシュ、RSA-AES-DES の公開鍵と秘密鍵のチェックを組み合わせたものです。 HAB は、ブートローダー (u-boot) と OS イメージ (uImage) の両方を署名付きイメージにすることでセキュリティを確保します。これらの署名付きイメージには、通常のイメージ コンテンツとセキュリティ手順が含まれています。これらのイメージには、公開鍵と秘密鍵も含まれています。HAB プロセス中、組み合わせから派生した公開鍵ハッシュ・コードは、i.MX6 プロセッサーのブート ROM コードに融合します。この融合により、プラットフォームの安全性が向上し、後で変更することはできません。 ブート時間中、ブートプロセスの初期パラメータは、フラッシュメディア(SDカードなど)からブートROMコードを取り込む必要があります。次に、HAB 命令は、ブート ROM と署名付きイメージの内部に存在するハッシュ値を調べます。これら 2 つのハッシュ値が一致すると、HAB プロセスにより、プラットフォームはイメージを起動できます。それ以外の場合、システムはすべてのプロセスを停止し、許可されたイメージを待ちます。 このようにして、システムは、後の段階で誰かが署名されたイメージを変更した場合でも、許可されていないアクセスから保護する必要があります(これにより、最終的にイメージのハッシュ値が変更されるため、ランタイムチェック中に失敗します)。 iWaveは、 i.MX6Q iW-RainboW-G15D-Q7 Linuxプラットフォーム にHABを成功裏に実装し、HABを検証してプラットフォームを保護する方法を確認しました。ただし、HAB は、開発プラットフォームの購入またはモジュールの購入の一部として提供される標準 BSP の一部ではありません。これは特別なリクエストがある場合にのみ利用できます。 結論 HABは、OSイメージへの不正アクセスを防ぐための最良のソリューションの1つです。機密データ(バンキング、防衛など)を扱う組み込みシステムは、外部ソースによってシステム全体を制御されないように、企業内にHABを配置する必要があります。HAB は i.MX6 プラットフォームのオプション機能ですが、ブート プロセスの安全性を高めるために実装することをお勧めします。 参考: AN4581_HAB_Application_Note.pdf - i.MX50、i.MX53、および i.MX53 および HABv4 を使用した i.MX 6 シリーズでのセキュア ブート アプリケーション ノート i.MX_6_Linux_High_Assurance_Boot_(HAB)_User's_Guide.pdf - i.MX 6 Linux High Assurance Boot (HAB) ユーザーズガイド 全般
View full article
FS27 RTDとBMS GEN2 RTDの互換性に関するコンサルティング こんにちは、専門家の皆様 顧客の新しい BMS プロジェクトでは、 S32K358 + FS27 + BMS GEN2 SDK を使用したいと考えています。 BMS チームから次のことを学びました。 BMS GEN2 SDK AUTOSAR 4.4 R21-11 バージョン0.9.1 CD05および BMS GEN2 SL SDK AUTOSAR 4.4 R21-11 バージョン0.9.1 CD05は来週リリース予定です。S32K3 RTD 6.0.0 との統合をサポートします。 BMS GEN2 SDK は、2026 年第 1 四半期中に BMS リリースv1.0.0でS32K3 RTD 6.0.0に移行される予定です。 つまり、 BMS GEN2 SDK は近い将来S32K3 RTD 6.0.0と互換性を持つようになります。 顧客は 24V プラットフォームを必要としているため、FS26 ではなく FS27 を使用したいと考えています。オートモーティブ SW - SBC/PMIC - リアルタイム・ドライバから、次の 2 つのバージョンの FS27 を見つけました。 S32K3xx SBC FS27 R21-11 0.8.0 ( S32K3 RTD 5.0.0ベース) S32K3 RTD 7.0.0 ベースの SBC FS27 R23-11 1.0.0 Q1.顧客は、S32K3 RTD のバージョンが一貫していないため、FS27 と BMS GEN2 SDK のドライバに互換性がないのではないかと懸念しています。BMS GEN2 SDKでS32K3 RTD 6.0.0 を選択した場合、お客様がS32K3xx SBC FS27 R21-11 0.8.0またはSBC FS27 R23-11 1.0.0を使用すると問題が発生しますか? Q2. FS27にはS32K3 RTD 6.0.0に基づくドライバーがありますか? 助けていただけませんか?ご協力をよろしくお願いします! よろしくお願いいたします ロビン お客様情報は次のとおりです: お問い合わせ名 TengHsaing Wen メール(お問い合わせ)[email protected] 会社名:XINGMOBILITY AA SW - 外部デバイス 優先度: 中 出典: 直接顧客 Re: Consulting on the compatibility of FS27 RTD and BMS GEN2 RTD こんにちは、ヴィクトルさん。 情報をいただきありがとうございます。 S32K3 RTD 6.0.0 に基づく「BMS GEN2 SDK AUTOSAR 4.4 R21-11 バージョン 0.9.1 CD05」はまだダウンロードできません。 ダウンロードできるようになったら、少なくとも正常にコンパイルできるかどうかをテストします。 よろしくお願いいたします ロビン Re: Consulting on the compatibility of FS27 RTD and BMS GEN2 RTD こんにちは、ロビン。 RTD 6.0.0専用のリリースはありませんが、最新バージョン(FS27 1.0.0)下位互換性があるはずです。何か問題がございましたら、お知らせください。 よろしくお願いいたします、ヴィクトル Re: Consulting on the compatibility of FS27 RTD and BMS GEN2 RTD このトピックは調査するためにチームにリダイレクトされました。 連絡先: Razvan Tilimpea / Cristian Durla または Viktor Obr Re: Consulting on the compatibility of FS27 RTD and BMS GEN2 RTD こんにちは、ヴィクトルさん。 「BMS GEN2 SDK AUTOSAR 4.4 R21-11 バージョン 0.9.1 CD05」がダウンロード可能になりました。 お客様は、2 つのドライバ(R23-11とR21-11 ) の AUTOSAR バージョンが大幅に異なり、 SBC FS27 R23-11 1.0.0と組み合わせた場合に互換性の問題が発生するのではないかと疑問を呈していました。 よろしくお願いいたします ロビン Re: Consulting on the compatibility of FS27 RTD and BMS GEN2 RTD こんにちは、ロビン。 異なる AUTOSAR バージョン間の互換性は難しいため、統合しようとしている両方のコンポーネントで使用されるすべてのドライバを比較する必要がありますが、私は BMS SDK に 100% 精通しているわけではありません。FS27 のバージョンとそれが使用するドライバに関しては、R21-11 と R23-11 の間で大きな変更は見られませんでしたが、1 つのプロジェクトでコンポーネントを組み合わせるとすぐにわかる小さな違いがいくつかある可能性があります (バージョン固有のマクロなど)。ただし、機能的な観点からは、同じように動作するはずです。 よろしくお願いいたします。 ヴィクトル Re: Consulting on the compatibility of FS27 RTD and BMS GEN2 RTD こんにちは@viktorobr 、 「BMS GEN2 SDK AUTOSAR 4.4 R21-11バージョン 0.9.1 CD06 」がダウンロード可能になりました。 お客様は、2 つのドライバ(R23-11とR21-11) の AUTOSAR バージョンが大幅に異なり、SBC FS27 R23-11 1.0.0と組み合わせた場合に互換性の問題が発生するのではないかと疑問を呈していました。 よろしくお願いいたします ロビン
View full article
PN7160 PN7220 Android 15のi.MX8MN EVKへの移植 はじめに 当社では、PN7160/PN7220 Android 15公式ポーティングガイド(PN7160/PN7220 – Android 15ポーティングガイド)をご用意しております。ただし、パッチはAndroid 15 AOSP r1(android-15.0.0_r1)専用です。AOSP最新版へのポーティングを希望する場合、ソースコードのコンパイル中でエラーが頻発します。このドキュメントを参考に、エラーを一つずつ解決してください。 注:変更はすべて参考目的で提供されており、AOSP最新版へのポーティング向けのNXP公式パッチではありません。変更が最善の解決策ではない可能性がありますので、AOSPソースコードを自社のニーズに基づいて変更してください。これは製品向けではありません。ポーティング後は、お客様側で引き続き完全なテストを実施する必要があります。 ハードウェアボード: i.MX8MN EVK (i.MX 8M Nano評価キット | NXP Semiconductors) PN7160 EVK (OM27160|PN7160 プラグアンドプレイ NFC コントローラ用開発キット|NXP Semiconductors) i.MX8MN EVKとPN7160 OM29110ARD-Bの接続 i.MX8M ナノ EVK ピン PN7160 ピン 3.3V J1003-1 VDD(3.3V) J1-4 5V J1003-2 VBAT(5V) J1-5 I2C3 SDA J1003-3 SDA J2-2 I2C3 SCL J1003-5 SCL J2-1 GPIO3_22 J1003-37 IRQ J2-10 GPIO3_21 J1003-38 REQ J4-2 GND J1003-39 GND J1-6 GPIO3_20 J1003-40 N/A J4-1 i.MX8MN EVK向けAndroidの構築 ここで使用したi.MX Android BSPはAndroid 15.0.0_2.0.0(L6.12.20_2.0.0 BSP)で、こちらからダウンロードしていただけます:i.MX アプリケーション・プロセッサ向けAndroid OS | NXP Semiconductors 1. 「ドキュメント」と「インストールソースパッケージ」をダウンロードします。 2. まず、Androidユーザーガイドの手順に従って、i.MX8MN EVK用のAndroid BSPをビルドします。  android_build/.repo/manifests/aosp-android-15.0.0_2.0.0.xmlによると、表示されるAOSPバージョンはandroid-15.0.0_r32です。 ポーティングに関する参考文献: PN7160/PN7220 – Android 15 移植ガイド  i.MX8M NanoボードでPN7160をAndroid 14に移植 さて、移植を始めましょう。  1. カーネル・ドライバ PN7220またはPN7160との接続を確立するために、Androidスタックはnxpnfcカーネルドライバを使用します。以下のGitHubからドライバをダウンロードできます: br_ar_16_comm_infra_dev · nxp-nfc-infra/nfcandroid_platform_d... の br_ar_16_comm_infra_dev の nfcandroid_platform_drivers/drivers コマンドは次のとおりです。 git clone "https://github.com/nxp-nfc-infra/nfcandroid_platform_drivers.git" -b br_ar_16_comm_infra_dev カーネル6.6および6.12用のドライバがありますので、ポーティングに適したドライバをダウンロードしてください。例えば、i.MX Android BSP Android 15.0.0_2.0.0のカーネルは6.12ですので、ポーティングには6.12ドライバを使用します。 ポーティングする際は、MakefileとKconfigファイルのパスが正しく設定されていることを確認してください。 例えば、ここでは以下のようにポーティングします。 . ├── Kconfig ├── Makefile └── pn7160 ├── common.c ├── common.h ├── i2c_drv.c ├── i2c_drv.h ├── Kbuild ├── Kconfig ├── Makefile ├── spi_drv.c └── spi_drv.h すべてを簡素化するため、I2Cのみをサポートし、SPIはサポートしません。ドライバ/nfc/pn7160/Makefile のデフォルトコードを以下のコードに置き換えてください(理解しやすくするため)。 nxpnfc-i2c-objs = i2c_drv.o common.o obj-$(CONFIG_NXP_NFC_I2C) += nxpnfc_i2c.o ドライバ/nfc/Kconfig の内容。PN7160を以下のように追加してください。 source "drivers/nfc/pn7160/Kconfig" source "drivers/nfc/fdp/Kconfig" source "drivers/nfc/pn544/Kconfig" source "drivers/nfc/pn533/Kconfig" source "drivers/nfc/microread/Kconfig" source "drivers/nfc/nfcmrvl/Kconfig" source "drivers/nfc/st21nfca/Kconfig" source "drivers/nfc/st-nci/Kconfig" source "drivers/nfc/nxp-nci/Kconfig" source "drivers/nfc/s3fwrn5/Kconfig" source "drivers/nfc/st95hf/Kconfig" endmenu The contents of ドライバ/nfc/Makefile. Add the PN7160 like below: # SPDX-License-Identifier: GPL-2.0 # # Makefile for nfc devices # obj-$(CONFIG_NXP_NFC_I2C) += pn7160/ obj-$(CONFIG_NFC_FDP) += fdp/ obj-$(CONFIG_NFC_PN544) += pn544/ obj-$(CONFIG_NFC_MICROREAD) += microread/ obj-$(CONFIG_NFC_PN533) += pn533/ obj-$(CONFIG_NFC_MEI_PHY) += mei_phy.o obj-$(CONFIG_NFC_SIM) += nfcsim.o obj-$(CONFIG_NFC_PORT100) += port100.o obj-$(CONFIG_NFC_MRVL) += nfcmrvl/ obj-$(CONFIG_NFC_TRF7970A) += trf7970a.o obj-$(CONFIG_NFC_ST21NFCA) += st21nfca/ obj-$(CONFIG_NFC_ST_NCI) += st-nci/ obj-$(CONFIG_NFC_NXP_NCI) += nxp-nci/ obj-$(CONFIG_NFC_S3FWRN5) += s3fwrn5/ obj-$(CONFIG_NFC_ST95HF) += st95hf/ obj-$(CONFIG_NFC_VIRTUAL_NCI) += virtual_ncidev.o 2. i.MX8MN EVKデバイスツリーファイルに「nxpnfc」を追加します。 &i2c3 { clock-frequency = <100000>; pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c3>; pinctrl-1 = <&pinctrl_i2c3_gpio>; scl-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>; sda-gpios = <&gpio5 19 GPIO_ACTIVE_HIGH>; status = "okay"; nxpnfc@28{ compatible = "nxp,nxpnfc"; reg = <0x28>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_nfc>; nxp,nxpnfc-irq = <&gpio3 22 0>; nxp,nxpnfc-ven = <&gpio3 20 0>; nxp,nxpnfc-fw-dwnld = <&gpio3 21 0>; }; The GPIO settings in the IOMUXC: &iomuxc { pinctrl_nfc: nfcgrp { fsl,pins = < MX8MN_IOMUXC_SAI5_RXC_GPIO3_IO20 0X19 // VEN MX8MN_IOMUXC_SAI5_RXD0_GPIO3_IO21 0X19 // FW-DWNLD MX8MN_IOMUXC_SAI5_RXD1_GPIO3_IO22 0X19 // IRQ >; }; 3.  imx8mn_gki.fragmentを変更します。 ファイル:android_build/vendor/nxp-opensource/kernel_imx/arch/arm64/configs/imx8mn_gki.fragment "CONFIG_NXP_NFC_I2C=m" を  imx8mn_gki.fragment に追加します。 4. Androidの対応するボード設定ファイルに設定を追加してください。 - android_build/device/nxp/imx8m/evk_8mn/ に移動してください  BoardConfig.mkを修正します。 # selinux permissive + BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive BOARD_SEPOLICY_DIRS := \ $(CONFIG_REPO_PATH)/imx8m/sepolicy \ $(IMX_DEVICE_PATH)/sepolicy \ + vendor/nxp/nfc/sepolicy \ + vendor/nxp/nfc/sepolicy/nfc + include vendor/nxp/nfc/BoardConfigNfc.mk - ShareBoardConfig.mkに”nxpnfc_i2c.ko”を追加します。パスとファイル名が正しいか確認します。 $(KERNEL_OUT)/drivers/net/phy/realtek.ko \ $(KERNEL_OUT)/drivers/pps/pps_core.ko \ $(KERNEL_OUT)/drivers/ptp/ptp.ko \ $(KERNEL_OUT)/drivers/net/ethernet/freescale/fec.ko + $(KERNEL_OUT)/drivers/nfc/pn7160/nxpnfc_i2c.ko endif $(KERNEL_OUT)/drivers/trusty/trusty-core.ko \ $(KERNEL_OUT)/drivers/trusty/trusty-log.ko \ $(KERNEL_OUT)/drivers/trusty/trusty-ipc.ko \ $(KERNEL_OUT)/drivers/trusty/trusty-virtio.ko \ + $(KERNEL_OUT)/drivers/nfc/pn7160/nxpnfc_i2c.ko else BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \ $(KERNEL_OUT)/drivers/input/touchscreen/goodix_ts.ko \ $(KERNEL_OUT)/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_i2c.ko Endif - Compatibility_matrix.xmlに以下を追加します netutils-wrapper 1.0 android.hardware.emvco 1 IEmvco default -  device_framework_matrix.xmlに以下を追加します。 nxp.hardware.secureime 1 ISecureIME default nxp.hardware.imx_dek_extractor 1 IDek_Extractor default vendor.nxp.nxpnfc 2 INxpNfc default android.hardware.emvco 1 IEmvco default - evk_8mn.mkに以下を追加します。 # ------nfc------- $(call inherit-product, vendor/nxp/nfc/device-nfc.mk) $(call inherit-product, vendor/nxp/emvco/device-emvco.mk) PRODUCT_PACKAGES += \ android.hardware.nfc-service.nxp PRODUCT_PACKAGES += \ com.nxp.emvco \ com.nxp.nfc \ nfc_nci_nxp_pn72xx - init.rcにnxpnfc_i2cを追加します。 # Grant permission for fetching available_pages info of statsd chown system system /proc/pagetypeinfo chmod 0440 /proc/pagetypeinfo exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d \ /vendor/lib/modules nxpnfc_i2c write /sys/power/wake_lock nosleep on post-fs-data && property:vendor.skip.charger_not_need=0 setprop vold.post_fs_data_done 1 - ueventd.nxp.rc に nxpnfc を追加します。 /sys/devices/virtual/thermal/thermal_zone* trip_point_0_hyst 0660 system system /sys/devices/virtual/thermal/thermal_zone* trip_point_1_hyst 0660 system system /dev/dmabuf_imx 0664 system system /sys/class/backlight/* brightness 0660 system system /dev/ttymxc1 0666 nfc nfc /dev/ttymxc2 0666 nfc nfc /dev/nxpnfc 0666 nfc nfc # for libcamera /dev/media* 0660 system camera /dev/v4l-subdev* 0660 system camera 5. NXP AOSPパッチの適用 NXP公式のNFCパッチはAOSP android-15.0.0_r1のみで、 android-15.0.0_r1と android-15.0.0_r32では大きな違いがあります。このため、パッチを適用する前に、Android-15.0.0_r1からNFCフォルダをコピーして、Android-15.0.0_r32のNFCフォルダを置き換えます。 まず、GitHubからAOSP android-15.0.0_r1をダウンロードしてください。 $ mkdir android-15.0.0_r1 $ cd android-15.0.0_r1 $ repo init -u https://android.googlesource.com/platform/manifest -b android-15.0.0_r1 $ repo sync 次に、以下のフォルダをandroid-15.0.0_r32から削除します。そして、Android-15.0.0_r1から次のNFCフォルダをコピーして、Android-15.0.0_r32の同じフォルダを置き換えます。 パッケージ/apps/Nfc frameworks/base/nfc frameworks/base/nfc-extras システム/NFC 以下にその例をご紹介します。 $ rm -rf android_build/packages/apps/Nfc $ cp -ra android-15.0.0_r1/packages/apps/Nfc android_build/packages/apps/ 私はGitHubからパッチをダウンロードするスクリプトを作成します。お客様は以下のスクリプトを、android_buildと同じディレクトリに配置できます。 AOSP_adaptation.sh # nxp_nci_hal_nfc git clone "https://github.com/nxp-nfc-infra/nxp_nci_hal_nfc.git" cd nxp_nci_hal_nfc git checkout br_ar_15_comm_infra_dev cp -rf * ../android_build/packages/apps/Nfc/ cd .. # nxp_nci_hal_libnfc-nci git clone "https://github.com/nxp-nfc-infra/nxp_nci_hal_libnfc-nci.git" cd nxp_nci_hal_libnfc-nci git checkout br_ar_15_comm_infra_dev cp -rf * ../android_build/system/nfc/ cd .. # nfcandroid_nfc_hidlimpl git clone "https://github.com/nxp-nfc-infra/nfcandroid_nfc_hidlimpl.git" cd nfcandroid_nfc_hidlimpl git checkout br_ar_15_comm_infra_dev cp -rf * ../android_build/hardware/nxp/nfc cd .. # nfcandroid_frameworks git clone "https://github.com/nxp-nfc-infra/nfcandroid_frameworks.git" cd nfcandroid_frameworks git checkout br_ar_15_comm_infra_dev mkdir ../android_build/vendor/nxp/frameworks cp -rf * ../android_build/vendor/nxp/frameworks cd .. # nfcandroid_emvco_aidlimpl git clone "https://github.com/nxp-nfc-infra/nfcandroid_emvco_aidlimpl.git" cd nfcandroid_emvco_aidlimpl git checkout br_ar_15_comm_infra_dev mkdir ../android_build/hardware/nxp/emvco cp -rf * ../android_build/hardware/nxp/emvco cd .. # nfcandroid_platform_reference git clone "https://github.com/nxp-nfc-infra/nfcandroid_platform_reference.git" cd nfcandroid_platform_reference git checkout br_ar_15_comm_infra_dev cp -rf vendor/nxp/* ../android_build/vendor/nxp/ cd .. # nfcandroid_infra_test_apps git clone https://github.com/nxp-nfc-infra/nfcandroid_infra_test_apps.git cd nfcandroid_infra_test_apps/ git checkout br_ar_15_comm_infra_dev cd test_apps/ cp -rf SMCU_Switch/ ../../android_build/packages/apps/ cp -rf EMVCoModeSwitchApp/ ../../android_build/packages/apps/Nfc/ cp -rf load_unload/ ../../android_build/hardware/nxp/nfc/ cp -rf SelfTestAidl/ ../../android_build/hardware/nxp/nfc/ cd ../.. # nfcandroid_infra_comm_libs git clone "https://github.com/nxp-nfc-infra/nfcandroid_infra_comm_libs.git" cd nfcandroid_infra_comm_libs git checkout br_ar_15_comm_infra_dev cp -rf nfc_tda/ ../android_build/system/ cp -rf emvco_tda/ emvco_tda_test/ ../android_build/hardware/nxp/emvco/ cp -rf NfcTdaTestApp/ ../android_build/packages/apps/Nfc/ cd .. Apply_patches.sh cd android_build/build/bazel/ patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_build_bazel.patch cd ../release patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_build_release.patch cd ../../external/libchrome patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_external_libchrome.patch cd ../../frameworks/base patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_frameworks_base.patch cd ../../system/logging patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_system_logging.patch このため、 AOSP_adaptation.shを実行し、その後、 Apply_patches.shを実行します。 6. hardware/interfaces/compatibility_matrices に変更を加えます Androidのバージョンごとに互換性マトリックスが異なります。 ファイル: android_build/hardware/interfaces/compatibility_matrices/compatibility_matrix.202404.xml android.hardware.audio.effect 1-2 IFactory default + + nxp.hardware.imx_dek_extractor + 1 + + IDek_Extractor + default + + + + vendor.nxp.nxpnfc + 2 + + INxpNfc + default + + + + vendor.nxp.emvco + 1 + + INxpEmvco + default + + android.hardware.audio.sounddose 1-3 7. デバイス固有の .mk を変更 pn7160の場合、 NXP_NFC_HWはpn7160と等しくなる必要があります。 pn7220の場合、 NXP_NFC_HWはpn7220_i2csと等しくなる必要があります。 File : android_build/vendor/nxp/nfc/device-nfc.mk ##### ##### NXP NFC Device Configuration makefile ###### NXP_NFC_HOST := $(TARGET_PRODUCT) ifndef TARGET_NXP_NFC_HW NXP_NFC_HW := pn7160 else NXP_NFC_HW := $(TARGET_NXP_NFC_HW) endif NXP_NFC_PLATFORM := pn54x NXP_VENDOR_DIR := nxp NXP_I2CM_S := $(TARGET_NXP_I2C_M_S) ファイル: android_build/vendor/nxp/emvco/device-emvco.mk NXP_VENDOR_DIR := nxp NXP_NFC_HW := $(TARGET_NXP_NFC_HW) ifeq ($(strip $(TARGET_NXP_NFC_HW)),) NXP_NFC_HW := pn7160 endif # Nfc service has dependency with EMVCo JAR PRODUCT_PACKAGES += \ com.nxp.emvco 8. これで、Android BSPの構築を始めることができます。 i.MX8MN EVKの場合、  $ source build/envsetup.sh $ lunch evk_8mn-nxp_stable-userdebug $ export TARGET_RELEASE=nxp_stable $ build_build_var_cache $ ./imx-make.sh -j4 2>&1 | tee build-log.txt BSPをビルディングする際には、ビルド中に多くのエラーが発生します。以下にいくつかの誤りと参考解決策を挙げておきます。  エラー リファレンス・ソリューション nfc_aconifg_flagsについて苦情を申し上げます。 packages/apps/Nfc/flags/Android.bp aconfig_declarations { // name: "nfc_aconfig_flags", name: "com.android.nfc.flags-aconfig", package: "com.android.nfc.flags", container: "system", srcs: ["nfc_flags.aconfig"], } java_aconfig_library { // name: "nfc_aconfig_flags_lib", // aconfig_declarations: "nfc_aconfig_flags", name: "com.android.nfc.flags-aconfig-java", aconfig_declarations: "com.android.nfc.flags-aconfig", min_sdk_version: "33", apex_available: [ "//apex_available:platform", "com.android.nfcservices", ], } java_library { name: "nfc_flags_lib", sdk_version: "system_current", min_sdk_version: "33", srcs: [ "lib/**/*.java", ], static_libs: [ "com.android.nfc.flags-aconfig-java", ],  android.hardware.nfc-V2-ndk に関して苦情を伝える ファイル: hardware/interfaces/nfc/aidl/vts/functional/Android.bp android.hardware.nfc-V2-ndk を変更しますandroid.hardware.nfc-V1-ndkへ platform_testing/build/tasks/tests/native_test_list.mk: error: continuous_native_tests:モジュール 'libnfc-nci-jni-tests' のインストールされたファイルが不明です。 'libnfc-nci-jni-tests' を削除します。  native_test_list.mk error: パッケージ/apps/Nfc/tests/instrumentation/Android.bp:6:1:モジュール「NfcNciInstrumentationTests」バリアント「Android_common」は、java_sdk_library「android.test.runner」に直接依存することはできません。「android.test.runner.stubs」に頼ってみて、「android.test.runner.stubs.system」「android.test.runner.stubs.test」または「android.test.runner.impl」その代わり ヒントはエラーメッセージに記載されています。 "android.test.runner" を  "android.test.runner.stubs"、"android.test.runner.stubs.system""android.test.runner.stubs.test"または"android.test.runner.impl"に変更します。 エラー: vendor/nxp/frameworks/nfc/Android.bp:12:1:モジュール "com.nxp.nfc"バリアント"android_common"は、このモジュールから見えない //frameworks/base/nfc:framework-nfc.impl に依存しています。 "//vendor/nxp/frameworks/nfc"を可視性に追加する必要があるかもしれません。 ファイル: frameworks/base/nfc/Android.bp permitted_packages: [ "android.nfc", "com.android.nfc", ], impl_library_visibility: [ "//frameworks/base:__subpackages__", "//cts/hostsidetests/multidevices/nfc:__subpackages__", "//cts/tests/tests/nfc", "//vendor:__subpackages__", "//packages/apps/Nfc:__subpackages__", ], packages/apps/Nfc/nci/src/com/android/nfc/dhimpl/NativeT4tNfceeManager.java:20: エラー:重複クラス:com.android.nfc.dhimpl.nativet4tnfceemanager ファイルを編集してください。 パッケージ/apps/Nfc/nci/src/com/Android/nfc/dhimpl/NativeT4tNfceeManager.java そして重複したクラスをコメントアウトします。 android/R.java:12483:エラー: フィールド FLAG_NFC_ASSOCIATED_ROLE_SERVICES を解決できません     @android.注釈。FlaggedApi(android.nfc.Flags.FLAG_NFC_ASSOCIATED_ROLE_SERVICES) 編集 frameworks/base/nfc/java/android/nfc/flags.aconfig 下のフラグを追加してください。 flag { name: "nfc_associated_role_services" is_exported: true namespace: "nfc" description: "Share wallet role routing priority with associated services" bug: "366243361" } 失敗: platform_testing/build/tasks/tests/native_test_list.mk: エラー: continuous_native_tests: モジュール 'libnfc-nci-tests'のインストールされたファイルが不明です。  native_test_list.mkのlibnfc-nci-testを削除します。 prebuilts/clang/host/linux-x86/clang-r536225/include/c++/v1/string:780:43: error: implicit instantiation of undefined template 'std::char_traits '   780 |   static_assert((is_same<_CharT, typename traits_type::char_type>::value)、       |                                           ^ packages/apps/Nfc/nci/jni/NativeNfcTda.cpp:32:35: note: ここで要求されるテンプレートクラス「std::basic_string 」のインスタンス化    32 | 静的 std::basic_string sRxTdaDataBuff;       |                                   ^ パッケージ/アプリ/Nfc/nci/jni/NativeNfcTda.cppを編集してください using android::base::StringPrintf; extern bool nfc_debug_enabled; SyncEvent sCtLibSyncEvt; //static std::basic_string sRxTdaDataBuff; static std::basic_string sRxTdaDataBuff; packages/apps/Nfc/nci/jni/NativeT4tNfcee.cpp:493:21: エラー: 'append'への呼び出しに一致するメンバー関数がありません。  493 |      sRxDataBuffer.append(data.p_data,data.len);       |       ~~~~~~~~~~~~~~^~~~~~ パッケージ/アプリ/Nfc/nci/jni/NativeT4tNfcee.cppを編集してください void NativeT4tNfcee::t4tReadComplete(tNFA_STATUS status, tNFA_RX_DATA data) { mT4tOpStatus = status; if (status == NFA_STATUS_OK) { if (data.len > 0) { sRxDataBuffer.insert(sRxDataBuffer.end(), data.p_data, data.p_data + data.len); LOG(DEBUG) << StringPrintf("%s: Read Data len new: %d ", __func__, data.len); } } SyncEventGuard g(mT4tNfcEeRWCEvent); mT4tNfcEeRWCEvent.notifyOne(); } frameworks/base/core/java/android/provider/Settings.java:2351: エラー: フィールド FLAG_NFC_ACTION_MANAGE_SERVICES_SETTINGS を解決できませんでした @FlaggedApi(android.nfc.Flags.FLAG_NFC_ACTION_MANAGE_SERVICES_SETTINGS) ファイル: frameworks/base/nfc/java/android/nfc/flags.aconfig flags.aconfig に以下を追加します flag { name: "nfc_action_manage_services_settings" is_exported: true namespace: "nfc" description: "Add Settings.ACTION_MANAGE_OTHER_NFC_SERVICES_SETTINGS" bug: "358129872" } エラーメッセージには、エラーを修正するためのヒントがいくつか含まれているため、表に記載されていないエラーもあります。お客様はヒントに従い、ニーズに応じてソースコードを変更することができます。 時々、お客様はr1とr32のソースコードを比較できます。こちらは AOSP ソースコード android-15.0.0_r32 と android-15.0.0_r1です。 9. 画像をi.MX8MN EVKボードにダウンロードします - 8MN EVKボード上でダウンロードモードに切り替えます - まず、Android BSP WebページからAndroid 15 BSP i.MX8MN EVKデモイメージをダウンロードします。UUUスクリプトと必要なイメージファイルはすでにデモイメージパッケージに入っているためです。  - ここから UUU をダウンロードします: リリース · nxp-imx/mfgtools - UUU実行ファイルをデモイメージフォルダに配置します。 uuu_imx_android_flash.batが同じフォルダに配置されているスクリプトです。 - ビルドに成功した後、画像をデモイメージのフォルダにコピーします。画像は、android_build/out/target/product/evk_8mn/ に位置しています - UUUスクリプトを実行して、画像をEVKボードにダウンロードします。 参考情報: Yocto Linux + PN7160を実行しているi.MX6ULL EVK i.MX8M NanoボードでPN7160をAndroid 14に移植 i.MXアプリケーション・プロセッサ用Android OS | NXP Semiconductors PN7160/PN7220 – Android 15 移植ガイド プラグ・アンド・プレイNFCフロントエンド、統合ファームウェア搭載 | NXP Semiconductors
View full article
Flash layout for new boot flow with TF-A Please note that the LSDK memory layout for TF-A boot flow explained in this topic is only applicable for LSDK 18.12 and newer releases.  The following table shows the memory layout of various firmware stored in NOR/NAND/QSPI flash device or SD card on all QorIQ Reference Design Boards. When the board boots from NOR flash, the NOR bank from which the board boots is considered as the "current bank" and the other bank is considered as the "alternate bank". For example, if LS1043ARDB boots from NOR bank 4, to update an image on NOR bank 0, you need to use the "alternate bank" address range,0x64000000 - 0x64F00000. Firmware Definition MaxSize Flash Offset (QSPI/NAND flash) Absolute address (NOR bank 0 on LS1043ARDB, LS1021ATWR) Absolute address  (NOR bank 4 LS1043ARDB, LS1021ATWR) Absolute address (NOR bank 0 on LS2088ARDB) Absolute address (NOR bank 4 on LS2088ARDB) SD Start Block No. RCW + PBI + BL2 (bl2.pbl) 1 MiB 0x00000000 0x60000000 0x64000000 0x580000000 0x584000000 0x00008 ATF FIP Image (fip.bin) BL31 + BL32 + BL33 4 MiB 0x00100000 0x60100000 0x64100000 0x580100000 0x584100000 0x00800 Boot firmware environment 1 MiB 0x00500000 0x60500000 0x64500000 0x580500000 0x584500000 0x02800 Secure boot headers 2 MiB 0x00600000 0x60600000 0x64600000 0x580600000 0x584600000 0x03000 Secure header or DDR PHY FW 512 KiB 0x00800000 0x60800000 0x64800000 0x580800000 0x584800000 0x04000 Fuse provisioning header 512 KiB 0x00880000 0x60880000 0x64880000 0x580880000 0x584880000 0x04400 DPAA1 FMAN ucode 256 KiB 0x00900000 0x60900000 0x64900000 0x580900000 0x584900000 0x04800 QE/uQE firmware 256 KiB 0x00940000 0x60940000 0x64940000 0x580940000 0x584940000 0x04A00 Ethernet PHY firmware 256 KiB 0x00980000 0x60980000 0x64980000 0x580980000 0x584980000 0x04C00 Script for flashing image 256 KiB 0x009C0000 0x609C0000 0x649C0000 0x5809C0000 0x5849C0000 0x04E00 DPAA2-MC or PFE firmware 3 MiB 0x00A00000 0x60A00000 0x64A00000 0x580A00000 0x584A00000 0x05000 DPAA2 DPL 1 MiB 0x00D00000 0x60D00000 0x64D00000 0x580D00000 0x584D00000 0x06800 DPAA2 DPC 1 MiB 0x00E00000 0x60E00000 0x64E00000 0x580E00000 0x584E00000 0x07000 Device tree(needed by uefi) 1 MiB 0x00F00000 0x60F00000 0x64F00000 0x580F00000 0x584F00000 0x07800 Kernel lsdk_linux.itb 16 MiB 0x01000000 NA NA NA NA 0x08000 Ramdisk rfs 32 MiB 0x02000000 NA NA NA NA 0x10000 The following figures highlight the changes in the flash layout for previous boot flow (with PPA) and flash layout for TF-A boot flow. Flash layout for previous boot flow (with PPA) Changed flash layout for TF-A boot flow QorIQ LS1 Devices QorIQ LS2 Devices
View full article
Zephyr培训资源 以下是一些资源,帮助您更好地了解Zephyr: 本篇 恩智浦 Zephyr 入门教程将通过 MCUXpresso for VS Code 和 MCUXpresso Installer 向您介绍所有 Zephyr 环境设置步骤,帮助您构建并运行第一个 Zephyr 应用程序。 本分步实验室指南(来自恩智浦技术日培训)从 " Hello,World " 开始,然后引导您完成有关 Kconfig、设备树和调试方法的有用教程: 实践研讨会:在 Visual Studio Code 中使用 Zephyr™ 操作系统进行开发 本教程展示了 Zephyr 强大的便携性。演示了将 FRDM-MCXN947 的 LVGL 演示移植到 FRDM-RW612 的简单步骤: 恩智浦 Zephyr 显示器便携性演示 想了解更多?访问我们 Zephyr 登录页面的 “培训” 部分,查找恩智浦在线研讨会和在线培训 ——只需点击页面顶部的 “培训” 选项卡即可 返回 Zephyr 知识中心
View full article
KW38 - 使用 OTAP 客户端软件对 KW38 设备进行重新编程 简介 空中编程(OTAP)是NXP提供的一项基于蓝牙低功耗(Bluetooth LE)的定制服务,提供升级微控制器中运行的软件的解决方案。本文件指导用户通过空中编程(OTAP)Bluetooth LE服务,将新的软件镜像加载到KW38设备中。。 软件要求 MCUXpresso IDE 或 IAR Embedded Workbench IDE。 FRDM-KW38 SDK。 IoT Toolbox 应用程序,适用于 Android 和 iOS 系统。你也可以从以下帖子下载 IoT Toolbox 应用程序的 APK 文件:Android 版 IoT Toolbox 硬件要求 FRDM-KW38板。 带有 IoT Toolbox 应用程序的智能手机。 OTAP 客户端软件在更新过程中使用的 KW38 闪存 默认情况下,512KB KW38 闪存被分区为: 一个 256KB 的程序闪存阵列 (P-Flash),分为 2KB 的扇区,闪存地址范围从 0x0000_0000 到 0x0003_FFFF。 一个256KB的FlexNVM数组,分为2KB的扇区,地址范围从0x1000_0000到0x1003_FFFF。 别名内存 (Alias memory),地址范围从 0x0004_0000 到 0x0007_FFFF。对别名内存的写入或读取操作分别会修改或返回 FlexNVM 的内容。换句话说,别名内存是使用不同地址来访问 FlexNVM 内存的另一种方式。 以下几点将简化说明 OTAP 服务的工作原理:   OTAP 应用程序由两个独立的部分组成,即 OTAP 引导加载程序和 OTAP 客户端。OTAP 引导加载程序会验证 OTAP 客户端中是否有可用的新镜像,以对设备进行重新编程。另一方面,OTAP 客户端软件提供了所需的蓝牙低功耗自定义服务,使 OTAP 客户端设备(待重新编程的设备)能够与 OTAP 服务器设备(包含用于重新编程 OTAP 客户端设备的镜像的设备)进行通信。因此,首次准备软件时,需要对 OTAP 客户端设备进行两次编程,首先是 OTAP 引导加载程序,然后是 OTAP 客户端软件。使两个不同的软件能够在同一设备中共存的机制是将它们分别存储在不同的内存区域。这是通过在链接器文件中为每个软件指定不同的内存区域来实现的。对于 KW38 设备,OTAP 引导加载程序预留了一个从 0x0000_0000 到 0x0000_1FFF 的 8KB 存储空间,因此,内存的其余部分除其他用途外,由 OTAP 客户端软件预留。     为 OTAP 客户端设备生成新的镜像文件时,我们需要在链接器文件中指定代码将以 8KB 的偏移量进行放置(就像 OTAP 客户端软件所做的那样),因为必须保留这些地址范围以避免覆盖 OTAP 引导加载程序。新应用程序还应在相应的地址包含引导加载程序标志,以确保其正常工作(稍后我们将回到这一点)。     当 OTAP 客户端设备和 OTAP 服务器设备连接且正在进行下载时,OTAP 服务器设备通过蓝牙低功耗将镜像数据包(称为块)发送到 OTAP 客户端设备。OTAP 客户端设备可以将这些块存储在外部 SPI 闪存(FRDM-KW38 开发板上已预装)或片上 FlexNVM 区域中。这些块的存储目的地可在 OTAP 客户端软件中选择(本文将提供修改存储目的地的说明)。     当镜像传输完成且所有块都已从 OTAP 服务器设备发送到 OTAP 客户端设备后,OTAP 客户端软件会将诸如软件更新源(外部闪存或 FlexNVM)之类的信息写入称为引导加载程序标志的内存部分。然后,OTAP 客户端对微控制器(MCU)执行软件复位,以执行 OTAP 引导加载程序代码。接着,OTAP 引导加载程序代码读取引导加载程序标志,以获取使用新应用程序对设备进行重新编程所需的信息。请参见以下流程图,该图解释了这两个应用程序的流程。   由于新应用程序是按 8KB 的偏移量构建的,因此 OTAP 引导加载程序从 0x0000_2000 地址开始对设备进行编程,因此,OTAP 客户端应用程序会被新镜像覆盖。然后,OTAP 引导加载程序转移应用程序的流程,开始执行新代码。     实际上,如第 3 点所述,当启用 FlexNVM 存储时,OTAP 客户端软件和软件更新之间的边界并非恰好位于 P-Flash 和 FlexNVM 内存区域的边界上,此外,这些值可能会根据你的链接器设置而变化。要了解边界的位置,你应该检查项目中的实际内存地址。       在 IAR Embedded Workbench IDE 中配置和编程 OTAP 客户端软件 如最后一节所述,要完成 OTAP 实现所需的软件,需要在 FRDM-KW38 开发板上编程两个软件,即 OTAP 引导加载程序和 OTAP 客户端。本节将指导你使用 IAR Embedded Workbench IDE 进行编程,并配置设置以在外部存储和内部存储之间进行选择。 1- 第一步是在 KW38 中编程 OTAP 引导加载程序。解压 SDK,然后在以下路径中找到 OTAP 引导加载程序软件: \boards\frdmkw38\wireless_examples\framework\bootloader_otap\bm\iar\bootloader_otap.eww 2- 点击 “Download and Debug” 图标 (Ctrl + D),在开发板上编程 OTAP 引导加载程序项目。 KW38 编程完成并开始调试会话后,中止会话 (Ctrl + Caps Lock + D) ,以安全地停止 MCU。 3- 此时,您已将OTAP引导程序编程到您的KW38中。接下来是编程和配置 OTAP 客户端软件。请在以下路径找到 OTAP 客户端软件: FreeRTOS项目版本: \boards\frdmkw38\wireless_examples\bluetooth\otac_att\freertos\iar\otap_client_att_freertos.eww 裸机 (Baremetal) 项目版本: \boards\frdmkw38\wireless_examples\bluetooth\otac_att\bm\iar\otap_client_att_bm.eww 4- 然后,配置 OTAP 客户端以选择外部存储或内部存储。 要选择外部存储,请按照以下步骤操作(这是 SDK 项目中的默认配置): 4.1- 在工作区的源文件夹中找到 “app_preinclude.h” 头文件。搜索 “gEepromType_d” 定义,并将其值设置为 “gEepromDevice_AT45DB041E_c”。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_AT45DB041E_c 4.2- 打开项目选项窗口 (Alt + F7)。在 “Linker->Config” 窗口中,设置 “gUseInternalStorageLink_d=0”。   要选择内部存储,请按照以下步骤操作: 4.1 - 在工作区的源文件夹中找到 “app_preinclude.h” 头文件。搜索 “gEepromType_d” 定义,并将其值设置为 “gEepromDevice_InternalFlash_c”。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_InternalFlash_c 4.2- 打开项目选项窗口 (Alt + F7)。在 “Linker->Config” 窗口中,设置 “gUseInternalStorageLink_d=1”。   5- 配置好存储设置后,保存项目中的更改。然后点击 “Download and Debug” 图标(Ctrl + D) ,在开发板上编程软件。KW38 编程完成并开始调试会话后,中止会话 (Ctrl + Caps Lock + D) ,以安全地停止 MCU。 在 IAR Embedded Workbench IDE 中创建用于更新 OTAP 客户端软件的 SREC 镜像 本节将展示如何以无线示例为起点,创建与 OTAP 兼容的镜像,以使用 IAR Embedded Workbench IDE 对 KW38 OTAP 客户端进行重新编程。 1- 从 SDK 包的 Bluetooth 文件夹中选择任意示例,使用 IAR IDE 打开。Bluetooth 示例位于以下路径: \boards\frdmkw38\wireless_examples\bluetooth  在本示例中,我们将使用葡萄糖传感器项目: \boards\frdmkw38\wireless_examples\bluetooth\glucose_s\freertos\iar\glucose_sensor_freertos.eww 2- 打开 IAR 中的项目选项窗口 (Alt + F7)。在 “Linker->Config” 窗口中,编辑选项以包含 “gUseBootloaderLink_d=1” 标志,并更新 “gEraseNVMLink_d=0” 标志。当 gUseBootloaderLink_d 标志为 true 时,它向链接器文件指示镜像必须在第一个闪存扇区之后寻址,以避免覆盖 OTAP 引导加载程序软件(如我们之前所述)。另一方面,gEraseNVMLink_d 符号用于用 0xFF 模式填充未使用的 NVM 闪存区域。禁用此标志后,我们的软件镜像将不包含此模式,因此,镜像的总大小会减小,并提高 OTAP 下载速度和内存使用率。 3- 进入 “Output Converter” 窗口。取消选中 “Override default” 复选框,然后展开 “Output format” 下拉框,选择 “Motorola S-records” 格式。点击 “OK” 按钮完成设置。 4- 构建项目。 5- 在以下路径中找到 S-Record 文件 (.srec),并将其保存到智能手机上的已知位置。 \boards\frdmkw38\wireless_examples\bluetooth\glucose_s\freertos\iar\debug\glucose_sensor_freertos.srec 在 MCUXpresso IDE 中配置和编程 OTAP 客户端软件 如前文所述,为了完成OTAP实现,您需要在FRDM-KW38上编写两个软件:OTAP引导加载程序和OTAP客户端。本节将指导您使用MCUXpresso IDE对设置进行编程和配置,以选择外部存储或内部存储。 1- 打开 MCUXpresso IDE。在"快速入门面板"中点击"导入SDK示例"。 2- 选择 FRDM-KW38 图标,然后点击 “Next>”。 3- 导入 OTAP 引导加载程序项目。它位于 “wireless_examples -> framework -> bootloader_otap -> bm -> bootloader_otap”。点击 “Finish” 按钮。 4- 点击 “Debug” 图标 ,在开发板上编程 OTAP 引导加载程序项目。KW38 编程完成并开始调试会话后,中止会话 (Ctrl + F2),以安全地停止 MCU。 5- 重复步骤 1 到 3,在 MCUXpresso IDE 中导入 OTAP 客户端软件。对于 FreeRTOS 版本,它位于 “wireless_examples -> bluetooth -> otac_att -> freertos -> otap_client_att_freertos”;如果你更喜欢裸机版本,则位于 “wireless_examples -> bluetooth -> otac_att -> bm -> otap_client_bm_freertos”。。 6- 然后,配置 OTAP 客户端以选择外部存储或内部存储。 要选择外部存储,请按照以下步骤操作(这是 SDK 项目中的默认配置): 6.1- 在工作区的源文件夹下找到 “app_preinclude.h” 文件。搜索 “gEepromType_d” 定义,并将其值设置为 “gEepromDevice_AT45DB041E_c”。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_AT45DB041E_c 6.2- 导航至 “Project -> Properties -> C/C++ Build -> MCU settings -> Memory details”。按照下图所示编辑 Flash 字段,保持 RAM 不变。 要选择内部存储,请按照以下步骤操作: 6.1- 在工作区的源文件夹下找到 “app_preinclude.h” 文件。搜索 “gEepromType_d” 定义,并将其值设置为 “gEepromDevice_InternalFlash_c”。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_InternalFlash_c 6.2- 导航至 “Project -> Properties -> C/C++ Build -> MCU settings -> Memory details”。按照下图所示编辑 Flash 字段,保持 RAM 不变。 7- 配置好存储设置后,保存项目中的更改。然后点击 “Debug” 图标 ,在开发板上编程软件。KW38 编程完成并开始调试会话后,中止会话 (Ctrl + F2),以安全地停止 MCU。 在 MCUXpresso IDE 中创建 SREC 镜像以更新 OTAP 客户端中的软件 本节将展示如何以无线示例为起点,创建与 OTAP 兼容的镜像,以使用 MCUXpresso IDE 对 KW38 OTAP 客户端进行重新编程。 1- 如前所述,从 SDK 包的 Bluetooth 文件夹中导入任意示例。在 SDK 导入向导中,Bluetooth 示例位于 “wireless_examples -> bluetooth” 文件夹中。本示例将使用 “wireless_examples -> bluetooth -> glucose_s -> freertos -> glucose_sensor_freertos” 中的葡萄糖传感器项目。见下图。 2- 导航至 “Project -> Properties -> C/C++ Build -> MCU settings -> Memory details”。按照下图所示编辑 Flash 字段,保持 RAM 不变。最后几个字段向链接器文件指示镜像必须在第一个闪存扇区之后寻址,以避免覆盖 OTAP 引导加载程序软件,如我们在本文简介中所述。 3- 解压 KW38 SDK 包。将 “main_text_section.ldt” 链接脚本从以下路径拖放到工作区的 “linkscripts” 文件夹中。结果应与下图类似。 \middleware\wireless\framework\Common\devices\MKW38A4\mcux\linkscript_bootloader\main_text_section.ldt 4- 在 MCUXpresso IDE 中打开位于 linkscripts 文件夹中的 “end_text.ldt” 链接脚本文件。找到下图所示的部分,并删除 “FILL” 和 “BYTE” 语句。BYTE 和 FILL 行用于用 0xFF 模式填充未使用的 NVM 闪存区域。删除此代码后,我们的软件镜像将不包含此模式,因此,镜像的总大小会减小,并提高 OTAP 下载速度和内存使用率。 5- 打开 “app_preinclude.h” 文件,将 “gEepromType_d” 定义为内部存储。这是一个必要的虚拟定义,用于将引导加载程序标志放置在正确的地址,因此,这不会影响你之前在 MCU 中编程 OTAP 客户端和 OTAP 引导加载程序软件时选择的存储方法。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_InternalFlash_c 6- 在项目的 “framework” 文件夹中包含 “OtaSupport” 文件夹及其文件。同时在项目的 “framework -> Flash” 文件夹中包含 “External” 文件夹及其文件。“OtaSupport” 和 “External” 文件夹可在 SDK 中找到。你可以轻松地从 SDK 下载路径中拖动这些文件夹并将其放入 MCUXpresso 的工作区中。“OtaSupport” 和 “External” 文件夹位于: OtaSupport middleware\wireless\framework\OtaSupport External 中间件\无线\框架\Flash\External 结果应如以下图所示:  7- 依次进入 “Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU C Compiler -> Includes”。点击 “Include paths” 旁边的图标(见下图)。会弹出一个新窗口,然后点击 “Workspace” 按钮。 8- 在 “Folder selection” 窗口中展开项目目录,然后选择 “framework -> Flash -> External -> interface”(框架 -> 闪存 -> 外部 -> 接口)和 “framework -> OtaSupport -> interface” 文件夹。点击 “OK”按钮保存更改。 9- 确保 “OtaSupport” 和 “External” 文件夹已导入 “Include paths” 窗口中。然后点击 “Apply and Close” 按钮保存更改。 10- 点击此图标 保存并构建项目。然后,展开项目中的 “Binaries” 图标。右键点击 “.axf” 文件,选择 “Binary Utilities -> Create S-Record” 选项。生成的 S 记录文件将以 “.s19” 为扩展名保存在工作区的 Debug 文件夹中。将该 S 记录文件保存到智能手机上的已知位置。 使用 IoT Toolbox 应用程序测试 OTAP 客户端 本节介绍如何使用 IoT Toolbox 应用测试 OTAP 客户端软件。 1- 在你的智能手机上打开 IoT Toolbox 应用。选择 OTAP,然后点击 “SCAN” 以开始扫描合适的 OTAP 客户端设备。  2- 按下 FRDM-KW38 开发板上的 ADV 按钮 (SW2) 以开始广播。 3- 当你的智能手机找到 FRDM-KW38 开发板后,该设备将显示为 “NXP_OTAA”。将你的智能手机与此设备连接。随后,智能手机上会显示一个新窗口。  4- 点击 “Open” 按钮,查找 SREC 软件更新文件。 5- 点击 “Upload” 开始传输。等待下载完成。更新成功后,会显示确认消息。  6- 等待几秒钟,直到软件更新被编程到你的 MCU 中。新代码将自动开始运行。 如果对本主题有任何问题,请告知我。 BLE软件 千瓦 回复:KW38 - 使用 OTAP 客户端软件对 KW38 设备进行重新编程 嗨,EdgarLomeli   很多人无法使用 Google 应用商店,你能提供 IoT Toolbox 的最新 apk 安装包吗?  非常感谢。
View full article
Unable to debug i.MXRT1064 custom board. Hi,       I'm getting "Break at address "0x20d102" with no debug information available" message while trying to run my code in debug mode.       I'm using i.MXRT1064 custom board and programming it using, LinkServer LPC-Link2.       This board was working earlier without issue but now all of a sudden, this message appears.        I'm tried Release mode. I can successfully flash my board with the release code but then it seems the program doesn't run. I don't see any output, either from serial terminal or from display.       I also tried programming this board using Secure Provisioning Tool but it still doesn't work.         Can anyone help on where to focus or any leads for this issue? Re: Unable to debug i.MXRT1064 custom board. Hi MayLiu,        Thanks for your response.         Earlier, I did try that setting as suggested by you, but the IDE prompted an error (Failed to execute MI command: -target-download) when try to debug. I have attached a snapshot of that error for your reference.         Going back to the previous message, I wish to add that when I checked the address of where the current program is executing, it was showing that the code is in ROM region (address 0x20E35A). So somehow the code is unable to reach/start application code and is struck in ROM. Is my assumption correct? Can there be such a scenario? Re: Unable to debug i.MXRT1064 custom board. Hi @nxpsachve , Thank you so much for your interest in our products and for using our community. 1: Please try select Link application to RAM, then debug again. If your application can run successfully from RAM, please set the board as Serial Downloader mode, and then use the Secure Provisioning Tool to program your board by UART1 or USB1.   If your application  fails to run, I suggest you using an oscilloscope to check your board the power‑on sequence.   Wish it helps you. Best Regards MayLiu Re: Unable to debug i.MXRT1064 custom board. Hi @nxpsachve , I do not think MCUXpresso IDE  change BOOT configuration,  Boot behavior on NXP RT is determined by hardware boot config and boot mode pins.  Since the target can be detected in Serial Downloader mode, this indicates that the ROM is still running correctly. As a next step, you could: Perform a full chip erase, Switch the board to Internal Boot mode, and Try reconnecting with MCUXpresso IDE for debugging. Alternatively, you may also use the MCUXpresso Secure Provisioning Tool to program the application image. Best Regards MayLiu Re: Unable to debug i.MXRT1064 custom board. Hi MayLiu, Thanks for your suggestion. I would like to check if there are any such setting/configuration within MCUXpresso that can alter or impact the BOOT Conf? Just to rule out the IDE. The link server is able to detect the target when in serial download mode. Re: Unable to debug i.MXRT1064 custom board. Hi @nxpsachve , Thanks for your updated information. Based on the information you provided, it is possible that the CPU is currently executing code from the Boot ROM rather than your application code.   I would suggest checking the BOOT CFG and BOOT mode pin settings, ensuring that the device is configured to boot from user flash.   You may also try to set your board as serial downloader mode and then connecting via J-Link to confirm whether the debugger can  detect and communicate with the target.   Best Regards MatLiu
View full article
KSDKの例のリスト <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 現在のKSDK 1.3の例は、C:\Freescale\KSDK_1.3.0\examplesにあります。 C:\Freescale\KSDK_1.3.0\middleware の下にあるミドルウェア (tcpip、ファイルシステム) の例   他にも作成された例があります。   KSDK 1.3 (英語) KSDK 1.3 で FTM PWM を使用したレインボーカラー KDS3.0 + KSDK1.3でprintf()を使用して文字列をUARTに出力する方法 KSDKドライバーを使用した16x2 LCDの駆動 NFCコントローラーライブラリとKSDKの統合 KL43ZによるsLCDおよびKDS3.0 + KSDK1.3.0 +プロセッサエキスパートによるタッチセンスのサポート   KSDK 1.2 (英語) DMAを使用したKSDKによるADCフレキシブルスキャンモードのエミュレーション 初めてのKSDK1.2を書くKDS3.0 でのアプリケーション - Hello World と GPIO 割り込み付きトグル LED KSDKによるDCモータの速度制御とサーボモータの位置制御 [FTM + GPIO] KSDK搭載ラインスキャンカメラ [ADC + PIT + GPIO] フリースケール・カップ・スマート・レースのトラックの中心を検出する簡単な方法 Kinetis Design StudioのKSDKを使用したFatFs + SDHCデータロガー KSDKのセグメントLCDの例 KSDK GPIOドライバーとProcessor Expertの DAC Sinus Demo(PEx + KSDK 1.2 + KDS 3.0を使用) KSDKデモコードに基づいてカスタマイズされたKSDKプロジェクトを開始する方法   KSDK 1.1 (英語) SDKとCMSISを使用したKV31へのFIR機能実装のサンプルプロジェクト KDS 2.0 と KSDK 1.1.0 で LED を切り替える方法およびプロセッサエキスパート KSDK SPIマスタースレーブ(FRDM-K64F付き) Kinetisソフトウェア開発キット(KSDK)による超音波トランスデューサによる距離測定の設定(英語) Kinetis SDK 1.1.0用のUSB HID双方向汎用デバイスのデモ・プロジェクト 赤外線 (IR) センサで距離を測定するためのKinetisソフトウェア開発キット (SDK) の構成 KDSで初めてのKSDKアプリケーションの作成-Hello WorldとGPIO割り込み   KSDK 1.0 (英語) FRMD-K64F + KDS 1.1.0を使用した最初のトグルLEDアプリケーションの作成+ KSDK 1.0.0非プロセッサエキスパート SDKを使用した低消費電力アプリケーション KSDK I2C EEPROM の例 全般 Re:KSDKの例のリスト <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> これらの例はKSDK 2.0用に更新されますか - これらの例は廃止されたKSDKバージョン用です。 また、Processor Expertは明らかに時代遅れで、これ以上開発されることはないのでしょうか? 感謝 よろしくお願いします、デイブ
View full article
Example S32K144 FlexCAN Pretended Networking STOP mode test S32DS.ARM.2.2 ********************************************************************************  Detailed Description:  Example shows how to use FlexCAN 0 Pretended networking mode to allow FlexCAN  module to wake up MCU from STOP mode.  Wake up by Timeout and wake up by Match events are enabled.  Also pin interrupt can be used to exit STOP mode.  So MCU enters STOP mode by pressing SW3 button.  MCU exits STOP mode when one of following happens:  - no CAN message comes in 8sec (CAN PN timeout event)  - message with standard ID 0x554 or 0x555 comes (CAN PN match event)  - SW2 button is pressed (PTC12 interrupt)  In run mode blue LED is dimming and the rate is different for each wakeup event  ------------------------------------------------------------------------------  Test HW: S32K144 EVB-Q100  MCU: FS32K144UAVLL 0N57U  Fsys: 160MHz  Debugger: Lauterbach, OpenSDA  Target: internal_FLASH ******************************************************************************** General
View full article
CAN FDとCAN(動作していません) NXPコミュニティの皆様、こんにちは。 現在、CAN 構成に関する問題が発生しています。CAN 通信には基本設定を使用していますが、 PEAK CAN ViewerでCAN-FD モードを使用する場合にのみ機能します。ただし、標準のClassical CAN (非 FD) を試しても、応答がありません。 参考までに私のプロジェクトを添付しました。どなたか親切にレビューして、不足している構成や設定が見落とされているかどうか教えていただけませんか? 要約すると: CAN-FD + PEAK CAN Viewer :期待通りに動作 標準CAN + PEAK CANビューア:ボードからの応答なし ご提案やご指導をいただければ幸いです。 お手数ですが、よろしくお願いいたします。 よろしくお願いします、 ガネーシュ・バグワット Re: CAN FD and CAN(not Working) こんにちは、ジュリアン ご返信ありがとうございます。 最初はソフトウェアの構成の問題を疑ったので、ここに投稿しました。しかし、それは TJA1443 トランシーバ接続に関するハードウェア関連の問題であることが判明しました。フローティング ピンのため、通常の CAN では CAN メッセージを受信または送信できませんでしたが、FD ではなぜ動作していたのかはわかりません。 ハードウェアの問題を解決した後、すべてが期待どおりに動作するようになりました。 ご返信いただき、また、役に立つコミュニティ投稿を紹介していただき、改めて感謝申し上げます。 よろしくお願いします、 ガネーシャ Re: CAN FD and CAN(not Working) こんにちは@GaneshBhagwat PCAN-View ツールは、モード、ボーレート、サンプリング ポイントに対して正しく構成されていますか? バス上で表示されている内容を共有することは可能ですか?(ロジックアナライザまたはオシロスコープを使用して)フレームが正しく送信されているかどうかを確認するだけです。また、「機能していない」とはどういう意味か詳しく説明してください。受付時にコールバックを入力できますか?問題があるのはトランスミッションだけですか? CANInit 関数で、ID 0x80000 が受け入れ用に設定されていることがわかります。これが CAN アナライザーでも設定されているかどうかを確認してください。 このコミュニティ投稿を CAN 構成のガイダンスとして使用できます:例: S32K358 FlexCAN TXRX ISR S32DS35 RTD400/500 - NXPコミュニティ。 よろしくお願いします、 ジュリアン
View full article
AR1335 相机传感器驱动程序 @kerryzhou 我想知道您是否使用过这种摄像头传感器:AR1335 与任何恩智浦 MCU 配合使用。如果是,请与我分享驱动程序源代码。 此致, 法里德 Re: AR1335 camera sensor driver 你好,法比奥, ,我正在使用 yocto。 您可以在此处找到最新的 ar1335 传感器内核驱动程序: https://github.com/nxp-imx/isp-vvcam/tree/lf-5.15.y_2.0.0/vvcam/v4l2/sensor/ar1335 如果使用 Yocto,除了上述isp-vvcam之外,还需要 isp-imx: 如果对源代码感兴趣,可以在 Ubuntu 主机上下载并执行 bin 文件获取: https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/isp-imx-4.2.2.20.0.bin 用你在电路板支持包中使用的版本替换版本(这里我们使用 v20) 以下是如何为另一个传感器部署驱动程序的示例:https://www.nxp.com/docs/en/application-note/AN13712.pdf Re: AR1335 camera sensor driver 你好,谢谢。我是新手,所以我的问题可能很愚蠢。 您使用的是 Debian 还是 Yocto?能否提供股票驱动程序的链接? Re: AR1335 camera sensor driver 你好,法比奥, 是的,我可以使用原版驱动程序。 到目前为止,我使用的是高清 1080p 分辨率。 计划过几天还将尝试 4K 及以上的分辨率。 Re: AR1335 camera sensor driver 您好。 我想知道你们是否成功地将 AR1335 摄像机与 Mx8 plus 相连接。 请 法比奥 Re: AR1335 camera sensor driver 嗨,迈克尔、 >>我已经使用恩智浦 iMX8M Mini SoC 运行了这个传感器 我对此非常感兴趣。你有可能提供源代码和设备树文件吗? 我正试图让iMX8M-plus 也能这样做,因为它与 iMX8M-plus 非常相似。 谢谢 MC Re: AR1335 camera sensor driver 嗨,迈克-帕特黑、 已经请我们的内部专家进行了仔细检查,并在您的新帖中给您回复。 如有任何新问题,请关注该新帖。 顺祝商祺! kerry Re: AR1335 camera sensor driver 谢谢你,凯瑞!我开设了一个新主题来讨论这个问题: https://community.nxp.com/t5/i-MX-RT/RT1170-Using-MIPI-CSI-with-grayscale-or-raw-image-sensors/m-p/1270310#M14031 Re: AR1335 camera sensor driver 嗨,迈克-帕特黑、 从 AE 的内部描述来看,是芯片 MIPI CSI 无法支持,而不是 SDK 的问题。 因此,参考手册将来会添加相关描述。 但如果要使用原始数据,则需要使用并行 CSI 接口,而不是 mipi-csi。 很抱歉给您带来不便。 顺祝商祺! kerry Re: AR1335 camera sensor driver 嗨,凯瑞、 这是否意味着 RT1176(准确地说是 OV9281,数据格式为 RAW8)无法使用 8 位单色灰度图像传感器?这是硬件的基本限制,还是 SDK 的问题,将来会得到修复? 我已经使用恩智浦 iMX8M Mini SoC 运行了这个传感器,它似乎使用了类似的 MIPI CSI 外设,但需要移植到 RT1176。 贝斯特,迈克尔 Re: AR1335 camera sensor driver 适用于 Jetson nano 的 AR1335 Linux 设备驱动程序: https://www.arducam.com/docs/camera-for-jetson-nano/mipi-camera-modules-for-jetson-nano/driver-installation/ Re: AR1335 camera sensor driver 你好,fmabrouk、 很抱歉迟迟没有回复。 只要得到内部的 AE 回复,这对你来说确实是一个悲惨的故事:由于 VIDEO_MUX 错误,MIPI-CSI2 无法支持原始数据,这些信息将添加到 RT1170 参考手册中。 因此,请检查外部 AR1335 是否可以配置为支持,例如RGB? 现在是 10bit 原始数据,确实没有解决方法。 很抱歉回复晚了,非常感谢你们的努力。 顺祝商祺! kerry Re: AR1335 camera sensor driver 论坛其他成员或恩智浦团队对我的问题是否有任何反馈。我真的没时间了,需要解决这个问题!如果可以,请提供帮助。 Re: AR1335 camera sensor driver @kerryzhou 我希望你一切都好!我只是想跟进一下,看看你们是否对我的问题有任何更新。 我再次需要帮助配置 CSI 驱动程序,这样我才能捕获每个输出像素数据的 10 位原始数据。捕获数据后,我可以使用自己的软件将数据转换为 RGB 888 格式。 谢谢! Re: AR1335 camera sensor driver 你好,凯瑞、 还有一件事我想告诉你,相机传感器的输出格式是 RAW10(10 位):RAW10(10 位),而在当前的恩智浦 CSI/相机驱动程序中,我没有看到支持这种格式。我只看到这些: /*!@brief 像素格式定义。*/ typedef enum _video_pixel_format { /* RGB */ kVIDEO_PixelFormatXRGB8888 = FSL_VIDEO_FOURCC('X','R','2','4'),/*!< 32 位 XRGB8888。*/ kVIDEO_PixelFormatRGBX8888 = FSL_VIDEO_FOURCC('R','X','2','4'),/*!< 32 位 RGBX8888。*/ kVIDEO_PixelFormatXBGR8888 = FSL_VIDEO_FOURCC('X','B','2','4'),/*!< 32 位 XBGR8888。*/ kVIDEO_PixelFormatBGRX8888 = FSL_VIDEO_FOURCC('B','X','2','4'),/*!< 32 位 BGRX8888。*/ kVIDEO_PixelFormatRGB888 = FSL_VIDEO_FOURCC('R','G','2','4'),/*!< 24 位 RGB888。*/ kVIDEO_PixelFormatBGR888 = FSL_VIDEO_FOURCC('B','G','2','4'),/*!< 24 位 BGR888。*/ kVIDEO_PixelFormatRGB565 = FSL_VIDEO_FOURCC('R','G','1','6'),/*!< 16 位 RGB565。*/ kVIDEO_PixelFormatBGR565 = FSL_VIDEO_FOURCC('B', 'G', '1', '6'), /*!< 16 位 BGR565。*/ kVIDEO_PixelFormatXRGB1555 = FSL_VIDEO_FOURCC('X','R','1','5'),/*!< 16 位 XRGB1555。*/ kVIDEO_PixelFormatRGBX5551 = FSL_VIDEO_FOURCC('R','X','1','5'),/*!< 16 位 RGBX5551。*/ kVIDEO_PixelFormatXBGR1555 = FSL_VIDEO_FOURCC('X','B','1','5'),/*!< 16 位 XBGR1555。*/ kVIDEO_PixelFormatBGRX5551 = FSL_VIDEO_FOURCC('B','X','1','5'),/*!< 16 位 BGRX5551。*/ kVIDEO_PixelFormatXRGB4444 = FSL_VIDEO_FOURCC('X','R','1','2'),/*!< 16 位 XRGB4444。*/ kVIDEO_PixelFormatRGBX4444 = FSL_VIDEO_FOURCC('R','X','1','2'),/*!< 16 位 RGBX4444。*/ kVIDEO_PixelFormatXBGR4444 = FSL_VIDEO_FOURCC('X','B','1','2'),/*!< 16 位 XBGR4444。*/ kVIDEO_PixelFormatBGRX4444 = FSL_VIDEO_FOURCC('B','X','1','2'),/*!< 16 位 BGRX4444。*/ /* YUV。*/ kVIDEO_PixelFormatYUYV = FSL_VIDEO_FOURCC('Y', 'U', 'Y', 'V'), /*!< YUV422, Y-U-Y-V.*/ kVIDEO_PixelFormatYVYU = FSL_VIDEO_FOURCC('Y','V','Y','U'),/*!< YUV422, Y-V-Y-U.*/ kVIDEO_PixelFormatUYVY = FSL_VIDEO_FOURCC('U','Y','V','Y'),/*!< YUV422, U-Y-V-Y.*/ kVIDEO_PixelFormatVYUY = FSL_VIDEO_FOURCC('V','Y','U','Y'),/*!< YUV422, V-Y-U-Y.*/ kVIDEO_PixelFormatXYUV = FSL_VIDEO_FOURCC('X', 'Y', 'U', 'V'), /*!< YUV444, X-YU-V.*/ kVIDEO_PixelFormatXYVU = FSL_VIDEO_FOURCC('X','Y','V','U'),/*!< YUV444, X-Y-V-U.*/ } video_pixel_format_t; 能否在应用程序代码中将 Raw10 转换为 RGB888? 我附上了一些数据表供你参考。 Re: AR1335 camera sensor driver 你好,fmabrouk、 感谢您提供的信息。 请耐心等待,我将检查您的代码的更多细节,并与我们内部的 CSI 专家核实。 在我得到任何有价值的信息后,我会尽快通知你们。 请再给我一些时间,非常感谢! 顺祝商祺! kerry Re: AR1335 camera sensor driver @kerryzhou @jingpan 我用示波器验证了相机传感器正在流式传输数据;在调试代码时我能够捕获 CSI 读取寄存器:请参阅随附的屏幕截图。但是,我无法获得全帧缓冲区 CSI 中断。这还是与我初始化 MIPI CSI 的方式有关,你或其他人能否根据我在上一封邮件中说明的图像要求,帮我正确设置一下? 干杯 Re: AR1335 camera sensor driver @kerryzhou 以下是我感兴趣的图像参数摘要:; [PLL 参数] ;目标 Vt 像素频率:220 MHz ;输入时钟频率:24 MHz;实际 Vt 像素时钟:220 MHz ;实际操作像素时钟:110 MHz ;pll_multiplier(M 值)= 55 ;pll_clk_div2(N 值)= 2 ;pll_multiplier2(M2 值)= 55;pll_clk_div2(N2 值)= 55 ;pll_clk_div2(N2 值)= 55 2 ;Fpfd = 12 MHz;Fvco = 660 MHz;Fvco2 = 660 MHz;Vt 系统分频器 = 1 ;Vt Pix 分频器 = 3 ;运算系统分频器 = 1;运算像素分频器 = 6 ;;[图像参数];每个请求的帧数 第二:30 ;输出列:640;输出行数:480 ;使用 Y 求和:未选中 ;仅限 X 的分箱:未选中 ;允许跳过:选中 ;空白计算:HB 最大,然后 VB ;;最大帧时间:33.3333 毫秒 ;最大帧时钟:7333333.3 clocks ; 读出模式:1,YSum:无,XBin: ; Horiz clks: 640 active + 1688 blank = 2328 total ; Vert rows:480 活动 + 2674 空白 = 总计 3154 ; 输出列:640 ; 输出行:480 ; FOV Cols:640 ; FOV 行:480 ; 实际帧时钟:7342512 个时钟 ; 行时间:10.582 usec / 2328 个时钟 ; 积分时间:33 毫秒。 ;帧时间:33.375055 毫秒 ;允许的最大帧速率:191.739fps ;每秒帧数:29.962 fps Re: AR1335 camera sensor driver @kerryzhou 我在 imx RT1170 上使用 mipi CSI2 演示代码从 AR1335 获取 480x640 图像。 我发现该相机传感器的输出格式为:10 位。我需要在 CSI 驱动程序中进行哪些更改才能捕获我需要的图像。 我使用制造商的工具生成了配置文件,但由于错误配置了 CSI 驱动程序,我还远远没有获得图像。 你能否建议需要在演示代码 CSI 驱动程序中修改哪些内容才能从 AR1335 捕获图像。 此致敬礼, Re: AR1335 camera sensor driver 你好,fmabrouk、 到目前为止,我们还没有关于导入其他相机传感器的直接文件。 据我所知,照相机传感器也应该有配置工具,可以进行配置并生成代码。 您的 AR1335 是否已经从自己的公司获得了相关驱动程序? 我还检查了内部,直到现在才找到 AR1335 RT 的相关驱动程序。 顺祝商祺! kerry Re: AR1335 camera sensor driver @kerryzhou 我正在使用这个摄像头传感器:imX RT1170 板上的 AR1335 而不是 OV5640。AR1335 只发送 10 位图像。我相信 OV5640 像素数据总线是 16 位。 如何修改恩智浦 SDK 随附的 mipi csi 演示代码,以便用该传感器获取图像? 我希望能有一些文档,指导如何将另一个相机传感器导入该演示代码。 非常感谢!   Re: AR1335 camera sensor driver 你好,fmabrouk、 关于你提到的时钟,你可以从 RT1170 参考手册中找到: 希望它能帮到你! 顺祝商祺! kerry Re: AR1335 camera sensor driver @kerryzhou @jingpan 除了我上面提出的问题外,如果我需要将像素时钟设置为 80MHz。在 imx RT1170 的 CSI2 mipi 演示代码中,我应该更改哪些寄存器? 谢谢! Re: AR1335 camera sensor driver @jingpan @kerryzhou 我仍在尝试将 AR1335 摄像头驱动程序移植到 ImX RT1170 CCI2 mipi 演示代码中。 在 CS2 mipi 代码中,我发现了这些时钟: CLOCK_SetRootClock(kCLOCK_Root_Csi2,&csi2CClockConfig); CLOCK_SetRootClock(kCLOCK_Root_Csi2_Esc,&csi2EscClockConfig); CLOCK_SetRootClock(kCLOCK_Root_Csi2_Ui,&csi2UiClockConfig); 谁能解释一下这些钟是用来做什么的? 谢谢! Re: AR1335 camera sensor driver 你好,fmabrouk、 到目前为止,我还没有找到有关 AR1335 的 RT 芯片驱动程序,我也在内部搜索过,但没有找到。 也许您可以从互联网上搜索,某些第三方可能有 AR1335 驱动程序。 Nxp 官方那边没有找到,直到现在,RT 主要使用 MT9M114 或 OV7725 摄像头模块。 很抱歉给您带来不便,并感谢您的理解。 顺祝商祺! kerry
View full article
S32M2xx - MOSFET switching adjustment for Motor control examples This article is applicable to all motor control application SWs as described in the following article. S32M2xx - Motor control use cases - NXP Community It has been found that on some of S32M24xEVBs an overheating of the power MOSFETs may occur. This will be addressed in the new release of the Motor control example SW and will be carried out in Motor control example SW for S32M24xEVB, S32M27xEVB and S32M276SFFRD. As a solution in the current release, the following settings are recommended. Extend deadtime: For S32M24xEVB, for FTM3, set Dead Time to 50 (corresponds to 625 nanoseconds): For S32M27xEVB and S32M276SFFRD, for LCU outputs channels 0 - 5, set LUT rise filter to 75 (corresponds to 625 nanoseconds): Set faster slew rates: Common for all EVBs:
View full article
Freescale Yocto Project main page Yoctoproject Framework Installing any Needed Package Using Yocto and i.MX Boards Testing Yocto for i.MX6 i.MX53 QSB - Quick Start Board i.MX6 Sabre Lite Board Build the image SDCard Image Yoctoproject Framework Yoctoproject is a framework for creating Linux distributions for embedded devices. Its layering mechanism makes it easy to add Linux to new target devices highly customized for a particular platform; it can include custom start-up scripts, software packages built with a high degree of optimization for a particular architecture, and different user interfaces from full Gnome desktop to a simple a serial console. Yocto has 2 basic layers: board support packages layer and core layer. In the BSP layer is where all the custom software and configuration tweaks for a particular platform are included, while the core layer provides the common software stack to provide from a simple command line interface to Sato desktop interface (Matchbox based and Gnome mobile software stack). A third layer could be added to provide additional user interfaces LXDE, XFCE, and more; YP is quite flexible&emdash;one of it major strengths. Installing any Needed Package Go to Yocto Project Quick Start and double check that you have all the necessary packages installed for your machine. For example, if building machine was an Ubuntu machine: $ sudo apt-get install gawk wget git-core diffstat unzip texinfo  build-essential chrpath libsdl1.2-dev xterm curl Using Yocto and i.MX Boards Please, go to project's README file in order to see the recommended instructions to download the source code. Testing Yocto for i.MX6 How to test Yocto for i.MX 6 i.MX53 QSB - Quick Start Board Edit conf/local.conf user config file and set imx53 Quick start board machine and enable parallel build features. MACHINE ?= "imx53qsb" BB_NUMBER_THREADS = "4" PARALLEL_MAKE = "-j 4" i.MX6 Sabre Lite Board Edit conf/local.conf user config file and set i.MX6 Sabrelite board machine and enable parallel build features MACHINE ?= "imx6qsabrelite" BB_NUMBER_THREADS = "4" PARALLEL_MAKE = "-j 4" if you've been facing problems to get yocto's images working on your i.MX Sabre Lite board, please take a look on this comment Re: The kernel sometins hang  in L3.0.35_4.0.0_130424 release Build the image some example of available image: image name description core-image-minimal A small image just capable of allowing a device to boot. core-image-base A console-only image that fully supports the target device hardware. core-image-sato Image with sato, a mobile environment and visual style for mobile devices.  The image supports X11 with a Sato theme, Pimlico applications and contains terminal, editor and file manager. fsl-image-test Builds contents core-image-base plus Freescale test applications and multimedia components. fsl-image-gui Builds contents of core-image-sato with Freescale test applications and multimedia with hardware accelerated X11 To build the image: $ bitbake Build using Dash instead can bring some problems. You can check what your system uses typing: "ls -l /bin/sh". On Ubuntu you can change it using "dpkg-reconfigure bash". Some Ubuntu releases you must use "dpkg-reconfigure dash" and choose Bash Built images are located in cd tmp/deploy/images SDCard Image sudo dd if=core-image-minimal-imx6qsabrelite.sdcard of=/dev/sdb i.MX Yocto Project: Frequently Asked Questions Yocto Project Re: Freescale Yocto Project main page All, we're closing this document for any further comments.  If you have a comment about this document or if you have an issue doing what the document describes, please start a new discussion.  Thanks. Re: Freescale Yocto Project main page Hello community, have an urgent need for input on touch screen integration. Please help! We're developing a project which requires touch screen function. The processor we use is i.MX6 dual light. Source code is Yocto 1.5. The LCD is working. We integrated the touch screen driver and can see on the computer that is connected to the board through serial port that touch screen reports coordinates for touches which indicates that touch screen does work. However, the system doesn't respond to touches. No icon displayed on the LCD is touched and the mouse arrow doesn't move with a finger touching the screen. Any advice where to look to see which part is broken? Thanks! Re: Freescale Yocto Project main page There's an error in the document, the part about dash.  You can check what your system uses typing: "ln -s /bin/sh" should probably be "ls -l /bin/sh" since "ln -s /bin/sh" would simply create a symbolic link in the current directory pointing to /bin/sh. Re: Freescale Yocto Project main page Please, LeonardoSandovalGonzalez, hkh and OtavioSalvador, create a new topic in imx.community. Please, remind to add all log available. With kernel version, MM version and branch name. It´s very difficult to us, hkh to provide support when the DOC has several comments on it. It´s much easier to start with a new and clear thread, with all the text futures it has in it (like quote, mark a answer as helpfull, as so on). Thanks in advance, Re: Freescale Yocto Project main page hkh, the issue you found regarding 'mesa' has been fixed in OE-Core and Poky yesterday. You can drop this change from meta-fsl-arm and it will work just fine. I am not a good person to help with GStreamer stuff. LeonardoSandovalGonzalez, can you take a look here? Re: Freescale Yocto Project main page Hello, I am using a Boundarydevices Nitrogen6x with a iMX6 Solo processor. I followed Daiane’s instruction to build my Yocto Dora image. I was able to build core-image-base, but had a problem with fsl-image-test. I found the following issue and applied the change manually (it must not be in the branch since sync was not retrieving the patch): https://lists.yoctoproject.org/pipermail/meta-freescale/2014-April/008057.html Also, I used menuconfig to disable ov5642 and enable ov5640. I can build the images, but can’t use gstreamer. I keep getting this error: ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0 VIDIOC_DQBUF failed. ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued VIDIOC_QBUF failed I know my hardware works because with the Timesys demo SD Card that came with the board I can use the following command to display the MIPI camera image on the LCD: $ gst-launch mfw_v4lsrc capture-mode=5 ! mfw_v4lsink disp-width=1280 disp-height=800 I have tried many gstreamer commands, and they all fail with the same error. One example is: $ gst-launch mfw_v4lsrc ! mfw_v4lsink I tried adding capture-mode=4 to the above command, and I get the same error. Are you aware of any issue with the latest Yocto Image that would cause this problem (something similar to the patch above that I had to apply)? What else can I try? Here is the complete snapshot of the error I am getting: root@nitrogen6x:~# gst-launch mfw_v4lsrc ! mfw_v4lsink MFW_GST_V4LSRC_PLUGIN 3.0.9 build on Apr 16 2014 09:57:53. pwm_config: pwm freq = 22000000, clk_select=1 clock_rate=66000000 ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xa9 MFW_GST_V4LSINK_PLUGIN 3.0.9 build on Apr 16 2014 09:57:39. Setting pipeline to PAUSED … pwm_config: pwm freq = 22000000, clk_select=1 clock_rate=66000000 ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xa9 Pipeline is live and does not need PREROLL … Setting pipeline to PLAYING … New clock: GstSystemClock ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0 ERROR: from element /GstPipeline:pipeline0/MFWGstV4LSrc:mfwgstv4lsrc0: Internal data flow error. Additional debug info: /yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer/0.10.36-r2/gstreamer-0.10.36/libs/gst/base/gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:pipeline0/MFWGstV4LSrc:mfwgstv4lsrc0: streaming task paused, reason error (-5) Execution ended after 10004586509 ns. Setting pipeline to PAUSED … Setting pipeline to READY … Setting pipeline to NULL … Total rendered:0 Freeing pipeline … [—>FINALIZE v4l_sink root@nitrogen6x:~# ov5640_mipi_camera_powerdown: powerdown=1, power_gp=0xa9 root@nitrogen6x:~# Thanks, Re: Freescale Yocto Project main page look under "sources" you will see "sources/meta-fsl-arm" "sources/meta-fsl-demos" "sources/poky" Re: Freescale Yocto Project main page Hi All, I want to know where exactly the actual source code will reside after "repo sync", since I see only bitbake, patch and *.inc files under source directory. Please let me know. Thank you, Gautham Re: Freescale Yocto Project main page After: $ source setup-environment build the local.conf file will be placed inside /build/conf/local.conf Re: Freescale Yocto Project main page Thanks DaianeAngolini Please let me know where can i find local.conf file, in fsl-community-bsp Folder tree after repo and clone fsl-community-bsp -> sources--------------------------------- > base                                 README                                  meta-fsl-arm                                 setup-environment                      meta-fsl-arm-extra                                                                                  meta-fsl-demos                                                                                  meta-openembedded                                                                                  poky Thanks Ram Re: Freescale Yocto Project main page The only difference would be the machine name to place in local.conf. Re: Freescale Yocto Project main page Hi All, I want to boot my Imx6q Sabre AI board with Yocto, can I follow the same steps suggested in this post, if not please suggest a thread/link that i can follow to achieve this. Thanks Ram Re: Freescale Yocto Project main page if you got  a custom board, why are you using a mx53qsb machine? unless the board is the same, you need to create your own board layer with proper changes. Leo Re: Freescale Yocto Project main page got a fsl-image-gui to compile for mx53qsb. I have a customboard with an attached LVDS lcd, but both vga as lcd remain black on boot. I attached a serial cable but only get gibberish over this (non-ascii characters). Does anyone know 1) where to find info on how to configure LVDS lcd and 2) where to configure tty/console so i can check my settings and actually see what's happening when I try the image Re: Freescale Yocto Project main page BrianEdmond, what branch are you using? The default distribution used on yocto (and meta-fsl-arm) is poky.conf. And by default X11 is selected. If you´re using master, you can override your DISTRO_FEATURES and remove X11. Take a look on poky.conf file under source Re: Freescale Yocto Project main page I did a build of fsl-image-test and it boots but I still seem to have an OpenGL ES environment which required X11.  In other builds I had a libGAL and libgal-fb which had the fbGetDisplayByIndex calls so I could run with fbdev.  Is there a configuration option I am missing? Brian Re: Freescale Yocto Project main page Thanks Nick. I have corrected the verbatim, adding the curl package. Leo Re: Freescale Yocto Project main page Ok if both packages are prerequisites then please change the text for the Ubuntu command in the section above entitled "Installing any Needed Package" to: $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \   build-essential chrpath libsdl1.2-dev xterm curl This would help new users who need to be able to follow the instructions verbatim Nick Re: Freescale Yocto Project main page You can use both for downloading the repo app. Both packages are requisites. Leo Re: Freescale Yocto Project main page In the prerequisites for an Ubuntu Machine there is sudo apt-get install wget but in the fsl-community-bsp-platform/README there is $: curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo Should this instead be $: wget https://dl-ssl.google.com/dl/googlesource/git-repo/repo -O ~/bin/repo or should curl be added as a prerequisite? Re: Freescale Yocto Project main page All ugly hacks. He might use: sed after every sync (as he did) use local_manifests.xml use gitconfig 'insteadOf' configuration all hacks! better to fix the firewall. Re: Freescale Yocto Project main page OtavioSalvador, any other workaround you know to avoid the issue that Nick found? Leo Re: Freescale Yocto Project main page It seems that to change the repo from using the git protocol to using the http prtocol can be achieved as follows: $ sed -i 's/git:/http:/g' .repo/manifest.xml $ sed -i 's|yoctoproject.org|yoctoproject.org/git|g' .repo/manifest.xml I hope this helps others who are experiencing problems when following the supported BSP installation process from behind firewalls that do not support git Re: Freescale Yocto Project main page Further investigation reveals that the url http://git.yoctoproject.org/git/meta-fsl-arm works Re: Freescale Yocto Project main page No idea Nick. You need to talk to the admin guy Re: Freescale Yocto Project main page Yes a 'git clone http://git.yoctoproject.org/meta-fsl-arm' confirms that the meta-fsl-arm committers are not running git update-server-info so http access does not work. Until this is fixed I will use a zip archive Re: Freescale Yocto Project main page Might use 'git clone' to check git command. Re: Freescale Yocto Project main page Thank you for the information on how to get started with the new Yocto based Freescale BSPs. Could you please assist me with a problem fetching the repositories? It appears that protocols/ports other than HTTP are blocked by the corporate firewall. Changing to HTTP though results in errors finding the info subdirectory. Can you please suggest a resolution to this problem? The output from repo is as follows: $ ./repo sync fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to git.yoctoproject.org: git.yoctoproject.org[0: 140.211.169.56]: errno=Connection timed out fatal: unable to connect to git.yoctoproject.org: git.yoctoproject.org[0: 140.211.169.56]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out error: Cannot fetch meta-fsl-arm error: Cannot fetch meta-fsl-arm-extra error: Cannot fetch meta-fsl-demos error: Cannot fetch fsl-community-bsp-base fatal: unable to connect to git.openembedded.org: git.openembedded.org[0: 140.211.169.152]: errno=Connection timed out fatal: unable to connect to git.openembedded.org: git.openembedded.org[0: 140.211.169.152]: errno=Connection timed out error: Cannot fetch meta-openembedded error: Exited sync due to fetch errors $ sed -i 's/git:/http:/g' .repo/manifest.xml $ ./repo sync Fetching projects:  16% (1/6)  fatal: http://git.yoctoproject.org/meta-fsl-arm/info/refs not found: did you run git update-server-info on the server? Fetching projects:  66% (4/6)  fatal: http://git.yoctoproject.org/poky/info/refs not found: did you run git update-server-info on the server? fatal: http://git.yoctoproject.org/meta-fsl-arm/info/refs not found: did you run git update-server-info on the server? fatal: http://git.yoctoproject.org/poky/info/refs not found: did you run git update-server-info on the server? error: Cannot fetch meta-fsl-arm error: Cannot fetch poky error: Exited sync due to fetch errors $ Re: Freescale Yocto Project main page Hi Thomas, sorry for the confusion but this document should not be used to build Freescale Yocto layers, please refer to this document How to test yocto for imx6 Repeat the steps, and try to build the same core image. If error persists, please send the description/log to the meta-freescale distribution list. Re: Freescale Yocto Project main page Hi Leonardo Sandoval Gonzalez, Met same error as Eduardo Gorio in busybox,. So, Freescale will support repo way for our build only? Either or customize build for our own board? BR Thomas Re: Freescale Yocto Project main page Hi gorio, please post your question on the meta-freescale mailing list. Check this document for instructions. Re: Freescale Yocto Project main page What does it wrong ? I did step by step from this tutorial.. gorio@ubuntu:/opt/poky/build$ bitbake core-image-minimal Loading cache: 100% |############################################################| ETA:  00:00:00 Loaded 1600 entries from dependency cache. Build Configuration: BB_VERSION        = "1.17.1" BUILD_SYS         = "x86_64-linux" NATIVELSBSTRING   = "Ubuntu-10.04" TARGET_SYS        = "arm-poky-linux-gnueabi" MACHINE           = "imx53qsb" DISTRO            = "poky" DISTRO_VERSION    = "1.3+snapshot-20130308" TUNE_FEATURES     = "armv7a vfp neon" TARGET_FPU        = "vfp-neon" meta              meta-yocto        = "master:d823759b4594143d522eae0b2a2498436a6dcb1e" meta-oe           = "master:6c9ac38e8b998e6739383ba91e0c4e0c0ed0094b" meta-fsl-arm      = "master:a502be66bef33f2016b43f8c7129b18f92d6e337" NOTE: Resolving any missing task queue dependencies NOTE: Preparing runqueue NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks ERROR: Function failed: do_configure (see /opt/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/busybox/1.20.2-r6/temp/log.do_configure.23360 for further information) ERROR: Logfile of failure stored in: /opt/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/busybox/1.20.2-r6/temp/log.do_configure.23360 Log data follows: | DEBUG: Executing python function sysroot_cleansstate | DEBUG: Python function sysroot_cleansstate finished | DEBUG: Executing shell function do_configure | trap: 80: SIGHUP: bad trap | ERROR: Function failed: do_configure (see /opt/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/busybox/1.20.2-r6/temp/log.do_configure.23360 for further information) ERROR: Task 914 (/opt/poky/meta/recipes-core/busybox/busybox_1.20.2.bb, do_configure) failed with exit code '1' NOTE: Tasks Summary: Attempted 1030 tasks of which 1026 didn't need to be rerun and 1 failed. Waiting for 0 running tasks to finish: Summary: 1 task failed:   /opt/poky/meta/recipes-core/busybox/busybox_1.20.2.bb, do_configure Summary: There was 1 ERROR message shown, returning a non-zero exit code. gorio@ubuntu:/opt/poky/build$ Re: Freescale Yocto Project main page Please refer to the bellow link to check the community supported way to build Freescale Yocto layers How to test yocto for imx6 Re: Freescale Yocto Project main page I'll update the page above soon. Meanwhile, I suggest you to use the instructions located at: Freescale/fsl-community-bsp-platform · GitHub For i.MX53 platform, use the denzil branch, for i.MX6, use the master branch. Rgds Rogerio Re: Freescale Yocto Project main page Hi Thanks a lot for the information. I tried to use the instruction above to build image for iMX6q SabreLite, but I've got a error below when I try to do "bitbake core-image-minimal" ================================= Summary: There were 2 WARNING messages shown. Summary: There were 2 ERROR messages shown, returning a non-zero exit code. WARNING: Host distribution "Ubuntu 10.10" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution. Loading cache: 100% |###########################################| ETA:  00:00:00 Loaded 1160 entries from dependency cache. ERROR: No recipes available for:   /home/its/poky/meta-fsl-arm/recipes-core/udev/udev_173.bbappend ERROR: Command execution failed: Exited with 1 ===================================== Anybody can help? I am very new to Yocto/bitbake, we used to build image by using ltib, Thanks a lot.
View full article
System Controller Firmware 101-はじめに 評価キットを使用する際には、BSPに含まれるSystem Controller Firmware(SCFW)バイナリが提供されます。このscfwバイナリはそのボード専用に調整されており、ご使用のハードウェアに合わせてボード依存部分を変更する必要がある場合があります。 本書ではSCFWのポーティング手順の概要を説明します。詳細についてはSystem Controller Porting guide(sc_fw_port.pdf)を参照してください。 システムを設定する SCFWはLinuxホスト上でビルドされます。システムをセットアップする手順は次のとおりです: GNU ARM Embedded Toolchain: 6-2017-q2-update June 28, 2017をARM websiteからダウンロードします: ファイルを展開するディレクトリを選択します。例: mkdir ~/gcc_toolchain cp ~/Downloads/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 ~/gcc_toolchain/ cd ~/gcc_toolchain/ tar xvjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ツールチェーンを含むディレクトリ(上記例では"~/gcc_toolchain")を指すようTOOLS環境変数を設定します。.bash_profileを編集してこの環境変数をexportすることもできます: export TOOLS=~/gcc_toolchain/ srec_catもビルドに必要です。これは通常srecordパッケージに含まれており、ubuntuでは次のように実行します: sudo apt-get update sudo apt-get install srecord これでポーティングキットのディレクトリ(例:scfw_export_mx8qm)に移動し、scfwをビルドできます。 System Controller Firmwareポーティングキット SCFW 移植キットには、SCFW をお客様のボードで動作するように変更できるソースファイルとオブジェクトファイルが含まれています。 最新のSystem Controller Firmwareポーティングキットは i.MX Software and development webpageから入手できます: ポーティングキットを入手したら展開します: tar xvzf imx-scfw-porting-kit-1.1.tar.gz‍ 次のようなファイル構成が表示されます: ポーティングキットはpackages以下に含まれており、READMEに展開手順が記載されています。基本的には: cd packages/ chmod a+x imx-scfw-porting-kit-1.1.bin ./imx-scfw-porting-kit-1.1.bin‍‍‍ エンドユーザーライセンス契約の同意を求められます: 同意するとポーティングキットは新しいフォルダに展開されます。フォルダ構成は次のとおりです: SCFWに関するドキュメントはdoc/pdfにあるか、html形式で提供されています。sc_fw_port.pdfに目を通すことを推奨します。 異なるSoCバリアント(QM A0、QM B0、QXP B0)のポーティングキットはsrcにtar.gzとして格納されています。その他のファイルはLinux、QNX、FreeRTOS、U-boot、ARM Trusted Firmwareなど向けのSCFWライブラリです。 複数のSoCバリアント(QXPとQMの両方など)で作業する場合は、すべてのポーティングキットを1つのディレクトリに展開することを推奨します。これにより、そのディレクトリから任意のバリアント向けにビルドできます。実行コマンドは次のとおりです: cd imx-scfw-porting-kit-1.1/ cd src/ find scfw_export_mx8*.gz -exec tar --strip-components 1 --one-top-level=scfw_export_mx8 -xzvf {} \;‍‍‍ scfw_export_mx8フォルダが作成され、ここからサポートされている任意のバリアント向けにSCFWをビルドできます。または、目的のバリアントのパッケージだけを展開して使用することもできます。 cd scfw_export_mx8/‍ すべてのビルドフォルダーには、SCFWのビルド結果が含まれており、プラットフォームにはSCFWのソースが保存されています。 ボード固有のコードはすべて「platform/board/mx8_」にあります。ここでderivativeはQXPやQMなどのi.MX8シリコンファミリ、board_nameはSCFWパッケージの対象ボード名です。 SCFWをお使いのボードにポーティングする最初のステップは、i.MX8のderivativeとボード用のフォルダを作成することです。既存のボード例をコピーしてフォルダ名を変更すると、すぐに開始できるプロジェクトが得られます。例: cp -r platform/board/mx8qm_val/ platform/board/mx8qm_myBoard/‍‍‍‍‍‍‍‍‍‍ この例のボードは「myBoard」と呼ばれ、i.MX8QM B0 デバイス用です。このボード用の SCFW を構築するには、単に次のコマンドを呼び出してください。 make qm R=B0 B=myBoard‍‍‍‍‍‍‍‍‍‍‍‍ ターゲットがi.MX8QXPの場合は、このデバイスをベースにしたボードを選び、「make qx」を実行するだけです。 ビルドオプションや詳細なブート情報などの追加情報はSCFWポーティングガイド(sc_fw_port.pdf)に記載されています。本書の第2章はポーティングプロセスの優れた入門です。 概要と有用な情報 PMICの設定概要およびboard.c一般的な修正 変更が必要な主なファイル(場合によっては唯一)は「board.c」で、場所は「platform/board/mx8X_board/」です。board.cファイルにはSCU UARTポート、PMIC初期化ルーチン、PMIC温度アラーム設定などボード関連情報のほとんどが含まれており、LDO電圧を設定したりPMICと通信するように変更することもできます。board.c内のすべての関数はSCU自身によって実行されるため、PMICとの通信に使用されるI2Cインターフェースにアクセスできます。 外部電源(たとえばPMIC LDO)で駆動されるSoCリソース(APコアやGPUなど)はboard_set_power_modeによってオン/オフされ、リソースを特定のPMIC電源にマッピングする処理はboard_get_pmic_infoで行われます。例としてi.MX8QMバリデーションボードでは、A53サブシステムがPF100 PMICカードの3番目のPMIC(PMIC_2_ADDR、アドレスはPMIC_0から開始)のSW2とPF8100 PMICカードの1番目のPMIC(PMIC_0_ADDR)のSW5により給電されます。 case SC_SUBSYS_A53: pmic_init(); if (pmic_card == PF100) { pmic_id[0] = PMIC_2_ADDR; pmic_reg[0] = SW2; *num_regs = 1; } else {/* PF8100_dual Card */ pmic_id[0] = PMIC_0_ADDR; pmic_reg[0] = PF8100_SW5; *num_regs = 1; } break; ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 外部電源で駆動されるSoCリソース(APコア、GPUなど)の電圧はboard.c内のboard_set_voltageで管理されます。リソースと電源のマッピングは前述のとおりboard_get_pmic_infoで行われます。 8個の「ボードリソース」(SC_R_BOARD_R0〜SC_R_BOARD_R7)が利用可能で、これらを用いてSCUが管理できるボード上のコンポーネントを定義できます。たとえばPMICのLDOの1つで駆動されるセンサをボードリソースにマッピングし、board.cを変更してセンサの電源オン/オフや電圧変更を行えます。 ボードリソースの電圧変更は、board_trans_resource_powerで電圧を設定するか、実行時に電圧を変更する必要がある場合はboard_set_controlを修正して、Miscellaneous Service 101で説明されているミスレニアスコールがそのリソースに対して発行されるたびに電圧を変更します。たとえばSC_R_BOARD_R7の電圧を変更する場合、board_set_controlに以下のcaseを追加します: case SC_R_BOARD_R7: if (ctrl == SC_C_VOLTAGE) { /* Example only PMIC_X_ADDR and PMIC_SUPPLY need to match an actual device */ pmic_interface.pmic_set_voltage(PMIC_X_ADDR, PMIC_SUPPLY, val, step); } else return SC_ERR_PARM; break;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 上記のcaseはアプリケーションが次の関数を呼び出すたびにSCUによって実行されます。 sc_misc_set_control( ipc, SC_R_BOARD_R7, SC_C_VOLTAGE, voltage_val);‍‍‍‍‍‍‍‍ ボードリソースの電源オン/オフはboard.c内のboard_trans_resource_powerで行われます。例えばNXPのバリデーションボードでは、ボード上のPTN5150はボードリソース0で管理され、電源のオン/オフは次のように制御されます: case BRD_R_BOARD_R0 : /* PTN5150 (use SC_R_BOARD_R0) */ if (pmic_ver.device_id == PF100_DEV_ID) { if (to_mode > SC_PM_PW_MODE_OFF) { pmic_interface.pmic_set_voltage(PMIC_2_ADDR, VGEN6, 3300, SW_RUN_MODE); pmic_interface.pmic_set_mode(PMIC_2_ADDR, VGEN6, VGEN_MODE_ON); } else { pmic_interface.pmic_set_mode(PMIC_2_ADDR, VGEN6, VGEN_MODE_OFF); } } else {/* PF8100_dual Card */ if (to_mode > SC_PM_PW_MODE_OFF) { pmic_interface.pmic_set_voltage(PMIC_1_ADDR, PF8100_LDO1, 3300, REG_RUN_MODE); pmic_interface.pmic_set_mode(PMIC_1_ADDR, PF8100_LDO1, RUN_EN_STBY_EN); } else { pmic_interface.pmic_set_mode(PMIC_1_ADDR, PF8100_LDO1, RUN_OFF_STBY_OFF); } } break;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ アプリケーション側で以下の関数が呼び出されるたびに、SCUは上記のコードを実行します: sc_pm_set_resource_power_mode(ipc, SC_R_BOARD_R0, SC_PM_PW_MODE_ON/OFF);‍‍‍‍‍‍‍‍ board_config_scは、I2CモジュールやPMICとの通信に使用されるパッドなど、SCUが必要とするリソースをマーキングするために使用します。board.cの関数が動作するために必要なリソースは、本関数で移動不可に設定する必要があります。例えばSCUのI2Cモジュールを保持するには、次の行を追加します: rm_set_resource_movable(pt_sc, SC_R_SC_I2C, SC_R_SC_I2C, false);‍‍‍‍‍‍‍‍‍ 以下のパッドはSCUに属しており、アプリケーションからはアクセスできません: - SC_P_SCU_PMIC_MEMC_ON - SC_P_SCU_WDOG_OUT - SC_P_PMIC_EARLY_WARNING - SC_P_PMIC_INT_B - SC_P_SCU_BOOT_MODE0〜SC_P_SCU_BOOT_MODE5 board_system_configは初期リソース管理を行う関数で、イメージ内でalt_configフラグが設定されている場合にのみ呼び出され、パーティションを作成してリソースを割り当てることができます。詳細はResource Management Service 101を参照してください。 board_get_pcie_clk_srcはPCIeが使用するクロックを定義し、BOARD_PCIE_PLL_EXTERNALまたはBOARD_PCIE_PLL_INTERNALのいずれかを指定できます。 board_printは変更内容のデバッグに非常に便利で、構文は次のとおりです: board_print(3, "Debug printout %d\n", val);‍‍‍‍‍‍‍ 最初のパラメータがデバッグレベルで、それ以降は標準printfと同様に動作します。出力はSCUが対応するデバッグレベルでビルドされている場合にのみSCUのデバッグ出力で確認できます。上記の例では出力を表示するためにSCFWを次のようにビルドする必要があります: make qm B=myBoard‍‍‍‍ DL=3 or higher (debug level goes from 0 to 5)‍‍‍‍‍‍‍ 使用例 以下のユーティリティはSystem Controller Firmwareリクエストの方法を示し、QNXとLinuxの両方でコマンドラインからリクエストを行う手段を提供します。 System Controller Firmware Command Line Utility for Linux and QNX System Controller Firmware 101 i.MX 8ファミリ | i.MX 8QuadMax (8QM) | 8QuadPlus
View full article
通过 LPC 54018 中的 USB 通信在挂机中读写 如何在 LPC 54018 中通过 USB 通信写入和读取 Pendriver。 我使用的是 USB1 主机? LPC54xxx Re: read and write in pendriver through USB communication in lpc 54018 微控制器必须在 USB 主机模式下工作,因为笔式驱动器是 USB 大容量存储类 (MSC) 设备。 LPC54018 支持USB 2.0 全速主机,足以满足标准笔式驱动器的需求。 实施概述: 硬件要求 USB Type-A 接口 笔式硬盘的外部5V VBUS 电源 正确的 D+ 和 D- 连接 建议使用 VBUS 检测 USB 主机堆栈 使用恩智浦 MCUXpresso SDK 启用 USB 主机 + MSC 类驱动程序 使用FATFS处理文件系统 列举 插入时,USB 主机会枚举笔式驱动器 该设备被识别为大容量存储设备 大容量传输用于数据传输 文件系统访问 大多数笔式硬盘的格式为FAT32 挂载后,可执行标准文件操作 使用 f_open()、f_read() 和 f_write() 等应用程序接口 用例示例 这种 USB 存储访问通常用于嵌入式系统,以存储日志、媒体文件或缓存数据。 例如,嵌入式媒体播放器可从以下平台流式传输内容 HDOBOX等平台流式传输内容的嵌入式媒体播放器,就可以使用这种方法将配置文件、字幕或播放日志存储在 USB 闪存盘上。 重要说明 默认情况下不支持 exFAT 和 NTFS USB 主机 + FATFS 需要足够的内存 安装前在设备连接后添加延迟 Re: read and write in pendriver through USB communication in lpc 54018 观影应用程序 HDO Box 电影 我使用这种方法进行管理,效果很好、 Re: read and write in pendriver through USB communication in lpc 54018 Pendriver 中的 USB 通信相当难用。 Re: read and write in pendriver through USB communication in lpc 54018 你好,@Arularasan、 为了再次确认,能否请您检查一下 USB1 端口是否正常工作?你可以尝试像使用其中一个 USB 示例的设备一样使用它。 另外,能否请您检查一下您的硬盘?将磁盘驱动器输入计算机时,计算机会检测到它吗?你能不能试试用另一个 pendrive 或 USB 设备的 USB 主机示例? 最后,能否请您用挂盘测试另一个 USB 主机示例?使用以下示例进行尝试可能会有所帮助:usb_host_cdc和/或usb_host_msd_command。 致以最诚挚的问候,劳尔。 Re: read and write in pendriver through USB communication in lpc 54018 你需要一个 JTAG 调试器来上市和调试在恩智浦 LPC54018 板上运行的代码。FreeRTOS 使用 OM40006 物联网模块进行了测试。有关支持的调试器的更多信息,请参阅 《恩智浦 LPC54018 物联网模块用户手册 》,该手册可从以下网站获取 OM40007 LPC54018 物联网模块 产品页面。 如果您使用的是 OM40006 物联网模块调试器,请使用变流器电缆将调试器的 20 针连接器连接到恩智浦物联网模块上的 10 针连接器。 使用迷你 USB 转 USB 电缆将恩智浦 LPC54018 和 OM40006 物联网模块调试器连接到计算机的 USB 端口。   filmplus 应用程序 Re: read and write in pendriver through USB communication in lpc 54018 @RaRo感谢您的回复。 SDK 示例代码下的 USB HOST 演示 ("host_msd_fatfs_bm") 我已下载,但无法使用! 我 想通过 USB 通讯读写笔式驱动器,我使用的是 USB1。 请帮助我@RaRo Re: read and write in pendriver through USB communication in lpc 54018 你好,@Arularasan、 您试过 host_msd_fatfs_bm 示例吗?该示例似乎使用了 f_write() 和 f_read(),它们用于通过 FATFS 和 USB 进行写入和读取。 您能否查看以下参考手册,了解有关 USB + FATFS 应用程序的更多信息? MSDFATFSAPIRM、飞思卡尔 MSD FATFS API-参考手册和 USBHOSTAPIRM,飞思卡尔 USB 堆栈主机 API-参考手册。 致以最诚挚的问候,劳尔。 Re: read and write in pendriver through USB communication in lpc 54018 @RaRo是的,我已经在MCUXpresso IDE的帮助下完成了 lpc 54018 中的所有程序。 MCUXpresso IDE 生成的示例代码。没有创建读写功能,请帮助我通过 USB 通信在 lpc 54018(我使用的是 USB1 主机)中读写 Pendriver 的步骤。 Re: read and write in pendriver through USB communication in lpc 54018 你好,@Arularasan、 能否请您查看以下有类似问题的主题?已解决:我想使用 USB 连接从笔读取文件...- 恩智浦社区 此外,您还可以尝试使用 LPC54018 SDK 中的 USB 示例,如果使用的是 MCUXpresso IDE,请单击 "导入 SDK 示例... "并搜索 USB。您可以通过集成开发环境或以下链接下载 SDK:MCUXpresso SDK Builder。 [MCUXpresso IDE 快速启动面板和 SDK 导入向导] 可能需要定义您要使用的 USB:USB1 或 USB0。 致以最诚挚的问候,劳尔。
View full article
将 EdgeLock® SE05X 集成到 MIMXRT1180-EVK 本文档内容免责声明: NXP 提供的任何支持、信息和技术(“材料”)均按“现状”提供,不附带任何明示或暗示的保证,且 NXP 在适用法律允许的最大范围内,否认与材料相关的所有直接或间接责任和损害。NXP 对任何与应用或产品设计相关的协助不承担任何责任。材料仅可用于与 NXP 产品相关联。NXP 可以不受限制地使用您对材料提供的任何反馈。 摘要 本文档旨在指导开发人员在 NXP MIMXRT1180EVK 开发板上集成 EdgeLock® SE050 安全芯片,以实现硬件级别的安全增强。安全元件可以轻松连接到任何系统,要求极低——只需电源和两个 I2C 引脚。此外,由于主机软件支持 Plug&Trust 中间件,因此集成起来非常容易。 硬件先决条件 主机平台:MIMXRT1180EVK 扩展板: OM-SE050X 硬件设置 1. 按如下方式配置 OM-SE05xARD 跳线[1]: 2. 将 MIMXRT1180-EVK 上的跳线配置为默认[2]: 3.将 OM-SE05xARD 安装到 MIMXRT1180-EVK 上 软件集成 有两种方法将 OM-SE05xARD 集成到 MIMXRT1180-EVK:一种基于 SDK,另一种基于 Zephyr。用户可以根据自己的需求选择其中任一。 SDK集成: 平台文件生成。 nano 软件包为在任意 MCU 平台上集成 MW 提供了非常简便的方式。用户只需在 simw-nanopkg/lib/platform 文件夹中添加或修改对应平台的特定文件即可。 应用随附的补丁后,您即可轻松实现上述配置。 导入I2C演示项目作为起点 我们建议以 SDK 的 I2C 演示项目为集成起点,因为该项目已包含 SDK 所需的 I2C 驱动代码。以 RT1180 为例,我们导入:evkmimxrt1180_lpi2c_polling_b2b_master_cm33。 然后排除板级文件,并改用 nano 软件包中的对应文件。 接着导入 nano 软件包中的源文件, 并加入示例代码,这里选择:ex_se05x_crypto.c和 main.c。 添加如下定义用于 nano 软件包构建,以及包含路径。 正在构建项目: 调试: Zephyr 集成: 集成比 SDK 集成简单得多,因为平台特定文件已经存在,用户只需手动添加 MIMXRT1180-EVK 的板覆盖文件。附加的覆盖文件应放在类似于“workspace/modules/crypto/nxp-plugandtrust/examples/se05x_crypto/zephyr/boards/”的文件夹中。 请注意:Zephyr 集成指南已在 https://github.com/NXPPlugNTrust/nano-package/blob/master/zephyr/readme.rst 上发布,而测试的 Zephyr 版本仍停留在 v3.7.0,尚未支持 MIMXRT1180-EVK。为了支持 MIMXRT1180-EVK,我们必须使用最新的 Zephyr,并修改过 west.yml 文件。 以下是我们需要执行的步骤: $ rm workspace/ -rf $ mkdir -p workspace $ cd workspace/ $ git clone https://github.com/NXPPlugNTrust/nano-package.git //Edit ~/workspace/nano-package/zephyr/west.yml as below $ cd .. $ west init -m https://github.com/NXPPlugNTrust/nano-package.git --mf ~/workspace/nano-package/zephyr/west.yml ~/workspace/ $ cd workspace $ west update 版本示例: $ cd workspace/ $ west build -b mimxrt1180_evk/mimxrt1189/cm33 modules/crypto/nxp-plugandtrust/examples/se05x_crypto/zephyr/ --pristine 编程和运行:   参考资料: [1]基于树莓派的 EdgeLock SE05x 快速入门指南 [2]i.MX RT1180 EVK 快速入门指南
View full article
Clock Measuring using the Signal Frequency Analyzer (SFA) module for KW45/KW47/MCXW71/MCXW72 Using the Signal Frequency Analyzer (SFA) to Measure the FRO 6M Frequency Overview The Signal Frequency Analyzer (SFA) is a specialized hardware peripheral available in NXP’s KW45, MCXW71, KW47, and MCXW72 microcontrollers. It is designed to provide precise, real-time measurement and analysis of digital signal characteristics, including frequency, period, and timing intervals. This makes it a valuable tool for applications requiring accurate timing diagnostics, signal validation, and system debugging. By utilizing internal 32-bit counters and configurable trigger mechanisms, the SFA enables high-resolution capture of signal transitions, supporting robust system monitoring and fault detection. Functional Capabilities of the SFA The SFA module supports the following measurements: Clock signal frequency of a Clock Under Test (CUT) Clock signal period It operates using two 32-bit counters: One for the Reference Clock (REF) One for the Clock Under Test (CUT) Measurement is performed by comparing the counts of both clocks until predefined target values are reached. FRO 6M Frequency Failure Scenarios The 6 MHz Free Running Oscillator (FRO6M) may occasionally output an incorrect frequency under certain conditions: When the device exits reset When the device wakes from low-power modes To mitigate potential issues caused by incorrect FRO6M output, it is the application developer’s responsibility to verify the oscillator’s frequency and apply corrective measures as needed. Monitoring the FRO 6M Using the SFA To monitor the FRO6M signal, the following configuration is recommended: SFA Configuration Parameters Reference Clock (REF): CPU Clock (e.g., 96 MHz) Clock Under Test (CUT): FRO6M routed via CLKOUT Interrupt Mode: Enabled for asynchronous measurement completion Code Implementation The presented functions are meant to be implemented in users application, the inner functions are part of the implementations of the SFA driver from the NXP’s SDK. It can be used on MCXW71, MCXW72, KW45, kKW47, just make sure SFA Peripheral Initialization  void init_SFA_peripheral(void) { /* Enable SFA interrupt. */ EnableIRQ(SFA_IRQn); /* Set SFA interrupt priority. */ NVIC_SetPriority(SFA_IRQn, 1); SFA_Init(DEMO_SFA_BASEADDR); SFA_InstallCallback(DEMO_SFA_BASEADDR, EXAMPLE_SFA_CALLBACK); } SFA Callback Function void EXAMPLE_SFA_CALLBACK(status_t status) { if (status == kStatus_SFA_MeasurementCompleted) { SfaMeasureFinished = true; } sfa_callback_status = status; } Frequency Measurement Function This function sets up the measurement of the FRO6M signal using the CPU clock as the reference. uint8_t SFA_freq_measurement_6M_FRO(void) { uint8_t ratio = 0; uint32_t freq = 0UL; sfa_config_t config; CLOCK_SetClkOutSel(kClockClkoutSelSirc); //set clokout to SIRC SFA_GetDefaultConfig(&config); //Get SFA default config config.mode = kSFA_FrequencyMeasurement0; config.refSelect = kSFA_REFSelect1; //Set CPU clk as ref clk config.cutSelect = kSFA_CUTSelect1; //Set clkout as CUT config.refTarget = 0xFFFFFFUL; config.cutTarget = 0xFFFFUL; config.enableCUTPin = true; freq = get_ref_freq_value(CPU_CLK); SFA_SetMeasureConfig(DEMO_SFA_BASEADDR, &config); SFA_MeasureNonBlocking(DEMO_SFA_BASEADDR); while (1) { if (SfaMeasureFinished) { SfaMeasureFinished = false; if(kStatus_SFA_MeasurementCompleted == sfa_callback_status) { freq = SFA_CalculateFrequencyOrPeriod(DEMO_SFA_BASEADDR, freq);//Calculate the FRO freq if(FREQ_6MHZ + TOLERANCE <= freq ) { ratio = 1; } else { if(FREQ_3MHZ + TOLERANCE <= freq) { ratio = 2; } else { if(FREQ_2MHZ + TOLERANCE <= freq) { ratio = 3; } else { ratio = 4; } } } break; } } else { __WFI(); } } return ratio; } Result Interpretation and Usage To test the FRO 6M after adding the above functions the FRO can be tested after executing: init_SFA_peripheral(); SFA_freq_measurement_6M_FRO(); The measured FRO6M frequency ratio is returned by the function SFA_freq_measurement_6M_FRO(), with the ratio you can know the current frequency output of the 6M FRO, ration 1 means 6M are being output by the FRO, ratio 2 means the frequency output of the FRO it's being cut in half meaning the FRO is outputting 3 Mhz, ration 3 means the FRO output frequency is being cut by a third part, this results in 2MHz frequency output. With this information you can: Adapt peripheral clocking if the FRO6M frequency is incorrect (This can be achieve by modifying the peripheral dividers if dividers are being used). Trigger corrective actions such as  switching to an alternate clock source Steps to Reconfigure Peripheral Clocking When FRO6M output frequency is lower Detect the Faulty FRO6M Output Use the SFA measurement as described earlier to determine if the FRO6M is operating below its expected frequency (6 MHz). If the result is significantly lower, proceed to reconfigure. Choose an Alternative Clock Source Most NXP MCUs offer multiple internal and external clock sources. Common alternatives include: FRO 192M OSC RF 32M Sys OSC RTC OSC Choose one that is: Stable Available in your current power mode Compatible with the peripheral’s timing requirements You can add more clock divers if needed to make a higher frequency clock reach a certain lower frequency. Reconfigure the Peripheral Clock Source Use the SDK’s CLOCK_Set... APIs to change the clock source. You may also need to: Adjust dividers to match the required baud rate or timing Reinitialize the peripheral with the new clock settings Example Scenario: Measuring the FRO and Adjusting UART Based on Frequency Ratio Imagine your application relies on the 6 MHz Free Running Oscillator (FRO), and its accuracy directly affects UART communication. To ensure reliable operation, you can use the System Frequency Adjustment (SFA) feature to monitor the FRO output and dynamically adjust the UART configuration. After measuring the 6 MHz FRO using the recommended method, the system returns a frequency ratio value. This value ranges from 1 to 4, where: 1 indicates the frequency is within expected limits (no issues), 2 to 4 represent varying degrees of deviation from the expected frequency. Using this ratio, you can initialize and configure the UART peripheral and its driver to compensate for any frequency variation, ensuring stable and accurate communication. */ int main(void) { BOARD_InitHardware(); uint8_t ch = 0; uint8_t FRO_ratio = 0; init_SFA_peripheral(); /*Measure FRO6M output frequency*/ FRO_ratio = SFA_freq_measurment_6M_FRO(); /*Init debug console and compensate in case a different frequency is output */ if(0 == FRO_ratio) { assert(0);//this user defined return value means something went wrong while measuring 6Mz FRO } uint32_t uartClkSrcFreq = BOARD_DEBUG_UART_CLK_FREQ/FRO_ratio;//Compensate the src frequency set for uart module CLOCK_EnableClock(kCLOCK_Lpuart1); CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro6M); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq); ...... } SDK 25.0.00 Enhancements for FRO6M Calibration To address known reliability issues with the 6 MHz Free Running Oscillator (FRO6M), particularly during transitions from low-power modes, SDK version 25.06.00 introduces a set of software enhancements aimed at improving oscillator validation and calibration. Key Features Introduced FRO6M Calibration API Two new functions have been added to facilitate runtime verification of the FRO6M frequency: PLATFORM_StartFro6MCalibration() Initializes the calibration process by enabling the cycle counter, capturing a timestamp, and preparing the system to measure elapsed time using both the CPU and the FRO6M-based timestamp counter. PLATFORM_EndFro6MCalibration() Completes the calibration by comparing the time measured via CPU cycles and the FRO6M timestamp counter. This comparison determines whether the oscillator is operating at the expected 6 MHz or has erroneously locked to a lower frequency (e.g., 2 MHz). The result is stored in a global ratio variable (fwk_platform_FRO6MHz_ratio) for use by the system. These functions provide a lightweight and efficient mechanism to detect and respond to oscillator misbehavior, ensuring system stability and timing accuracy. Configuration Macro gPlatformEnableFro6MCalLowpower_d This macro enables automatic FRO6M frequency verification upon exiting low-power modes. When defined, the system will invoke the calibration functions to validate the oscillator before resuming normal operation. Default Integration The calibration mechanism is enabled by default in the SDK configuration file fwk_config.h, ensuring that all applications benefit from this safeguard without requiring manual setup. Use Case and Benefits These enhancements are particularly valuable in applications where: Precise timing is critical (e.g., wireless communication, sensor sampling). The system frequently enters and exits low-power states. Clock source integrity must be guaranteed to avoid peripheral misbehavior or timing faults. By integrating these calibration routines, developers can proactively detect and correct FRO6M frequency anomalies, improving overall system robustness and reducing the risk of runtime errors due to clock instability.
View full article
TCP Client & Server Implementation on MCUXrpesso SDK --- part I--using LwIP Netconn API Introduction TCP Client & Server establishes a two-way connection between a server and a client. It is the most common communication model used by applications such as HTTP, Telnet, FTP, SSH and others LwIP is a free light-weight TCP/IP stack in MCUXpresso SDK. It has three application programming interfaces (API): RAW API:  it is the native API of LwIP. It enables the development of applications using event callbacks. Netconn API:  it is a high level sequential API that requires the services of a real-time system (RTOS), The Netconn API enables multi-threaded operations BSD Socket API: it is developed on top of the Netconn API. In this article, I will introduce how to implement a TCP client & Server demo with LwIP Netconn API.  One EVK-RT1060 acts as TCP server, and others boards act as TCP clients.  They are connected through an Ethernet router.  They communicate via TCP protocol. If you press SW8 on the client board, it will toggle a LED on the Server board. This article is for beginners to understand the Netconn API on NXP MCUXpresso SDK. 2. Hardware configuration PHY settings: In this demo, we use phyksz8081, that is the default PHY in EVK-RT1060 board.  ENET port 0. /*! @brief The ENET PHY address. */ #define BOARD_ENET0_PHY_ADDRESS (0x02U) /* Phy address of enet port 0. */ /* Address of PHY interface. */ #define EXAMPLE_PHY_ADDRESS BOARD_ENET0_PHY_ADDRESS /* MDIO operations. */ #define EXAMPLE_MDIO_OPS enet_ops /* PHY operations. */ #define EXAMPLE_PHY_OPS phyksz8081_ops /* ENET clock frequency. */ #define EXAMPLE_CLOCK_FREQ CLOCK_GetFreq(kCLOCK_IpgClk) Configure the external PHY, pull up the ENET_INT before RESET.     GPIO_PinInit(GPIO1, 9, &gpio_config);     GPIO_PinInit(GPIO1, 10, &gpio_config);     /* pull up the ENET_INT before RESET. */     GPIO_WritePinOutput(GPIO1, 10, 1);     GPIO_WritePinOutput(GPIO1, 9, 0);     delay();     GPIO_WritePinOutput(GPIO1, 9, 1); MAC settings: In this demo, MAC address is defined in Macro configMAC_ADDR /* MAC address configuration. */ #define configMAC_ADDR                     \     {                                      \         0x02, 0x12, 0x13, 0x10, 0x15, 0x11 \     }  3. Starting a network interface To create a new network interface, the user allocates space for a new struct netif (but does not initialize any part of it) and calls netifapi_netif_add:     IP4_ADDR(&fsl_netif0_ipaddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3);     IP4_ADDR(&fsl_netif0_netmask, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3); IP4_ADDR(&fsl_netif0_gw, configGW_ADDR0, configGW_ADDR1, configGW_ADDR2, configGW_ADDR3);     netifapi_netif_add(&fsl_netif0, &fsl_netif0_ipaddr, &fsl_netif0_netmask, &fsl_netif0_gw, &fsl_enet_config0,                        ethernetif0_init, tcpip_input); Pass tcpip_input API to netif_add API as input callback function that is called to pass ingress packets up in the protocol layer stack next we need to bring the interface up An interface that is “up” is available to your application for input and output, and “down” is the opposite state. Therefore, before you can use the interface, you must bring it up. This can be accomplished depending on how the interface gets its IP address.  We can use static IP address  or DHCP. Set the network interface as the default network interface netifapi_netif_set_default(&fsl_netif0); Bring the interface up, available for processing     netifapi_netif_set_up(&fsl_netif0); 4. LwIP Initialization Call tcpip_init to create a tcpip_thread, this thread has exclusive access to LwIP core functions. Other threads communicate with this thread using message boxes. It also starts all the timers to make sure they are running in the right thread context. tcpip_init(NULL, NULL); 5. TCP Client & Server Implementation For TCP communications, one host listens for incoming connection requests. When a request arrives, the server accepts it and data is transferred between the server and the client. The sequence of function calls for the client and a server participating in a TCP connection is show in below picture. The steps for establishing a TCP connection on the client side are the following: Create a netconn using the netconn_new() function. Connect the connection to the address of the server using the netconn_connect() function. Send and receive data by means of the netconn_recv() and netconn_send() functions. Close the connection by means of the netconn_close() function. The steps in establishing a TCP connection on the server side are as follows Create a connection with netconn_new() function; Bind the connection to an address using the netconn_bind() function. Listen for connections with the netconn_listen() function. Accept a connection with the netconn_accept() function, this blocks until a client connects. Send and receive data by means of netconn_send() and netconn_recv(). Close the connection by means of the netconn_close() function. 5.1 TCP SERVER IMPLEMENTATION netconn_new() is used to create a new connection.   conn = netconn_new(NETCONN_TCP); netconn_bind() binds a connection to a local IP address and port.   netconn_bind(conn, IP_ADDR_ANY, TCP_CUSTOM_PORT); netconn_listen() function sets a TCP connection into a listening TCP connection.   /* Tell connection to go into listening mode. */   netconn_listen(conn); netconn_accept() function accepts an incoming connection on a listening TCP connection.    err = netconn_accept(conn, &newconn); netconn_recv() function receives a message from a netconn. netconn_send() function sends data to the currently connected remote IP/Port. In this demo, if server board receives a ‘TOGGLE’ message from the client board, it will toggle a LED. (GPIO1/3,  need to connect a LED manually)           while ((err = netconn_recv(newconn, &buf)) == ERR_OK) {         PRINTF("Received  %s\n", buf->p->payload);         do {              netbuf_data(buf, &data, &len);              tcp_rx_buf = (void *)data;              if (tcp_rx_buf[0] == 'T')              {                  PRINTF("LED was toggled from client\r\n");                 GPIO_PortToggle(EXAMPLE_LED_GPIO, 1u << EXAMPLE_LED_GPIO_PIN);                 netconn_write(newconn, TcpReply, sizeof(TcpReply) , NETCONN_COPY );              }         } while (netbuf_next(buf) >= 0);         netbuf_delete(buf);       } //end of while(( err   5.2 TCP CLIENT IMPLEMENTATION For the client side, the netconn structure is created:   conn = netconn_new(NETCONN_TCP); netconn_connect():  when a user issues a connect command, the stack creates a connection with another host. Before connect can instruct the stack to establish a connection, the user must pass a netconn and a sockaddr_in structure containing the destination IP address and port. In TCP, the handshaking packets will be exchanged.   memset(&server_addr, 0, sizeof(server_addr));   server_addr.sin_family = AF_INET;   server_addr.sin_port = PP_HTONS(TCP_CUSTOM_PORT);   server_addr.sin_addr.s_addr = server_ip_addr.addr;   err = connect(client_sock, (struct sockaddr *)&server_addr, sizeof(server_addr));   LWIP_ASSERT("connect fail, please start TCP server first !  ",  err == 0); In this demo, a GPIO is initialized and interrupt is enabled. When SW8 is pressed, the client board will send ‘Toggle’ command to the TCP server.   while (1)   {       if (g_InputSignal)       {           delay();           if (1 == GPIO_PinRead(EXAMPLE_SW_GPIO, EXAMPLE_SW_GPIO_PIN))           {               PRINTF("%s is turned on.\r\n", EXAMPLE_SW_NAME);               err = send(server_sock, Sendtext, sizeof(Sendtext) / sizeof(Sendtext[0]), 0);           }           /* Reset state of switch. */           g_InputSignal = false;       }  //end of if (g_InputSignal)   }  
View full article
Keil MDK/uVision を使用したデモの実行 CMSISデバイス・パックのインストール MDK ツールをインストールした後、デバッグの観点からデバイスを完全にサポートするには、Cortex ®マイクロコントローラ ソフトウェア インターフェイス標準 (CMSIS) デバイス パックをインストールする必要があります。これらのパックには、メモリ マップ情報、レジスタ定義、フラッシュ プログラミング アルゴリズムなどが含まれています。適切な CMSIS パックをインストールするには、次の手順に従います。MDK-Arm マイクロコントローラ開発キット (Keil) ®バージョン 5.38.1 以上を使用してください。 µVision と呼ばれる MDK IDE を開きます。IDE内で「Pack Installer」アイコンを選択します パック インストーラー ウィンドウで、「MCXW」を検索して、MCXW71 ファミリを起動します。MCXW7XX の名前をクリックすると、右側に NXP が表示されます。  MCXW71_DFP  パック。パックの横にある「インストール」ボタンをクリックします。このプロセスを正常に完了するにはインターネット接続が必要です インストールが完了したら、[Pack Installer(パック・インストーラ)]ウィンドウを閉じて、µVision IDEに戻ります サンプル・アプリケーションのビルド 以下の手順に従って、  hello_world  応用。一部のアプリケーションではパス内に追加のフォルダー層が存在する可能性があるため、他のサンプル アプリケーションではこれらの手順が若干異なる場合があります。 目的のデモ・アプリケーション・ワークスペースをまだ開いていない場合は以下で開きます。 /boards/ / / /mdk デバッグ構成を選択 プロジェクトを右クリックして、プロジェクト オプションを選択します。 次に、デバッグ オプションに移動し、CMSIS-DAP ARMv8-M デバッガーを選択します。OKボタンをクリックします デモプロジェクトをビルドするには、赤くハイライトされた「リビルド」ボタンを選択します。 ビルドが正常に完了します
View full article