Multi Source Translation Content

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Multi Source Translation Content

ディスカッション

ソート順:
i.MX 95 SPSDK によるセキュアブート (日本語ブログ) はじめに i.MX 95 でのセキュアブートに使用する署名付きのコンテナ・イメージを Secure Provisioning SDK (SPSDK) で作成し、起動する手順です。 i.MX 95 では、セキュアブートのデジタル署名アルゴリズムとして、クラシックなRSA暗号や楕円曲線デジタル署名暗号 (ECDSA)に加えて、耐量子暗号 (PQC)の ML-DSA もサポートされています。 ここでは、ECDSA と PQC ML-DSA 両方の署名認証を行うHybrid boot での実現例を見ていきます。 セキュアブート・プロセス(概念図) 署名付きイメージの作成 SRKH : Super Root Key Hash i.MX 95 AHAB (Advanced High Accuracy Boot) セキュアブート・フロー 本記事は、i.MX 95 向けのLinux BSP を一度ビルド済みの前提で紹介します。 ビルド方法については以下の記事をご参照ください。 ビルドするターゲットを、i.MX 95 のマシン名とする必要がありますが、同様の方法になります。  [入門] Yocto Linux BSPのビルド方法 - i.MX FRDMボード編 (日本語ブログ) [入門] Yocto Linux BSPのビルド方法 - i.MX 8M Plus編 今回動作確認に使用した環境 ハードウェア:開発ボード i.MX 95 19x19 LPDDR5 EVK ソフトウェア:Linux BSP Version L6.18.2-1.0.0 ツール:SPSDK version 3.9.0, Linux 版 eMMC/SDブートであれば、FRDM i.MX 95開発ボード(FRDM-IMX95 / LPDDR4X対応)でも同様の手順で実施することができます。 目次 1. Linux BSP での準備 2. SPSDK のインストール 3. 鍵の作成 4. YAMLファイルの準備 5. ワークスペースの準備 6. 署名付きイメージの作成  7. 署名付きイメージの導入 8. SRKH (Super Root Key Hash) eFuse のプログラム 9. ライフサイクルを OEM Closed に更新 10. ELE イベントの確認 11. ブートローダの直接署名   eMMC/SDブートとFlexSPI NORブートでは、準備手順や実行するコマンドが一部異なります。そのため、確認したいブートデバイスに応じた手順を実施してください。 1. Linux BSP での準備 1.1 ブートローダ FlexSPI NOR ブート BSP デフォルトでのブートローダは、eMMC/SD ブート用となっています。 FlexSPI NOR ブートの場合には、 / /conf/local.conf ファイルに下記を追記しておきます。 UBOOT_CONFIG = "fspi" eMMC / SD / FlexSPI NOR ブート共通 u-boot の  CONFIG_AHAB_BOOT  を有効にしてビルドしたブートローダを使用します。 $ cd $ source setup-environment $ bitbake u-boot-imx -c cleansstate $ bitbake u-boot-imx -c configure $ bitbake u-boot-imx -c devshell 別のシェルが開きますので、u-boot コンフィグレーションを変更します。 # make O=../../build/ / menuconfig O= で指定するビルド・ディレクトリのパスは、実際の環境に合わせます。 ../../build/ /.config で、 CONFIG_AHAB_BOOT=y  となっていることを確認し、元のシェルに戻ります。 # exit 元のシェルで、再ビルドを行います。 $ bitbake u-boot-imx -c compile -f $ bitbake imx-boot 1.2 Linux カーネルとデバイスツリー BSP でビルドされたバイナリをそのまま利用します。 ビルドされたバイナリは、BSP の  /tmp/deploy/images/ / に作成されています。 2. SPSDK のインストール SPSDK Installation Guide に従い、Python 仮想環境 venv を準備してインストールします。 インストール後、バージョン情報やヘルプ表示ができるかを確認します。 (venv) $ spsdk --version (venv) $ spsdk --help PQCプラグインも追加します。 (venv) $ pip install spsdk-pqc 3. 鍵の作成 ECDSA SECP384 の秘密鍵/公開鍵を、4ペア作成します。 (venv) $ mkdir -p keys/secp384r1 (venv) $ nxpcrypto -v key generate -k secp384r1 -o keys/secp384r1/srk0_secp384r1.pem (venv) $ nxpcrypto -v key generate -k secp384r1 -o keys/secp384r1/srk1_secp384r1.pem (venv) $ nxpcrypto -v key generate -k secp384r1 -o keys/secp384r1/srk2_secp384r1.pem (venv) $ nxpcrypto -v key generate -k secp384r1 -o keys/secp384r1/srk3_secp384r1.pem PQC ML-DSA の秘密鍵/公開鍵も、4ペア作成します。 (venv) $ mkdir keys/mldsa65 (venv) $ nxpcrypto -v key generate -k mldsa65 -o keys/mldsa65/srk0_mldsa65.pem (venv) $ nxpcrypto -v key generate -k mldsa65 -o keys/mldsa65/srk1_mldsa65.pem (venv) $ nxpcrypto -v key generate -k mldsa65 -o keys/mldsa65/srk2_mldsa65.pem (venv) $ nxpcrypto -v key generate -k mldsa65 -o keys/mldsa65/srk3_mldsa65.pem i.MX 95 内蔵eFuse に公開鍵のハッシュ Super Root Key Hash (SRKH) を書いたあと、イメージをビルドしなおした時は、その公開鍵とペアとなる秘密鍵で署名する必要があるので、作成したすべての鍵は保存しておきます。 秘密鍵は、第三者に開示しないようにします。 4. YAMLファイルの準備 SPSDK では、YAMLファイルに、コンテナヘッダ設定や、秘密鍵、公開鍵および、署名付きイメージを構成するバイナリファイルのパスを指定します。 あわせて、今回の動作確認で使用したYAMLファイルの例もご参照ください。 YAMLファイルでのコンテナヘッダ設定や、鍵を指定する項目は、次のようになっています。 コンテナヘッダ YAMLキー 内容 srk_set SRK Set used_srk_id SRK Selection srk_revoke_mask SRK Revoke Mask gdet_runtime_behavior GDET enablement check_all_signatures Check all signatures fastboot Fast Boot fuse_version Fuse Version sw_version SW Version コンテナヘッダの各フィールドは、i.MX 95 Reference Manual の、『Container header details』に記載されています。 鍵の指定 YAMLキー 内容 signer クラシック 秘密鍵 signer_#2 PQC 秘密鍵 srk_table クラシック 公開鍵テーブル srk_table_#2 PQC 公開鍵テーブル すべてのYAMLファイルで同じ鍵を指定します。 4.1 ブートローダ用YAML ファイル YAMLファイルのテンプレートを作成し、spl.yaml と uboot.yaml を準備します。 (venv) $ nxpimage ahab get-template -f mimx9596 -o ahab_template.yaml (venv) $ cp ahab_template.yaml spl.yaml (venv) $ cp ahab_template.yaml uboot.yaml spl.yaml i.MX 95 内蔵SRAM にロードされ、DRAM 初期化トレーニングなどを実施する部分までのファイルを指定します。 YAML キー 内容 binary_container ELE ブート・ファームウエア(マスク・レビジョン専用のバイナリ) lpddr_imem LPDDR4X or 5 初期化ファームウエア lpddr_imem_qb LPDDR4X or 5 初期化ファームウエア lpddr_dmem LPDDR4X or 5 初期化データ lpddr_dmem_qb LPDDR4X or 5 初期化データ oei_ddr OEI system_manager System Manager spl U-boot SPL cortex_m7_app (Option) M7 image image_path (Option) FCB copy image uboot.yaml U-boot SPL でDRAMにロードされる部分のファイルを指定します。 YAML キー 内容 atf ARM Trusted Firmware uboot U-boot tee (Option) OP-TEE OS (Option) 4.2 FCB の取り出し - FlexSPI NOR ブートのみ FlexSPI NOR ブート用のYAMLファイルでは、FCB (FlexSPI Configuration Block)も指定します。そのため、FlexSPI NOR ブート向けにビルドした通常の署名なしブートローダ (flash.bin) から、SPSDK コマンドにて、FCB を取り出しておきます。 i.MX 95 内蔵eFuse のFlexSPI_NOR_FCB_Offset (デフォルト 0x400) にFCB が配置されています。そのオフセットから 512 バイト分を取り出し、 fcb.bin を作成します。 (venv) $ nxpimage utils binary-image extract -b flash.bin -a 0x400 -s 0x200 -o fcb.bin 4.3 OSコンテナ用YAML ファイル YAMLファイルのテンプレートから、os_cntr.yaml を準備します。 (venv) $ cp ahab_template.yaml os_cntr.yaml os_cntr.yaml では、キー image_path で、Linux カーネルと使用するデバイスツリーのパスをセットし、その他必要なパラメータも設定します。 4.4 デジタル署名アルゴリズムの選択 i.MX 95 内蔵eFuse やコンテナヘッダのFlags で選択することになります。 eFuse コンテナヘッダの Flags フィールド コンテナヘッダの Flags フィールドにある "Bit 15: Check all signature" = 0x1 とすることで、eFuse のELE_BOOT_CRYPTO 設定によらず、コンテナ内にあるすべての署名を認証します。 コンテナヘッダの Flags フィールドの "Check all signature"は、YAML キー "check_all_signature" で指定します。 5. ワークスペースの準備 SPSDK でワークスペースを作成し、必要な鍵ファイル、YAML ファイル およびバイナリファイルを配置します。 5.1 ワークスペースの作成 (venv) $ nxpimage bootable-image get-templates -f mimx9596 -o workspace 5.2 鍵ファイル 鍵の作成で作ったkeys フォルダごと持ってきます。 5.3 YAML ファイル例 動作確認に使用したYAMLファイルを、imx95-spsdk-yaml-examples.tar.gz に添付しています。 5.4 バイナリファイル Yocto Linux BSP からバイナリファイルを持ってくる場合、 ブートローダを構成するバイナリ $ bitbake -e imx-boot | grep ^S= により表示されるパスの、 iMX95/ にあるバイナリからコピーします。 Linux カーネル / /tmp/deploy/images/ /Image-- - - .bin を コピーします。 デバイスツリー / /tmp/deploy/images/ /にあるdtb で、使用するもの1つコピーします。 YAMLファイルの例 を使用する場合、 ・Linux カーネルは、Image ・デバイスツリーは、imx95.dtb という名前で、それぞれ配置します。 5.5 eMMC / SD ブート 下記のようなファイル構成となります。 YAMLファイルの例を使用する場合、spl.yaml は、DRAMタイプにより、emmc_sd/spl-lpddr4x.yaml または spl-lpddr5.yaml から名前を変更して配置します。 上記では、ELE ブート・ファームウエア は、RevC 品 (B0マスク)用の mx95b0-ahab-container.img となっています。 5.6 FlexSPI NOR ブート 下記のようなファイル構成となります。fcb.binも必要です。 YAMLファイルの例を使用する場合、fspi_nor/から、bootable_image_fspi_nor.yaml をコピーしてきます。 また、spl_fspi_nor-lpddr5.yaml を spl.yaml に名前を変更し配置します。 上記では、ELE ブート・ファームウエア は、RevC 品 (B0マスク)用の mx95b0-ahab-container.img となっています。 6. 署名付きイメージの作成 署名付きブートローダと署名付き OS コンテナのイメージを、 SPSDK で作成します。 ワークスペースの準備 で作成されたディレクトリに移動して作業します。 (venv) $ cd workspace/imx_boot_flash_all/imx95-19x19-lpddr5-evk/ 6.1 署名付きブートローダ 鍵ファイルとバイナリファイルを指定する spl.yaml と uboot.yaml を、bootable_image.yaml から呼び出します。 署名付きブートローダ signed_flash.bin と、SRKH eFuse プログラム用のスクリプト (*.bcf) が作成されます。 eMMC / SD ブート (venv) $ nxpimage -v bootable-image export --config bootable_image.yaml -o output/signed_flash.bin 下記のような情報が、表示されます。 FlexSPI NOR ブート (venv) $ nxpimage -v bootable-image export --config bootable_image_fspi_nor.yaml -o output/signed_flash.bin 下記のような情報が、表示されます。 eMMC/SDとの違いとして、FCB が先頭についているのが分かります。 イメージの検証を行うことができます。 // eMMC / SD ブート (venv) $ nxpimage -v bootable-image verify -f mimx9596 -b output/signed_flash.bin -m serial_downloader // FlexSPI NOR ブート (venv) $ nxpimage -v bootable-image verify -f mimx9596 -b output/signed_flash.bin -m flexspi_nor 6.2 署名付きOSコンテナ os_cntr.yaml の内容で、署名付き OS コンテナのイメージを作成します。 (venv) $ nxpimage -v ahab export -c os_cntr.yaml 下記のような情報が、表示されます。 イメージの検証を行うことができます。 (venv) $ nxpimage -v bootable-image verify -f mimx9596 -b output/os_cntr_signed.bin -m serial_downloader 7. 署名付きイメージの導入 作成した署名付きブートローダおよび署名付きOSコンテナを導入する方法です。 7.1 署名付きブートローダ i.MX95 ボードのブートデバイスに、signed_flash.bin を書き込みます。 ボードのデバッグ・ポートとシリアル・ダウンロード・ポートを、PC に接続します。 u-boot が起動する場合には fastboot モードにします。 u-boot=> fastboot 0 もしくは、BOOT_MODE を シリアル・ダウンロード・モード として起動しておきます。 SPSDKで書き込みます。 // eMMC (venv) $ nxpuuu write -b emmc -f mimx9596 output/signed_flash.bin // SD (venv) $ nxpuuu write -b sd -f mimx9596 output/signed_flash.bin // FlexSPI NOR (venv) $ nxpuuu write -b qspi -f mimx9596 output/signed_flash.bin SPSDK の nxpuuu コマンドではなく、通常の uuu または u-boot コマンドを使用して書き込むことも可能です。 7.2 署名付きOSコンテナ あらかじめBSP イメージが書き込んであるeMMC もしくはSDカード の boot パーティションに、os_cntr_signed.bin を入れます。 u-boot コマンドで、i.MX95 の接続されたeMMC または SDカードを、USBストレージとしてみせることで、PCにマウントさせます。 シリアル・ダウンロード・ポートをPC に接続しておく必要があります。 // eMMC u-boot=> ums mmc 0 // SDカード u-boot=> ums mmc 1 PC にマウントされた boot パーティションに 、os_cntr_signed.bin をコピーしたあと、u-boot で Ctrl-C を押します。 もしくは、別の手段で os_cntr_signed.bin を、boot パーティションに入れておきます。 署名付きOSコンテナの起動時、下記のような表示が出ます。 CONFIG_AHAB_BOOT  を有効にした u-boot では、通常のLinux Image (署名なし)ではなく、 os_cntr_signed.bin (署名付き)が使用されます。 7.3 動作確認 この段階では、i.MX95 のライフサイクルの状態は、OEM Open のため、u-boot や Linux が起動しますが、KEY HASH の検証失敗が、ELE イベントで検出されます。 8. SRKH (Super Root Key Hash) eFuse のプログラム 8.1 eFuse 書き込み i.MX 95 SRKH eFuse に、公開鍵のハッシュ値を書き込みます。 一度書き込むと元に戻せません。 書き込んだデバイスで、署名付きブートローダや署名付きOS コンテナを更新するときは、書き込んだ SRKH のもととなる公開鍵のペアである秘密鍵を使い署名します。 別の鍵ペアを使う場合には、現在のSRKH をRevoke し、4組作成しておいた鍵ペアで未使用のものを使用します。 i.MX 95 ボードのシリアル・ダウンロード・ポートをPCに接続し、 u-boot はあらかじめ fastboot モードにしておきます。 u-boot=> fastboot 0 署名付きイメージの作成で作られたSRKH eFuse のプログラミング用スクリプト(*.bcf) を使い、 SPSDK で書き込みます。 SRKH eFuse のプログラミング用スクリプトには、 i.MX 95 eFuse の word index が記載されています。 // OEM_SRKH (venv) $ nxpele -f mimx9596 batch output/ahab_oem0_srk0_hash_nxpele.bcf // OEM_PQC_SRKH (venv) $ nxpele -f mimx9596 batch output/ahab_oem0_srk1_hash_nxpele.bcf 8.2 eFuse 値の確認 SPSDK の nxpele コマンドで、 eFuse のword index を指定しリードして、値を確認することができます。 // OEM_SRKH[31:0] word index = 128 (venv) $ nxpele -f mimx9596 read-common-fuse -i 128 // OEM_PQC_SRKH[511:480] word index = 463 (venv) nxpele -f mimx9596 read-common-fuse -i 463 など SPSDK の代わりに、U-boot コマンド もしくは System Manager モニタのコマンドで、eFuse にリード・ライトアクセスすることもできます。 U-boot u-boot=> fuse read u-boot=> fuse prog System-Manager >$ fuse.r >$ fuse.w 8.3 動作確認 この段階では、i.MX 95 のライフサイクルの状態は、OEM Openですが、SRKH プログラム済みのため、改ざんがなければ、ELEイベントは検出されません。 改ざんがあっても、その部分が動作に影響しなければ、OEM Openのため起動しますが、認証の失敗が ELE イベントで検出されます。 9. ライフサイクルを OEM Closed に更新 i.MX 95 出荷直後のライフサイクルは、OEM Open です。 デバッグ終了後に、i.MX 95 のライフサイクルを OEM Closed に変更します。 OEM Closed にしたあとの留意点 OEM Openには戻せません。 CONFIG_AHAB_BOOT=y とした u-boot を含んだブートローダで起動すると、署名の無いイメージや、不正な署名付きイメージは起動できなくなります。 CONFIG_AHAB_BOOT=y としていない u-boot を含んだブートローダでは、署名なし Linux Image で起動できてしまいますので、必ず署名付きOS コンテナ os_cntr_signed.bin で起動させるため、 CONFIG_AHAB_BOOT=y とした u-boot を含んだブートローダを使用します。 動作確認後、署名なしのLinux Image やデバイスツリーは、boot パーティションから削除します。 9.1 SPSDK i.MX 95 ボードのシリアル・ダウンロード・ポートはPCと接続し、u-boot は、あらかじめfastboot モードにしておきます。 u-boot=> fastboot 0 SPSDK でライフサイクルを更新します。 (venv) $ nxpele -f mimx9596 forward-lifecycle-update -l OEM_CLOSED Forward Lifecycle update ends successfully. (venv) $ 9.2 U-boot u-boot=> ahab_close OEM Closed とした後、 uuu で BSP イメージ (wic ファイル) を書き込む場合にも、署名付きブートローダを使用する必要があります。 10. ELE イベントの確認 ELE (Edgelock Secure Enclave) は、i.MX 95 の内蔵ブロックで、セキュアブート時のコンテナ・イメージの認証を行います。 SPSDK および U-boot、System Manager コマンドで、ELE の状態を確認することができます。 10.1 SPSDK シリアル・ダウンロード・ポートとPCを接続し、U-boot でfastboot モードにしてから行います。 u-boot=> fastboot 0 SPSDK でELE イベントを取得します。 (venv) $ nxpele -f mimx9596 get-events 10.2 U-boot CONFIG_AHAB_BOOT=y  としたU-boot で使用できるコマンドです。 デバイスのライフサイクルにより、OEM Open または OEM closed も表示されます。 u-boot=> ahab_status 10.3 System Manager >$ ele events 10.4 表示例 ELE イベント(SRKH 値の不一致)が検出されたとき SPSDK U-boot (OEM open時) System Manager ELE イベント検出がないとき SPSDK U-boot (OEM close後) System Manager   11. ブートローダの直接署名 既存の署名なしブートローダのバイナリに、 SPSDK で直接署名を追加することも可能です。 この場合、SPSDK がブートローダ・バイナリのコンテナから構成を解釈します。 YAML ファイルで、各イメージごとの細かい設定は指定できませんが、コンテナヘッダの設定と秘密鍵および公開鍵のパスを指定するのみで、署名付きブートローダを作成することができます。 11.1 テンプレートの作成 (venv) $ nxpimage ahab get-template -f mimx9596 -o ahab_sign.yaml --sign (venv) $ cp ahab_sign.yaml sign.yaml 11.2 YAML ファイル sign.yaml に、コンテナヘッダの設定と秘密鍵および公開鍵のパスを指定します。 YAMLファイルの例 を使用する場合、 direct_signing/sign.yaml をコピーしておきます。 11.3 署名の追加 既存のブートローダのバイナリ flash.bin に署名処理を行います。 // eMMC / SD (venv) $ nxpimage ahab sign -c sign.yaml -b flash.bin -o output/flash_directsign.bin -fs output // FlexSPI NOR (venv) $ nxpimage ahab sign -c sign.yaml -b flash.bin -o output/flash_directsign.bin -fs output -m flexspi_nor output/flash_directsign.bin と、SRKH eFuse のプログラミング用スクリプト output/*.bcf が作成されます。 おわりに SoC 起動イメージの保護を実現するため、i.MX 95 セキュアブートに使用する署名付きイメージを、SPSDK を使って作成し、起動するまでの流れを紹介しました。今回はi.MX 95 AHAB で新たに追加されたPQCを利用する手順例で示しました。 ========================= 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。 お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。 (既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。) i.MX95 でのセキュアブートに使用する署名付きのコンテナ・イメージを Secure Provisioning SDK (SPSDK) で作成し、起動する手順をハンズオン形式で学べる内容となっています。 楕円曲線デジタル署名暗号 (ECDSA)と、耐量子暗号 (PQC) ML-DSA 両方の署名認証を行うHybrid boot での実現例を紹介します。 (作業時間:半日 *一度i.MX 95向けの Linux BSP のビルドが完了している前提) i.MX Processors Security 日本語ブログ
記事全体を表示
Importing a Wrapped Key Blob into ELS Using NXP_DIE_KEK_SK on RW612 Introduction When provisioning secrets into an RW612 device, one common requirement is to securely load cryptographic keys without ever exposing the plaintext key material to application software. The EdgeLock Secure Subsystem (ELS) provides a secure mechanism for accomplishing this by allowing a wrapped key blob to be imported directly into an ELS key slot. The wrapping key is derived from device-unique root material inside the secure enclave. This article demonstrates how to: Derive the die-specific NXP_DIE_KEK_SK Import and unwrap the blob using ELS Store the resulting key in an ELS keyslot Remove temporary key material after provisioning The imported key never exists in plaintext in application memory, significantly reducing the attack surface compared to software-based key management. Understanding the Key Hierarchy Before looking at the implementation, it is useful to understand the different keys involved. NXP_DIE_MK_SK(NXP_DIE_INT_MK_SK) This is the 256-bit die master key derived from UDF and PUF using the KEYPROV operation. Characteristics: Die unique Not exportable Used as a root-of-trust Occupies key slot 0 on RW612 The key is loaded via dedicated secret key bus from PUF into ELS and XOR with a UDF derived key using KEYPROV, where it is used as a main key for further derivation of all remaining keys used by ROM. Applications never directly access the key material. NXP_DIE_KEK_SK This 256-bit key is derived from the master key using CKDF. It used for the wrapping of RFC3394 blobs stored in the OTP fuse region. Purpose: Acts as a Key Encryption Key (KEK) Used only for wrapping or unwrapping other keys Can be generated dynamically when needed In this example the KEK is stored temporarily in key slot 5. Imported Key The final key imported from the wrapped blob depends on how the blob was originally generated using the HSM provisioning flow (for example, via HSM_STORE_KEY and later loaded with loadkeyblob ). The imported key may represent a customer-defined security asset such as: Customer master key ( CUST_CKDFK_FLAG ) HKDF master key ( CUST_HKDFK_FLAG ) HMAC key ( CUST_HMACK_FLAG ) CMAC key ( CUST_CMACK_FLAG ) AES key ( CUST_AESK_FLAG ) Key unwrap-only key ( CUST_KUOK_FLAG ) Regardless of the key type, the import process remains the same. The key material is never exposed to application software during this process. Once imported, the key can be used directly by ELS for the cryptographic operations associated with its intended purpose, while remaining protected within the secure subsystem. Prerequisites FRDM-RW612 Key blob wrapped using RFC3394 format using HSM_STORE_KEY Key blob programmed to OTP fuses using LoadKeyBlob command. Required Headers: #include "mcux_els.h" #include "mcuxClEls.h" #include "mcux_pkc.h" #include "fsl_romapi_otp.h" Step 1 – Derive NXP_DIE_KEK_SK The wrapped blob is protected using a Key Encryption Key (KEK). On RW612, the KEK can be derived from the device master key ( NXP_DIE_MK_SK ) using the official recipe constants. The derivation operation uses  masterKeyIdx = 0;  which corresponds to NXP_DIE_MK_SK  and produces a new key in the target slot. Example: static const uint8_t derivation_data[12] = { 0x94, 0xbe, 0x03, 0xac, 0x8b, 0x59, 0x32, 0x45, 0x11, 0x7f, 0xf8, 0x3f }; mcuxClEls_Ckdf_Sp800108_Async( masterKeyIdx, target_slot, targetKeyProperties, derivation_data);   Wait for completion: mcuxClEls_WaitForOperation(MCUXCLELS_ERROR_FLAGS_CLEAR);   Verify that the derived key slot becomes active before proceeding. Step 2 – Retrieve the Wrapped Blob The example reads the blob directly from OTP memory. otp_fuse_read(starting_fuse_index + i, &fuse_word); Each fuse word contains four bytes.   These words are assembled into a contiguous buffer: blob_data[i * 4 + 0] = (fuse_word >> 0) & 0xFF; blob_data[i * 4 + 1] = (fuse_word >> 8) & 0xFF; blob_data[i * 4 + 2] = (fuse_word >> 16) & 0xFF; blob_data[i * 4 + 3] = (fuse_word >> 24) & 0xFF; The resulting buffer contains the RFC3394 wrapped key. Step 3 – Import and Unwrap the Blob Once the KEK exists and the blob has been retrieved, the import operation can begin. Configure ELS for RFC3394 import: mcuxClEls_KeyImportOption_t options; options.word.value = 0; options.bits.kfmt = MCUXCLELS_KEYIMPORT_KFMT_RFC3394; Perform the import: mcuxClEls_KeyImport_Async( options, blob_data, blob_length, kek_slot, target_slot); Parameters: Parameter Purpose blob_data Wrapped key blob blob_length Blob size kek_slot Slot containing NXP_DIE_KEK_SK target_slot Destination keyslot Wait for completion: mcuxClEls_WaitForOperation(MCUXCLELS_ERROR_FLAGS_CLEAR); If successful, ELS unwraps the blob internally and places the resulting key into the destination key slot. No plaintext key material is exposed to software. Step 4 – Clean Up Temporary KEK After the blob has been imported, delete the temporary KEK: mcuxClEls_KeyDelete_Async(kek_slot); mcuxClEls_WaitForOperation(MCUXCLELS_ERROR_FLAGS_CLEAR); This leaves only the imported key resident inside ELS. Next Steps At this point, the wrapped key blob has been successfully imported into the target ELS key slot, and the temporary NXP_DIE_KEK_SK has been removed. The imported key is now available for use by ELS-protected cryptographic operations without exposing the underlying key material to application software. The next step is to validate the imported key by performing the operation it was provisioned for. Depending on the key type, this may include: AES encryption or decryption operations HMAC generation or verification CMAC generation or verification HKDF-based key derivation Importing or unwrapping additional key material Secure firmware or data encryption workflows A successful cryptographic operation confirms that: The blob was read correctly from storage. The NXP_DIE_KEK_SK derivation completed successfully. The RFC3394 unwrap operation succeeded. The key was installed into the intended ELS keyslot with the expected properties. For production deployments, this import mechanism provides a secure method for provisioning customer keys generated with the HSM tooling while ensuring that plaintext key material never leaves the ELS security boundary.
記事全体を表示
S32K388 FXOSC GM_SEL 推荐值(适用于 8/16/20/40 MHz 晶体) NXP社区的各位好, 我正在做一个 S32K388 项目,并配置 FXOSC(快速晶振(晶体振荡器))。我在参考手册中看到 GM_SEL 用于选择 FXOSC 放大器的跨导,但我找不到将晶体频率与 GM_SEL 值对应起来的清晰推荐表。 当前配置: 晶体:16 MHz 无源晶体 GM_SEL = 12 (0xC,~0.7016x) EOCV = 157 OSC_BYP = 0(晶体模式) COMP_EN = 1 对于 16 MHz 的频率,这种方法效果很好。 我的问题:我希望支持多种晶体选项:8 MHz、16 MHz、20 MHz 和 40 MHz。 请问谁能分享一下各个频率的推荐GM_SEL值?或者能否提供一份 NXP 应用笔记或表格,其中提供了这方面的指导? 具体来说: 对于每个标准 FXOSC 频率(8/16/20/40 MHz),是否有推荐的 GM_SEL 值? 对于 20 MHz 晶体,为了获得可靠的振荡,GM_SEL 是否应该从 12 增加到 15(最大值)? GM_SEL 的选择主要取决于晶体频率、ESR、负载电容,还是所有这些因素? 任何指导或参考资料都将不胜感激。 顺祝商祺! Re: S32K388 FXOSC GM_SEL recommended values for 8/16/20/40 MHz crystals 嗨@xlele 在《S32K3 MCU 通用硬件设计包》中包含的《S32K3xx 微控制器硬件设计指南》修订版 E2 的 3.2 节中提到,“当 GM > 5 × gmcrit 时,晶振(晶体振荡器)电路可提供非常安全稳定的振荡”,并且还定义了 gmcrit 的计算方法。 此外,在 S32K3xx 数据手册第 14 版的 11.4 节中,针对 ALC 禁用模式,提供了 GM = 4'b0010 的通用推荐设置。 最后,例如,如果根据晶体规格,需要跨导 G = 12 mA/V 来确定 CTRL[GM_SEL] 值: 12 mA = 18.5 mA × N N = 12 mA / 18.5 mA = 0.6486 寄存器设置支持的最近值对应于 CTRL[GM_SEL] = 1010b → 0.6681× BR,VaneB
記事全体を表示
MC33774 无响应 MC33774 无响应 MC33665+MC33774 的当前 DEMO 例程实现了 665 初始化、774 初始化以及电压和温度采集功能。实验台的布置如图所示。1. 当 S32K314 主控单元使用 JLINK 连接到 SWD 调试端口进行调试和仿真时,33774 和 33665 都能正常响应,返回回复帧并获取正确的单元电压和 GPIO 端口数据。台式上电顺序为“采样从板上电 -> MC33665A 上电 -> MCU 主板上电”。通信初始化请求读取寄存器消息显示为 MC33774_FIRST(其中 CAN 类型消息为 MC33665 回复帧)。2. 当仿真器断开连接且整个平台断电一段时间后,按“采样从板上电 -> MC33665A 上电 -> MCU 主板上电”的顺序再次上电时,MC33774 没有响应,只有 MC33665A 可以返回响应帧。通过开关机重新初始化MCU主板没有效果;只有在使用J-Link进行调试时才能与MC33774正常通信。消息如 MC33774_SECOND 所示。我想知道在排查故障时可以采取哪些步骤。 当前MC33665+MC33774的DEMO例程实现665初始化、774初始化以及电压温度采集功能,台架构成如图: 1.当S32K314主控部分使用JLINK链接SWD调试口进行调试仿真时,33774和33665均能正常响应返回应答帧并采集正确的适配器电压和GPIO端口数据。台架上电顺序为“采样从主板上电->MC33665A上电->MCU模块上电”。通讯初始化至请求读取读取报文如MC33774_FIRST所示(其中CAN报文类型为MC33665回复帧) 2.当断开仿真器并且将台架全部下电后等待一段时间,重新按照“采样从主板上电->MC33665A上电->MCU主板上电”顺序上电后,MC33774无响应,则MC33665A能返回响应帧。重新将MCU主板上下电进行初始化也无效,只有用JLINK调试时才正常与MC33774通讯。报文如MC33774_SECOND所示。 我想知道排查的方向有哪些? Re: MC33774 is unresponsive MC33774无响应 亲爱的嵌入式新手: MC33665 包含内部通信管理功能,不具备透明桥接功能。 当 MC33665 RESET 而 MC33774 仍保持通电状态时,TPL 链路将失去同步,导致设备处于 SPI 通信工作但 TPL 转发未启用的状态。 执行两次初始化可以有效地清除内部状态并重新建立链路同步,这就是它解决问题的原因。 建议的解决方案是确保正确重新初始化 TPL 或同步 RESET 两个设备。 最诚挚的问候, 约瑟夫 Re: MC33774 is unresponsive MC33774无响应 通过实验,我发现问题是由 MC33665 断电引起的。当我的 MC33774 保持通电状态,而 MC33665 断电重启,MCU 也断电重启时,尽管软件逻辑重新初始化了 MC33665,但它似乎处于无法转发 TPL 数据的状态。这是因为我的消息表明 MC33665 可以发送回复帧。因此,MC33665 一定处于某种状态,导致它无法转换 TPL 信号并将其发送到 33774。目前,我可以通过在软件逻辑中执行两次相同的 MC33665 初始化来避免这种现象。但是,我不清楚为什么 MC33665 会出现这种行为。你有什么想法吗? 我通过实验发现是由于MC33665下电导致的,当我的MC33774保持上电,MC33665下电重启,因为MCU也下电重启后,虽然软件逻辑上到MC33665重新初始化,但是此时MC33665似乎无法转发TPL数据的状态,我的报文中可以看出MC33665能够发出状态回复帧,所以MC33665应该有某种原因导致无法转换TPL信号不断出现33774。我当前在软件逻辑中进行两次相同的MC33665初始化就能够避免这种现象。但是我并并MC33665为什么会这样。请问您有什么办法吗? Re: MC33774 is unresponsive MC33774无响应 亲爱的嵌入式新手: 这个问题很可能是由启动时序依赖性引起的。当使用 J-Link 调试系统时,MCU 执行会被延迟,从而给 MC33774 足够的时间完成其内部初始化。在正常上电情况下,MCU 会立即启动并在 MC33774 准备就绪之前发送通信请求,导致没有响应。 建议在第一次通信之前引入延迟(例如 50-200 毫秒),实施重试机制,并确保 MC33665 在寻址 MC33774 之前正确初始化并唤醒 TPL 通信链。此外,还应验证 MC33774 的 RESET 和电源斜坡条件。 最诚挚的问候, 约瑟夫
記事全体を表示
在 SPC563 (e200z3) 上集成 ERIKA RTOS-将程序集 (.S) 转换到时出现编译错误 大家好, 我目前正在使用 CodeWarrior 2.9 开发 SPC563XX(Power Architecture e200Z3),该芯片与 MCP563xx 微控制器功能相当。 在尝试整合 MCP56xx 系列的 ERIKA RTOS 时,我遇到了以下编译错误: mwldeppc:未定义:'EE_hal_terminate_savestk'  mwldeppc:引自 ee_tstub.o 中的 “ee_oo_thread_stub” 经调查,我发现函数 EE_hal_terminate_savestk() 定义在一个汇编 (.S) 文件中,而该文件似乎并未被纳入编译过程。 我的工具链能够编译 .c 文件文件,所以我尝试通过将 .S 文件重命名为 .c 来解决这个问题文件,并将汇编代码封装在 C 风格函数中(例如:asm void Fun(){})。 我最初的意图是重用相同的汇编实现,只调整函数定义以匹配 C 语法,这样我就可以避免修改生成文件。然而,这种做法导致了多个编译错误,这让我感到意外。 以下是我遇到的一些错误: 非法函数定义  未定义的标识符 'rlwinm'  未定义的标识符 'addis'  未定义的标识符 'stw'  未定义的标识符“stmw”  未定义的标识符“mtlr”  未定义的标识符 'bl'  未定义的标识符 'lwz'  未定义的标识符“addi”  声明语法错误  预期为 ';' 看起来 CodeWarrior 编译器无法识别 C 文件中的若干 PowerPC 汇编指令。 请帮我解释一下: 为什么编译器无法识别这些汇编指令? 这种方法(将汇编代码嵌入到 .c 文件中)该文件是否适用于此工具链? 我该如何正确解决这些编译错误? 感谢您的支持。 此致, 纳格恩德拉·波图拉 软件架构师 AVL ITC 印度 Re: Integrating ERIKA RTOS on SPC563 (e200Z3)- Compilation Error While When Converting Assembly (.S) 您遇到的编译错误是由于 PowerPC 汇编代码被当作 C 代码进行编译所导致的。通过将原始的 .S 文件重命名为 .c 文件,并将汇编代码嵌入到 C 函数中,编译器会尝试将 rlwinm、addis、stw 等汇编指令解释为 C 语法,从而导致出现“未定义标识符”和“非法函数定义”等错误。此方法对 CodeWarrior 无效,因为这些指令只有在由汇编器处理时才会被识别。 正确的解决方案是保留原始的 .S 文件并确保它正确包含在编译系统中,以便由汇编器编译并与项目的其余部分链接。这种形式的内联汇编无法替代 RTOS 所使用的完整汇编模块。 请注意,ERIKA Enterprise是第三方开源实时操作系统(类似于OSEK/AUTOSAR),不是恩智浦的产品,因此其集成和构建配置不在恩智浦的范围内,需要由您自己处理。 作为参考,以下文档可能会对你有所帮助: 飞思卡尔 PPC e200 (mPC56xx) 支持页面:https://erika.tuxfamily.org/wiki/index.php?title=Freescale_PPC_e200_%28MPC_56xx% 29 感谢您的理解。 Re: Integrating ERIKA RTOS on SPC563 (e200Z3)- Compilation Error While When Converting Assembly (.S) 谢谢回复。 请问哪里可以找到NXP MPC5634M的启动代码? Re: Integrating ERIKA RTOS on SPC563 (e200Z3)- Compilation Error While When Converting Assembly (.S) 大家好, 你是对的。发布问题后,我意识到我犯了一个错误,只是简单地将文件从 *.s 更改为 *.c。 然后我使用如下所示的内联汇编实现了相同的功能,这样就解决了所有编译器和链接器错误: void Func(void) { 汇编 { /* 此处填写汇编代码 */ } }
記事全体を表示
Choosing the Right FRDM Board for MCX A Series Selecting the Right FRDM Platform for MCX A Series A technical guide for mapping application requirements to MCX A evaluation hardware The MCX A series spans a wide range of MCU variants optimized for real-time control, precision sensing, motor control, and industrial connectivity. Because peripheral combinations and acceleration features vary significantly across subfamilies, selecting the appropriate FRDM board is critical for accurate prototyping and performance validation. This guide provides a device-to-board mapping along with architectural considerations to help engineers align hardware selection with system requirements. Design Considerations for Board Selection When choosing a FRDM platform for MCX A devices, evaluate: 1. Compute and Real-Time Requirements Use of SmartDMA for offloaded data movement Deterministic latency requirements (motor control, control loops) Availability of hardware accelerators (e.g., MAU) 2. Analog and Sensing Capabilities 16-bit ADC resolution and sampling throughput Dual ADC configurations for simultaneous sampling Sensor interface (UART/I2C/I3C/SPI) 3. Connectivity and System Integration CAN-FD for industrial/automotive networks FS USB for host/device applications and debug access Emerging interfaces (e.g., I3C) for modern sensor integration 4. HMI and Security Requirements SLCD support for low-power display use cases Hardware-based security features for connected edge nodes MCX A to FRDM Board Mapping Supported MCU(s) Recommended Board Best Fit For Key Differentiators MCX A13, A142, A143, A152, A153 FRDM-MCXA153 Cost-sensitive smart sensing and motor control FS USB, 16-bit ADC, compact entry platform MCX A144, A145, A146, A154, A155, A156 FRDM-MCXA156 Connected control, smart sensing, industrial HMI 1 MB Flash, FS USB, CAN-FD, FlexIO, 2x 16-bit ADC, I3C MCX A173, A174 FRDM-MCXA174 Balanced real-time control and connected sensing CAN-FD, SmartDMA, ADC, compact mid-tier platform MCX A175, A176, A185, A186, A255, A256, A265, A266 FRDM-MCXA266 Industrial HMI, secure connected sensing, USB-enabled control FS USB, SLCD, CAN-FD, FlexIO, SmartDMA, advanced security MCX A343, A344 FRDM-MCXA344 Cost-optimized motor control and smart sensing CAN-FD, MAU, SmartDMA/LCD expansion MCX A345, A346 FRDM-MCXA346 Advanced motor control and high-performance real-time designs 2x FlexPWM, MAU, SmartDMA, CAN-FD MCX A355, A356, A365, A366 FRDM-MCXA366 Industrial HMI, secure connected sensing, high-performance control FS USB, SLCD, CAN-FD, MAU, SmartDMA, FlexIO, advanced security Not all MCX A devices expose the same combination of ADCs, SmartDMA, MAU, or connectivity interfaces—and choosing the wrong evaluation board can limit what you can prototype. This article provides a clear mapping between MCX A families and FRDM platforms, helping you align hardware capabilities with system requirements. FRDM-MCXA MCU
記事全体を表示
FRDM-A-S32K344: Secure Encrypted Ethernet Demo Secure Encrypted Ethernet Communication using FRDM-A-S32K344  Find the code in Application Code Hub as Secure Encrypted Ethernet End Nodes This project implements a configurable secure encrypted Ethernet communication node that can operate in three different modes—Transmit (TX), Receive (RX) and Intruder —selected at build time using compile‑time macros. Depending on which macro is enabled during compilation, the firmware conditionally includes only the logic required for that mode. /* Macro for NODE selection: Select TX_BOARD, RX_BOARD or INTRUDER_BOARD and * flash its corresponding profile */ #define TX_BOARD (1u) /* TX_BOARD is selected */ #define RX_BOARD (0u) #define INTRUDER_BOARD (0u) TX Node Mode (TX_BOARD) - In this mode, the device encrypts an image and transmits Ethernet frames when the transmission button is pressed. If the encrypt button is pressed, the Ethernet frames will contain the encrypted image. If the encrypt button is not pressed, the Ethernet frames will contain the base image. RX Node Mode (RX_BOARD) - The device listens for incoming Ethernet frames and processes the data to display the received image in the LCD display. When the encrypt button is pressed the decryption is enabled. Intruder Node Mode (INTRUDER_BOARD) - The device listens for incoming Ethernet frames and processes the data to display the received image in the LCD display. Intruder does not have access to decryption. This project has the option to define if the on-board push buttons are used or external user push buttons connected to PTE24 and PTE25. /* Macro for BUTTON selection: Select INTERNAL_BUTTONS or EXTERNAL_BUTTONS and * flash its corresponding profile.*/ #define INTERNAL_BUTTONS (1u) // SW2 = Encryption, SW3 = Transmission #define EXTERNAL_BUTTONS (0u) // PTE24 = Encryption, PTE25 = Transmission   Application Description The application runs on an NXP S32K344 MCU and demonstrates a complete image encryption, transmission, reception, and optional encryption pipeline. The code encrypts an image using the HSE, transmits it over Ethernet, receives encrypted data, decrypts it using HSE, and displays it. The summarized functionality is the next: LCD Display Handling: Initializes an LCD via LPSPI1 and displays an embedded bitmap image AES-128 Encryption/Decryption (ECB mode): Uses Crypto_43_HSE AUTOSAR Crypto Driver, offloads all crypto operations to the Hardware Security Engine (HSE), splits an image into 64‑byte blocks, encrypts each block with AES‑128 ECB Ethernet Transmission (GMAC): Encapsulates encrypted image data into Ethernet frames, Sends frames over GMAC0 and receives incoming frames and reconstructs the encrypted image User Interaction via Buttons: SW3 starts transmission and SW2 grants encryption   Algorithm The main function initialize all pin routing, peripherals and LCD over SPI. Performs setup for Crypto Driver and HSE by loading a key and mark it as valid. (TX) The image stored as a bitmap in ImageDataAuto[] is split into blocks of 64 bytes in order to perform the encryption and store the encrypted output in EncryptedImage[] for secure Ethernet transmission. (TX) Ethernet frame is built manually and is broken into frames of 1024 bytes. (TX) Transmission starts when the transmit button is pressed. When all image data is sent then the transmission resets. (RX) Incoming Ethernet frames are processed in the emac_rx_callback(…) where the payload bytes are extracted and appended into the EncryptedImage[] array. (RX) Once all the image bytes arrives a flag is activated to show the image in the infinite loop. (Intruder) The intruder board can sniff the image sent as long as the Encrypted Button is not pressed. (Intruder) If the Encrypted Button is pressed, intruder board will receive the encrypted array and not be able to decrypt. Crypto Driver and HSE This project makes extensive use of the AUTOSAR Crypto Stack, specifically the Crypto_43_HSE driver and the HSE embedded hardware module as the accelerator performing all AES operations. Some of the key functions and features to understand are: Initialization of HSE Key Catalog: This configures the RAM and NVM key catalogs where the HSE stores key metadata. RetVal = Crypto_43_HSE_Exts_FormatKeyCatalogs(); Loading AES-128 Key into the HSE: The key is transferred into the HSEs secure storage. Crypto_43_HSE_KeyElementSet(APP_AES128_KEY_ID,KEY_MATERIAL_ELEMENT_ID_U32, App_au8Aes128EcbKey_1, APP_AES128_KEY_SIZE); Key Validation: Makes the key available to subsequent crypto jobs. Crypto_43_HSE_KeySetValid(APP_AES128_KEY_ID); AES-128 ECB Job Execution: The CPU does not perform AES operations. The request is passed to the HSE firmware, which executes AES‑128 ECB using its hardware crypto accelerators. Encryption and decryption are performed using their corresponding jobs: Crypto_43_HSE_ProcessJob(APP_SYMMETRIC_CDO_ID, &App_JobAes128EcbEncrypt); Crypto_43_HSE_ProcessJob(APP_SYMMETRIC_CDO_ID, &App_JobAes128EcbDecrypt); HSE-compatible non-cacheable buffers: HSE accesses memory via DMA and cannot read cache-only memory regions. The code places all data buffers exchanged with HSE in special sections defined by: #define CRYPTO_43_HSE_START_SEC_VAR_INIT_8_NO_CACHEABLE Boards: FRDM-A-S32K344 Categories: Communication, Security Peripherals: Siul2, Crypto 43 HSE, ETH 43 GMAC Toolchains: S32 Design Studio IDE 1. Software and Tools 1.1 FRDM Automotive Bundle for S32K3 The demo was developed using the FRDM Automotive Bundle for S32K3. To download and install the complete software and tools ecosystem, use the following link: S32K3 FRDM Automotive Board Installation Package. 1.2 Security Real-Time Drivers Crypto As the application uses cryptography and the Hardware Security Engine (HSE) peripheral, it is necessary to download the Security Real-time drivers Crypto 7.0.0 QLP02 and the S32K344 HSE Standard Firmware to the bundle by following the next steps: Click on the Software Library tab. Select S32K3 checkbox in the Devices tab to filter the results. Type Security Real-Time Drivers Crypto in the search bar and click in the checkbox to select it. Confirm that the version is 7.0.0_QLP02. Type S32K344 HSE Standard Firmware in the search bar and click in the checkbox to select it. Confirm that the version is RTM 0.2.55.0. Click on Generate Bundle Installer button and confirm that the package contains all the drivers as shown. 2. Hardware 2.1 Required Hardware Personal Computer Type-C USB cable Switch Gigabit Ethernet GS108 3 * Ethernet cable 3 * 2.8" TFT touch shield for Arduino 3 * FRDM-A-S32K344 2.2 Debugger Connector Connect the PEmicro debugger to the Cortex Debug connector Connect debugger USB to PC Power the FRDM-A-S32K344 using the USB-C cable or connect USB C cable directly to the board for power supply and debug capabilities 3. Setup 3.1 Import the Project into S32 Design Studio IDE Open S32 Design Studio IDE, in the Dashboard Panel, choose Import project from Application Code Hub. Found the demo you need by searching the name directly. Open the project, click the GitHub link, S32 Design Studio IDE will automatically retrieve project attributes then click Next>. Select main branch and then click Next>. Select your local path for the repo in Destination->Directory: window. The S32 Design Studio IDE will clone the repo into this path, click Next>. Select Import existing Eclipse projects then click Next>. Select the project in this repo (only one project in this repo) then click Finish. 3.2 Connect Hardware Before connecting the display to the board it is necessary to solder 3 SMD pads to enable SPI transmission. The pads correspond to SI, SO and SCK marked in the silkscreen as 11, 12 and 13 respectivelly (yellow circle in the image). To connect the display to the board, follow the next image to make sure the pins in the board marked by red coincide with the pins in the display marked by red. 3.3 Generating, Building and Running the Example Import the HSE using FRDM-A-S32K344 project from Application Code Hub following the steps above. In Project Explorer, right-click the project and select Update Code and Build Project and then go to Debug. The project must be executed twice in order to enable the HSE in the board.Note: This is a mandatory step to compile the Secure Encrypted Ethernet Communication project. In Project Explorer, right-click the project and select Update Code and Build Project. This will generate the configuration (Pins, Clocks, Peripherals), update the source code and build the project using the active configuration (e.g. Debug_FLASH). Make sure the build completes successfully and the *.elf file is generated without errors. Press Yes in the SDK Component Management pop-up window to continue. If a error appears related to the NXP GCC 10.2 not installed, right click on it and select Quick Fix. Note: This is a mandatory step to compile the Secure Encrypted Ethernet Communication project. To generate the other executables, the macros must be modified to use the other node mode. In the app_cfg.h file within the src folder. Change the macro definition from:  #define TX_BOARD (1u)  to  #define TX_BOARD (0u)  and  #define RX_BOARD (0u)  to  #define RX_BOARD (1u) . To set the intruder, repeat previous steps but set  TX_BOARD  and  RX_BOARD  to  (0u)  and  INTRUDER_BOARD  to  (1u)  in the macro definition for the intruder board. Then clean project and build again to generate the RX node executable. Go to Debug and select Debug Configurations. Select GDB PEMicro Interface Debugging: Use the controls to control the program flow. Note: The GDB PEMicro Interface Debugging configuration uses default ports 6224 and 7224. In example are provided 2 debug configurations, one with default ports and another one with custom ports to support debugging of 2 boards simultaneously on the same PC. You must change the  C/C++ Application  path in the debug configuration to point to the generated *.elf file, one for TX node and one for RX node. In one launch configuration, select one board (for example USB1) and in the second launch configuration, select the other board (for example USB2). 4. Results When one board is connected as transmitter, one as receiver and other as intruder, using three ETH cables to the Switch, the image on the transmitter board will appear in the display, on the receiver and intruder board, the image will appear when the transmit button is pressed in the transmitter. If the encrypt button is pressed in both transmitter and receiver, the image will show complete but encrypted in the intruder. (function() { var wrapper = document.getElementById('lia-vid-6390689216112w960h540r430'); var videoEl = wrapper ? wrapper.querySelector('video-js') : null; if (videoEl) { if (window.videojs) { window.videojs(videoEl).ready(function() { this.on('loadedmetadata', function() { this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) { bar.setAttribute('role', 'presentation'); bar.setAttribute('aria-hidden', 'true'); }); }); }); } }})(); (view in My Videos) Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository or directly in the commentary section. Warning: For more general technical questions regarding NXP Microcontrollers and the difference in expected functionality, enter your questions on the NXP Community Forum This project implements a configurable secure encrypted Ethernet communication node with the transmission of a large data image. FRDM-Training MCU
記事全体を表示
【NXPマイコン入門】【モータ制御】【基礎編③】永久磁石同期モータの仕組みと制御方法(日本語ブログ) 目次   【NXPマイコン入門】【モータ制御】【基礎編③】永久磁石同期モータの仕組みと制御方法 縁の下の力持ち!クラーク変換とパーク変換ってなんだろう? すべての始まり:三相交流という「複雑な波」 ステップ1:クラーク変換 - 3次元を2次元にシンプル化する ステップ2:パーク変換 - 動く世界を止めて見る「メリーゴーラウンドの魔法」 なぜこんな面倒な変換をするの? その絶大なメリットとは まとめ:複雑な波を、意のままに操るための数学の力 【NXPマイコン入門】【モータ制御】【基礎編③】永久磁石同期モータの仕組みと制御方法 縁の下の力持ち!クラーク変換とパーク変換ってなんだろう? こんにちは! 電気自動車(EV)がスーッと滑らかに発進したり、高性能なエアコンが驚くほど静かに運転したり。その裏側では、マイコンが超高速で複雑な計算を行い、モーターを巧みに操っています。 今回は、その制御技術の心臓部、「ベクトル制御」で活躍する二人の偉大な専門家(の名前がついた変換)、「クラーク変換」 と 「パーク変換」 の謎を、下のGIFアニメーションと共に解き明かしていきましょう! (function() { var wrapper = document.getElementById('lia-vid-6377224605112w540h540r855'); var videoEl = wrapper ? wrapper.querySelector('video-js') : null; if (videoEl) { if (window.videojs) { window.videojs(videoEl).ready(function() { this.on('loadedmetadata', function() { this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) { bar.setAttribute('role', 'presentation'); bar.setAttribute('aria-hidden', 'true'); }); }); }); } }})(); (マイビデオを表示) すべての始まり:三相交流という「複雑な波」 まず、一番上の段。これはモーターを動かすための基本エネルギー、「三相交流」の世界です。 右のグラフ(Three-Phase Sine Waves): A相, B相, C相という3つの波が、絶えず大きさと向きを変えながら流れています。この3つの波は互いに連携していますが、このままでは「今、モーターにどれくらいの力を加えるべきか」を直感的に判断するのは至難の業。まるで、3人の奏者がそれぞれ違う楽譜で演奏しているのを、同時に指揮するようなものです。 左のグラフ(Rotating Vector): しかし、この3つの波の力を合成すると、面白いことが起こります。大きさが一定のまま、クルクルと滑らかに回転する一つの力(回転ベクトル)が生まれるのです。物理的には、これがステータコイルが作り出す「回転磁界」そのもの。この回転する磁界こそが、ロータの磁石を引っ張ってモーターを回す力の源です。 課題: この「常に変化する3つの波」を、どうやってマイコンで簡単に、そして正確にコントロールすれば良いのでしょうか? ステップ1:クラーク変換 - 3次元を2次元にシンプル化する 最初の魔法が「クラーク変換」です。これは、複雑な3次元の世界を、もっと分かりやすい2次元の世界に描き直す作業です。 計算式は以下のようになります。 通常モーター制御では、振幅不変変換(K=2/3)、平衡三相(i_a+i_b+i_c=0)を前提とし、以下の簡略化された式が用いられます。   ​ 右のグラフ(Two-Phase Sine Waves α-β): 見てください!3本あった波が、α(アルファ)とβ(ベータ)という2本の波に集約されました。まだ波の形(交流)はしていますが、変数が一つ減って、だいぶ見通しが良くなりました。 左のグラフ(Clarke Transformation α-β): これは、3つの軸(A, B, C)で見ていた回転ベクトルを、直角に交わる2つの軸(α, β)で見た世界です。ちょうど、斜めから見ていた立体を、真上から見た平面図にしたようなイメージ。回転ベクトル自体は、何も変わらず同じように回転しています。 【クラーク変換のポイント】 情報を一切失うことなく、3相という少し扱いにくい座標系から、数学で馴染み深い直交座標(α-β静止座標系)に変換し、問題をシンプルにしました。 ステップ2:パーク変換 - 動く世界を止めて見る「メリーゴーラウンドの魔法」 αとβの値もまだ波のように変化しており、これを追いかけるのは大変です。そこで登場するのが、ベクトル制御の真髄、「パーク変換」です! 計算式は以下のようになります。 ​​ これは、「静止した地面(α-β座標)から回転ベクトルを眺めるのをやめて、いっそのこと回転ベクトルと同じ速度で回るメリーゴーラウンドに飛び乗ってしまおう!」 という、まさに発想の大転換です。この新しい回転する座標を「d-q回転座標系」と呼びます。 右のグラフ(Two-Phase Value d-q): 驚くべき結果です!あれほど激しく変化していた2つの波が、dとqという**ほぼ一定の値(直流)**に変わりました! 左のグラフ(Park Transformation d-q): d-q座標が、回転ベクトルと完全に同期して一緒に回転しているのが分かります。あなたがメリーゴーラウンドに乗っている馬の真横に立てば、その馬はあなたに対して静止して見えますよね?それと全く同じ原理です。回転している側から見れば、回転しているものは止まって見えるのです。 【パーク変換のポイント】 回転ベクトルと同じ速度で回転する座標系(d-q座標)から観測することで、交流の値を直流の値として扱うことができるようになります。 なぜこんな面倒な変換をするの? その絶大なメリットとは この二段階の変換を経て、私たちはとてつもないメリットを手にします。それは 「制御の圧倒的な単純化」 です。 常に変化する交流値を制御するのは難しいですが、直流値ならどうでしょう?目標値より高ければ下げる、低ければ上げる。小学生でも分かるこの単純な操作(PID制御)で、モーターを完璧にコントロールできるようになるのです。 そして、dとqの直流値には、それぞれ重要な物理的な意味が割り当てられています。 q軸の値 (Quadrature-axis): モーターの**トルク(回転する力)**を直接コントロールします。EVのアクセルを踏んだ時にグッと加速するのは、マイコンがこのq軸の目標値を上げているからです。まさに「力のダイヤル」です。 d軸の値 (Direct-axis): モーターの**磁束(磁石の強さ)**をコントロールします。永久磁石モータの場合、ロータの磁石の強さは一定なので、基本的にはこのd軸の電流はゼロになるように制御するのが最も効率的です。まさに「効率のダイヤル」です。 つまり、クラーク変換とパーク変換は、本来ごちゃ混ぜになっているモーターの「力」と「効率」の要素を、2つの独立した直流のダイヤル(dとq)に分離してくれる魔法なのです。 まとめ:複雑な波を、意のままに操るための数学の力 三相交流という複雑な波で、モーターの中に回転する力(回転ベクトル)を作る。 クラーク変換で、3次元の世界を2次元(α-β)に描き直し、問題をシンプルにする。 パーク変換で、回転するメリーゴーラウンド(d-q座標)に乗り込み、交流の値を直流の値に変換する。 直流になったトルク(q)と磁束(d)の値を、PIDコントローラーで簡単かつ正確に制御する! この一連の華麗な数学的処理こそが、現代の高性能モーターを支える「ベクトル制御」の根幹です。この魔法があるからこそ、私たちはパワフルで静かで、省エネなモーターの恩恵を存分に受けることができるのですね。 最後までお読みいただきありがとうございました! 次の基礎編を読みたい方はこちら↓ 【基礎編④】実践!ベクトル制御の仕組みをブロック図で見てみよう! 具体的なセットアップ方法やサンプルコードの動かし方についての解説はこちら↓ 【NXPマイコン入門】【モータ制御】【実践編①】永久磁石同期モータの仕組みと制御方法(日本語ブログ) NXPのモーター制御の記事をまとめたサイトはこちら↓ NXPのモーター制御 ~まとめページ~ (日本語ブログ) =========================​ 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。​ お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。​ (既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。)​ NXPのFRDMボード「FRDM-MCXA156」を使用して、モーター制御について分かりやすく解説していきます。基礎編と実践編に分かれていますので、興味のある内容から参考いただければ幸いです。 ・基礎編①~⑦、実践編①~③ 今回は基礎編③として、NXPマイコンで、永久磁石同期モータの仕組みと制御方法について解説します。 MCUXpresso MCUXpresso IDE MCUXpresso SDK MCX Motor Control Technology Focus 日本語ブログ
記事全体を表示
[RTD600 MCAL] S32K3X4EVB-T172 FlexCAN Wake-up This example project will show user how to use and configure the basic functionalities of ICU (WKPU) + CAN.   ------------------------------------------------------------------------------ * Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2) * MCU: S32K344 * IDE: S32DS3.5 & S32DS v3.6.x * SDK release: RTD 6.0.0 * Debugger: PE Micro * Target: internal_FLASH  ------------------------------------------------------------------------------ This project configures both Can_43_FLEXCAN and CanIf modules for CAN communication, along with the ICU (WKPU) module for wake-up. Transmission is done via POLLING, while reception is configured via INTERRUPT.  Tx MB is set to STD ID 123h. Acceptance mask is set to 0x0 (accept all IDs). CAN messages are sent using Can_43_FLEXCAN_Write() and received using the CanIf_RxIndication() callback. After CanIf_bRxFlag is set, an ACK message is sent back. If TJA1153 transceiver is used, macro TJA1153_EVB_TRCV must be used. If not, use TJA1043_EVB_TRCV for standard transceiver initialization (CAN0_STB & CAN0_EN pins set to HIGH).  FlexCAN bitrate is calculated with: CAN bit timing calculator sheet. CAN classic (non-FD) 24Mhz clock 500Kbps 81.3% Sample Point Main routine: Waits for SW5 to be pressed, or for FlexCAN Rx interrupt. If SW5 is pressed, turns off green LED, disables FlexCAN and switches CORE_CLK to FIRC. It then configures PTA6 (CAN0_RX) for wakeup. If a CAN message is received (edge detect on PTA6), MCU wakes up and will enter main routine again. If a CAN frame is received, MCU will wake-up and wait for SW5 to be pressed again. Note: The first CAN frame may not be fully received since there will be some time for the MCU to warm up from STANDBY mode back to RUN mode, so the application may need to ignore the first CAN frame. Note 2: In order to test this example, another CAN node must be connected to CAN0_OUT. This example is provided as is with no guarantees and no support.
記事全体を表示
RT685: SDK 25.12 没有 HASHCRYPT 加速功能 你好 我们最近更新到了 SDK 25.12,发现我们的 TLS 解密率降低了一半。 mbedTLS v3.x 不再使用fsl_hashcrypt硬件加速功能。 下面是使用以前的 SDK 25.09 调用mbedtls_ssl_read 的调用堆栈。可以看到,最终使用了HASHCRYPT_AES_EncryptEcb。 hashcrypt_aes_one_block_aligned() at fsl_hashcrypt.c:437 hashcrypt_aes_one_block() at fsl_hashcrypt.c:581 HASHCRYPT_AES_EncryptEcb() at fsl_hashcrypt.c:1,284 mbedtls_internal_aes_encrypt() at aes_alt.c:1,959 mbedtls_aes_crypt_ecb() at aes_alt.c:1,323 aes_crypt_ecb_wrap() at cipher_wrap.c:114 mbedtls_cipher_update() at cipher.c:521 mbedtls_gcm_update() at gcm.c:358 mbedtls_gcm_crypt_and_tag() at gcm.c:456 mbedtls_gcm_auth_decrypt() at gcm.c:491 mbedtls_cipher_aead_decrypt() at cipher.c:1,407 mbedtls_cipher_auth_decrypt_ext() at cipher.c:1,613 mbedtls_ssl_decrypt_buf() at ssl_msg.c:1,242 ssl_prepare_record_content() at ssl_msg.c:3,667 ssl_get_next_record() at ssl_msg.c:4,551 mbedtls_ssl_read_record() at ssl_msg.c:3,817 mbedtls_ssl_read() at ssl_msg.c:5,237 <...more frames...> 下面是定义了MBEDTLS_USE_PSA_CRYPTO的 SDK 25.12 的调用堆栈。在该版本中,mbedtls_internal_aes_encrypt全部是 C 代码,没有硬件加速。 mbedtls_internal_aes_encrypt() at aes.c:894 mbedtls_aes_crypt_ecb() at aes.c:1,062 aes_crypt_ecb_wrap() at cipher_wrap.c:166 mbedtls_cipher_update() at cipher.c:611 gcm_mask() at gcm.c:546 mbedtls_gcm_update() at gcm.c:641 mbedtls_gcm_crypt_and_tag() at gcm.c:726 mbedtls_gcm_auth_decrypt() at gcm.c:753 mbedtls_psa_aead_decrypt() at psa_crypto_aead.c:270 psa_driver_wrapper_aead_decrypt() at psa_crypto_driver_wrappers.h:4,114 psa_aead_decrypt() at psa_crypto.c:5,023 mbedtls_ssl_decrypt_buf() at ssl_msg.c:1,625 ssl_prepare_record_content() at ssl_msg.c:4,093 ssl_get_next_record() at ssl_msg.c:5,068 mbedtls_ssl_read_record() at ssl_msg.c:4,323 mbedtls_ssl_read() at ssl_msg.c:5,983 <...more frames...> 下面是 SDK 25.12 的调用堆栈,其中没有mbedtls_use_psa_crypto定义的调用堆栈。在这个版本中, mbdtls_internal_aes_encrypt全部是 C 代码,没有硬件加速,也不涉及 PSA。 mbedtls_internal_aes_encrypt() at aes.c:899 mbedtls_aes_crypt_ecb() at aes.c:1,062 aes_crypt_ecb_wrap() at cipher_wrap.c:166 mbedtls_cipher_update() at cipher.c:611 gcm_mask() at gcm.c:546 mbedtls_gcm_update() at gcm.c:628 mbedtls_gcm_crypt_and_tag() at gcm.c:726 mbedtls_gcm_auth_decrypt() at gcm.c:753 mbedtls_cipher_aead_decrypt() at cipher.c:1,528 mbedtls_cipher_auth_decrypt_ext() at cipher.c:1,674 mbedtls_ssl_decrypt_buf() at ssl_msg.c:1,639 ssl_prepare_record_content() at ssl_msg.c:4,093 ssl_get_next_record() at ssl_msg.c:5,068 mbedtls_ssl_read_record() at ssl_msg.c:4,323 mbedtls_ssl_read() at ssl_msg.c:5,983 <...more frames...> 是否有计划在 mbedTLS 中恢复 RT685 HASHCRYPT 硬件加速?某些 PSA Crypto 驱动程序似乎未被执行。 谢谢! Re: RT685: SDK 25.12 no HASHCRYPT acceleration 嗨,埃德温、 我在 EVK 上重现了这个问题。我修改了两个样本,在其中添加了一个迭代 200 次的循环 mbedtls_gcm_self_test 并使用 RTC 时钟为整个执行过程计时。 evkmimxrt685_mbedtls_selftest_cm33 执行测试的时间为 1087ms 使用此调用栈: HASHCRYPT_AES_EncryptEcb() at fsl_hashcrypt.c:1,260 mbedtls_internal_aes_encrypt() at aes_alt.c:1,959 mbedtls_aes_crypt_ecb() at aes_alt.c:1,323 aes_crypt_ecb_wrap() at cipher_wrap.c:114 mbedtls_cipher_update() at cipher.c:521 mbedtls_gcm_starts() at gcm.c:294 mbedtls_gcm_crypt_and_tag() at gcm.c:452 mbedtls_gcm_self_test() at gcm.c:826 evkmimxrt685_mbedtls3x_psatest_cm33 执行测试的时间为 8990ms 使用此调用栈: mbedtls_internal_aes_encrypt() at aes.c:896 mbedtls_aes_crypt_ecb() at aes.c:1,062 aes_crypt_ecb_wrap() at cipher_wrap.c:166 mbedtls_cipher_update() at cipher.c:611 mbedtls_gcm_starts() at gcm.c:441 mbedtls_gcm_crypt_and_tag() at gcm.c:718 mbedtls_gcm_self_test() at gcm.c:1,075   evkmimxrt685_mbedtls3x_psatest_cm33 来自 SDK 25.12 的 mbedtls_psa_accel_key_type_aes 定义的测试执行时间为 8744ms 使用此 callstack: HASHCRYPT_AES_EncryptEcb() at fsl_hashcrypt.c:1,255 hashcrypt_cipher_encrypt() at mcux_psa_hashcrypt_common_cipher.c:187 psa_driver_wrapper_cipher_encrypt() at psa_crypto_driver_wrappers.h:2,353 psa_cipher_encrypt() at psa_crypto.c:4,766 mbedtls_block_cipher_encrypt() at block_cipher.c:177 mbedtls_gcm_starts() at gcm.c:439 mbedtls_gcm_crypt_and_tag() at gcm.c:718 mbedtls_gcm_self_test() at gcm.c:1,075 对示例的修改要点如下: BOARD_InitHardware(); test_rtc_init(); psa_crypto_init(); uint64_t ms_start = test_rtc_get_msecs(); for (int i = 0; i < 200; ++i) { PRINTF("test iteration %d\r\n", i+1); mbedtls_gcm_self_test(0); } uint64_t ms_end = test_rtc_get_msecs(); PRINTF("test time = %ums\r\n", (unsigned)(ms_end - ms_start)); ... 其中test_rtc_get_msecs使用亚秒精度返回当前 RTC 时间。 正如您所看到的,使用新的 SDK 加密 GCM/AES 的速度慢了约 8 倍。 如果您需要,我可以附上修改后的示例。 问候, Amilcar Re: RT685: SDK 25.12 no HASHCRYPT acceleration 嗨,埃德温, 我们已经阅读了迁移指南。不过,我们看不出不带 PSA 的 mbedTLS 2.x 或 mbedTLS 3.x 如何在此版本的 SDK 中进行硬件加速。由于 aes_alt.c 已被删除,而 HASHCRYPT 功能仅由 PSA 驱动程序支持。 我们的应用程序在使用 SDK 25.12 时一切正常,我们当然希望在连接时使用 TLS 1.3,但现在的情况会让我们的性能大打折扣。 我们将继续调查此事。我将修改其中一个示例,看看能否重现性能损失。 问候, Amilcar Re: RT685: SDK 25.12 no HASHCRYPT acceleration 你好,@hrc-amilcar、 感谢您耐心解答这个问题。我刚刚收到内部团队的回复,请参见下文。 从调用堆栈中我可以看到,您使用的是传统的 mbedtls_xxx 加密 API。事实上,它并没有加速。MbedTLS3.x推出了新的加密应用程序接口,它就是 PSA。mbedtls/docs/psa-transition.md at v3.6.5 - Mbed-TLS/mbedtls - GitHub而且它还被加速了。 MbedTLS4.x 进一步删除了传统加密 API。 我检查了 RT600 SDK 中的 psa_crypto_examples,通过定义PSA_CRYPTO_DRIVER_HASHCRYPT,HASHCRYPT硬件加速在默认情况下是启用的,这使得加密驱动程序封装器可以将加密计算卸载到硬件上。另一方面,MbedTLS3.x+ 更为复杂,也更符合 PSA API 规范,因此可能会出现某些用例性能较低的情况。对于 TLS,我认为非对称加密技术(CASPER 硬件 IP)会成为性能瓶颈,因为该 IP 只能支持少量加速,而且与 PSA API 不兼容,后者希望硬件 IP 实现整个算法。我们已尽全力至少加速了部分 ECC 操作(签名、验证),但其他操作(如 ECDHE 密钥交换过程中的密钥生成)可能会更糟。 现在,如果您能使用 PSA API 进行性能测量,并确认 PSA_CRYPTO_DRIVER_HASHCRYPT 已定义且调用栈使用了它,那将是一件好事。仅供参考:Hashcrypt本身没有提供AES-GCM加速,因此最好对AES-密码块链接(CBC)或AES-CTR进行基准测试,以查看硬件IP的实际收益。 BR, Edwin. Re: RT685: SDK 25.12 no HASHCRYPT acceleration 你好,@hrc-amilcar、 从mbedTLS 2.x(不含 PSA)迁移到 mbedTLS 3.x(含 PSA)必然会导致性能下降: " PSA 驱动程序接口仅部分实现。因此,编写驱动程序的交付内容以及将驱动程序与 Mbed TLS 集成的方法将根据所加速的操作而有所不同。"(https://mcuxpresso.nxp.com/mcuxsdk/latest/html/middleware/mbedtls3x/docs/psa-driver-example-and-guide.html) 目前,我所能推荐的最好方法是遵循如何正确从 2.x 迁移到 3.x 的指南:从 Mbed TLS 2.x 迁移到 Mbed TLS 3.0 - MCUXpresso SDK 文档 以及正确过渡到 PSA API 的指南:过渡到 PSA API - MCUXpresso SDK 文档 不便之处,敬请原谅。 BR, Edwin. Re: RT685: SDK 25.12 no HASHCRYPT acceleration 我在 mbedTLS 配置文件中定义了 MBEDTLS_PSA_ACCEL_KEY_TYPE_AES,现在它正在调用 ASHCRY PT,但是我们的 mbedtls_ssl_read 读取速度现在更慢了。我想知道是否还有其他缺失的定义,或者PSA层增加了额外的开销。   通过 TLS 插口从 WiFi 下载 4KB 数据包的速率: SDK 25.09:205KB/秒(没有 PSA 和 ksdk 端口文件的 mbedTLS 2.x) SDK 25.12:138KB/秒(不带 MBEDTLS_PSA_ACCEL_KEY_TYPE_AES) SDK 25.12:125KB/秒(使用 MBEDTLS_PSA_ACCEL_KEY_TYPE_AES 时) 下面是使用 MBEDTLS_PSA_ACCEL_KEY_TYPE_AES 的新调用栈: HASHCRYPT_AES_EncryptEcb() at fsl_hashcrypt.c:1,255 hashcrypt_cipher_encrypt() at mcux_psa_hashcrypt_common_cipher.c:203 psa_driver_wrapper_cipher_encrypt() at psa_crypto_driver_wrappers.h:2,353 psa_cipher_encrypt() at psa_crypto.c:4,766 mbedtls_block_cipher_encrypt() at block_cipher.c:177 gcm_mask() at gcm.c:543 mbedtls_gcm_update() at gcm.c:628 mbedtls_gcm_crypt_and_tag() at gcm.c:726 mbedtls_gcm_auth_decrypt() at gcm.c:753 mbedtls_psa_aead_decrypt() at psa_crypto_aead.c:270 psa_driver_wrapper_aead_decrypt() at psa_crypto_driver_wrappers.h:4,114 psa_aead_decrypt() at psa_crypto.c:5,023 mbedtls_ssl_decrypt_buf() at ssl_msg.c:1,625 ssl_prepare_record_content() at ssl_msg.c:4,093 ssl_get_next_record() at ssl_msg.c:5,068 mbedtls_ssl_read_record() at ssl_msg.c:4,323 mbedtls_ssl_read() at ssl_msg.c:5,983 <...more frames...> Re: RT685: SDK 25.12 no HASHCRYPT acceleration 你好,@hrc-amilcar、 更新 SDK 后,您是否做了任何更改?您在使用 SDK 示例代码时也看到了这种行为吗?你使用的是独立组网 \\(SA\\) IDE 还是 VS Code 扩展? BR, Edwin. Re: RT685: SDK 25.12 no HASHCRYPT acceleration 你好,@EdwinHz、 我们使用的是 MCUXpresso 集成开发环境。 更新 SDK 后无额外更改: 当我们更新 SDK 时,我们会重新运行 " SDK 管理 "-> " 刷新 SDK 元器件 " 来获取新的和更新的文件。 然后,我们比较 .cproject配置为已启用类似功能的样本之一(例如evkmimxrt685_wifi_wpa_supplicant_cm33) psa_crypto_driver_casper=1 psa_crypto_driver_hashcrypt=1 config_wpa_supp_crypto_mbedtls_psa=1 等等 我们使用默认的mcux_mbedtls_config.h作为主要的 mbedTLS 配置头文件,并使用与evkmimxrt685_wifi_wpa_supplicant_cm33示例中的wpa_supp_mbedtls_config .h几乎相同的用户配置文件。 我将尝试使用 mbedtls3x_examples,看看它们的表现如何。也许我们漏掉了一些定义。 我在浏览代码时注意到,也许需要定义MBEDTLS_BLOCK_CIPHER_C,以便加速 gcm 操作。 看起来头文件mbedtls3x/include/mbedtls/config_adjust_legacy_crypto.h对此负有责任,但由于某些原因最终没有定义该宏。 Re: RT685: SDK 25.12 no HASHCRYPT acceleration 为了他人的利益... 看来 来自 mbedTLS 3.x 的 mbedtls_xor 一次循环遍历 4 字节的数据,并调用 mbed tls_get_unaligned_uint32 和 mbedtls_put_unalign ed_uint32, 它们都使用 memcp y 来处理单个 uint32。 我认识到 MbedTLS 的作者正试图通过一次计算 异或 4 字节块(使用余数循环)来提高性能,但是对 memcpy 的完整调用实际上使代码变慢。 在对反汇编进行一些调查后,我发现我们的项目在编译时使用了 -fno-builtin,导致编译器无法内联小的 memcpys。 移除该选项后,HASHCRYPT 硬件不用于 AES-GCM 操作所造成的性能损失基本得以恢复。因此,我发布的示例执行时间从 8600 毫秒缩短到 2100 毫秒。还没有达到 mbedTLS 2.x + ksdk alt(1087ms)的水平。但修复后的性能已经足够好了。 -阿米尔卡
記事全体を表示
TapLinx Package Key & DESFire EV3 Default PICC Key Clarification I recently procured MIFARE DESFire EV3 cards and would like to confirm whether they use a known factory-default PICC master key (e.g. all-zero AES/2K3DES/DES), or if the key is card-vendor dependent. My intention is to verify this via the TapLinx Android sample application by authenticating to the PICC (KeyNo 0). However, to build the sample APK, a valid TapLinx packageKey must be defined in the code:   static final String packageKey = ""; Before proceeding with building the test app, could you please confirm: Whether there is a documented default PICC master key for DESFire EV3 cards, and How to generate or obtain the appropriate TapLinx packageKey for my application. Thank you for your guidance. Code examples Example code Getting Started Licensing Re: TapLinx Package Key & DESFire EV3 Default PICC Key Clarification Hello, Thank you for your interest in our products. As you may already know, MIFARE DESFire is a restricted product and requires to have an NDA in order to get further information. My recommendation is to please contact any of our Distributors. Answering your second question, please take a look at the TapLinx site: TapLinx SDK for MIFARE, NTAG, ICODE and UCODE | NXP Semiconductors In the Documentation section, you will find the relevant User Guide for your development platform. Each document explains how to create your own user and register your application.
記事全体を表示
S32K344 悬挂问题 MCU:S32K344 OS:FreeRTOS S32Design Studio:3.4.3 问题:MCU 因 I2C 写阻塞(无超时)而挂起 嗨,团队、 我们正在使用基于 S32K344 MCU 的定制板。我们面临的问题是,在某些I2C错误状态下,MCU在运行时挂起。 我们有一个通过 I2C 接口连接的 IMU 从属设备。偶尔,当 IMU没有供电,或 I2C 写入操作失败(例如,没有 ACK /总线卡住), I2C 写入 API不会返回或进入超时状态。结果,执行 I2C 事务的 FreeRTOS 任务被无限期地卡住,最终导致应用程序挂起。 意见: 当从机没有响应或总线保持在低电平时,就会出现问题。 I2C 驱动程序似乎阻塞,等待传输完成。 在 RTOS 或驱动程序级别上不会触发超时或恢复机制。 请求支持: 如何在 S32K344 上添加或强制执行I2C 事务超时? 有没有推荐的方法来恢复卡住的 I2C 总线(SDA/SCL 保持在低电平)? 在 S32K3 设备上的 FreeRTOS 下安全使用 I2C 的最佳做法是什么? 恩智浦是否有稳健处理这种情况的驱动程序配置或示例? 任何指导或参考将不胜感激。 谢谢& , Vinay Re: S32K344 Hanging issue 嗨,@vinaykl、 你的 RTD 已经很老了。 有什么原因吗? 从 RTD 2.0.0 到当前的 RTD 7.0.0,已经修复了许多错误。 我猜您使用的是 I2C 驱动程序的阻塞 API。 请使用异步传输 API 以及 GetStatus() 和超时。 如果从设备一直将 SDA 保持在较低水平,则可以将其恢复,请参阅 I2C 用户手册: 第 3.1.16 节总线畅通 https://www.nxp.com/docs/en/user-guide/UM10204.pdf   RTD 驱动程序没有用于恢复的 API。 AN4803 中的一个例子 I2C 恢复功能定义 https://www.nxp.com/docs/en/application-note/AN4803.pdf 此致, 丹尼尔
記事全体を表示
Kernel Deadlock When VPP Crashes on LX2160A (LSDK‑20.05, VPP 22.06, DPDK 21.11) Dear NXP Support, We are seeing a kernel deadlock when VPP crashes on our LX2160A‑based custom hardware. Below are our environment details and the observed behavior. 1. System and Software Versions SoC / Board: LX2160A, custom hardware Data plane: DPDK + VPP LSDK: 20.05 Kernel: 4.19.90-rt35 MC firmware: 10.36.0 VPP: 22.06 DPDK: 21.11 2. DPAA2 Interface Mapping dprc.1/dpni.7 (interface: eth4, end point: dpmac.3) dprc.1/dpni.1 (interface: eth1, end point: dpmac.4) dprc.1/dpni.0 (interface: eth0, end point: dpsw.0.1) dprc.1/dprc.3/dpni.6 (end point: dpmac.9) dprc.1/dprc.3/dpni.5 (end point: dpmac.7) dprc.1/dprc.3/dpni.4 (end point: dpmac.8) 3. VPP LCP and TAP/TUN Configuration VPP LCP is creating TAP pairs (tap1/N3, tap2/cu, tap3/cu2). itf-pair: [0] TenGigabitEthernet0 tap1 N3 10 type tap itf-pair: [1] TenGigabitEthernet1 tap2 cu 11 type tap itf-pair: [2] TenGigabitEthernet2 tap3 cu2 12 type tap 4. Problem Description When VPP crashes or terminates abnormally: The vpp_main process enters uninterruptible sleep (D state). A kernel worker thread is blocked on rtnl_lock. ps -eo pid,stat,comm,args | grep vpp_main 21670 Dl vpp_main [vpp_main] ps -eo pid,comm,wchan | grep -E ip 9510 kworker/0:0+ipv rtnl_lock cat /proc/21670/stack [<0>] __switch_to+0xe8/0x150 [<0>] __flush_work.isra.13+0x134/0x248 [<0>] flush_work+0xc/0x18 [<0>] rollback_registered_many+0x1a8/0x560 [<0>] unregister_netdevice_queue+0x90/0x118 [<0>] __tun_detach+0x37c/0x390 [<0>] tun_chr_close+0x30/0x90 [<0>] __fput+0x8c/0x1b8 [<0>] ____fput+0xc/0x18 [<0>] task_work_run+0x90/0xb0 [<0>] do_exit+0x2b4/0x9a0 [<0>] do_group_exit+0x38/0xa0 [<0>] get_signal+0xac/0x5c8 [<0>] do_signal+0x80/0x2a8 [<0>] do_notify_resume+0xd0/0x110 [<0>] work_pending+0x8/0x10 [<0>] 0xffffffffffffffff cat /proc/9510/stack [<0>] __switch_to+0xe8/0x150 [<0>] rtnl_lock+0x14/0x20 [<0>] addrconf_verify_work+0xc/0x20 [<0>] process_one_work+0x1e0/0x318 [<0>] worker_thread+0x40/0x440 [<0>] kthread+0x128/0x130 [<0>] ret_from_fork+0x10/0x18 [<0>] 0xffffffffffffffff how to fix it ! Re: Kernel Deadlock When VPP Crashes on LX2160A (LSDK‑20.05, VPP 22.06, DPDK 21.11) You could use Layerscape Linux Distribution POC Rev. 6.1.55_2.2.0 release. It integrates: DPDK v22.11 VPP v2302
記事全体を表示
LPC54018 クラッシュ問題 お客様は LPC54018J2M で問題を経験しています。 状況は次のように説明されます。 お客様が I2C 経由で Ether Back Up CODE ブロックに新しいバージョンをプログラムしてファームウェアを更新した後、再起動時に、BOOT CODE はまず Ether Back Up CODE に新しいファームウェアがあるかどうかを確認します。存在する場合、Ether CODE を上書きしてから実行します。 フラッシュメモリの配置 |-------------------------------------| 0x10000000 - 0x1000FFFF | ブートコード(64k) 10000| |-------------------------------------| 0x10010000 - 0x100fffff | イーサコード(960k) f0000| |-------------------------------------| 0x10100000 - 0x101effff | イーサバックアップコード(960k) f0000| |-------------------------------------| 0x101f0000 - 0x10200000 |予約済み(64k) 10000| |-------------------------------------| 少数のユニットでは、ファームウェアのアップデートが完了すると、一定期間ソフトウェアは正常に動作します。しかし、しばらくすると、コードが突然動かなくなってしまいました。このような場合、再プログラムや消去を試みてもシステムを回復することはできず、IC を交換する必要があります。 異常のある IC については、JTAG を使用してさらにテストを実行しました。最初は、サンプル コードをプログラムしても正常に実行されず、フラッシュ直後に IC が停止してしまいます。 お客様ソフトウェアの場合、ブート コードはフラッシュ メモリをチェックし、SPIFI 初期化中に停止します。 ただし、SDK_2.x_LPC54018J2M (バージョン 24.12) のサンプル コードを JTAG 経由でプログラムすると、IC は正常に動作し、その後のプログラミングも期待どおりに動作します。 異常な IC の場合、お客様コードを直接再プログラムしても正常な動作は回復しません。異常状態から回復するためには、まずサンプルコードをプログラムする必要があります。 お客様コードは現在、SDK 2.11 に基づいて開発されています。 正常な動作を復元するサンプルコードは SDK 24.12 からのものです。 可能であれば新しいバージョンにアップデートすることをお客様に提案しましたが、これには時間がかかる可能性があります。 したがって、ここでは、この問題の原因が SDK のバージョンに関連しているのか、メモリ構成を調整する必要があるのかについて説明します。 現在、JTAG 経由でデバイスを回復することは可能ですが、この問題の発生を完全に防ぐ方法を見つけたいと考えています。 LPC54xxx Re: LPC54018 Crash Issue こんにちは@ZRay ご投稿ありがとうございます! これはLPC54XXデバイスのエラッタに関連している可能性があり、エラッタシートLPC540xx_LPC54S0xxの機能的問題の説明3.8 ROM.1に記載されています。ブート失敗時にペリフェラルピンが構成または駆動されたままになります。 また、 MCUXpresso SDK リリース ノートを確認することをお勧めします。また、常に利用可能な最新バージョンの SDK を使用することをお勧めします。 あなたが言及したサンプル コードではピン構成が実行されましたか?
記事全体を表示
无法调试 i.mxrt1064 自定义板。 您好, 在尝试以调试模式运行我的代码时,我收到"Break at address"0x20d102" with no debug information available" 信息。 我正在使用 i.mxrt1064 自定义板并使用 LinkServer LPC-Link2 进行编程。 这个主板以前可以正常工作了,但现在突然间,出现了这个消息。 我试过版本模式。我可以成功地用版本代码刷新我的主板,但是程序似乎无法运行。无论是从串行终端还是从显示屏,我都看不到任何输出。 我还尝试过使用安全配置工具对这个板进行编程,但它仍然无法正常工作。 有谁能帮助我们找到这个问题的重点或线索? Re: Unable to debug i.MXRT1064 custom board. 你好,MayLiu、 感谢您的回复。 早些时候,我确实按照你的建议尝试了这种设置,但在尝试调试时,集成开发环境提示错误(未能执行 MI 命令:-target-download)。我附上了该错误的快照供你参考。 回到上一条信息,我想补充的是,当我检查当前程序的执行地址时,显示代码位于 ROM 区域(地址 0x20E35A)。因此,不知何故,代码无法到达/启动应用程序代码,并被卡在 ROM 中。我的假设正确吗?会有这种情况吗? Re: Unable to debug i.MXRT1064 custom board. 你好@nxpsachve、 非常感谢您关注我们的产品并使用我们的社区。 1: 请尝试选择将应用程序链接到 RAM,然后重新调试。 如果您的应用程序可以从 RAM 成功运行,请将板设置为串行下载器模式,然后使用安全配置工具通过 UART1 或 USB1 对您的板进行编程。   如果你的应用程序无法运行,我建议你使用示波器来检查主板的开机顺序。   希望它能帮到你。 顺祝商祺! MayLiu Re: Unable to debug i.MXRT1064 custom board. Hi MayLiu, 感谢您的建议。 我想检查一下 MCUXpresso 中是否有任何可以改变或影响启动 Conf 的设置/配置?只是为了排除 IDE 的可能性。 在串行下载模式下,链接服务器能够检测目标。 Re: Unable to debug i.MXRT1064 custom board. 你好@nxpsachve、 感谢您提供的最新信息。 根据您提供的信息,CPU 当前可能正在执行来自启动 ROM 的代码,而不是您的应用程序代码。   我建议检查启动CFG和启动模式引脚设置,确保设备配置为从用户闪存启动。   你也可以尝试将板设置为串行下载器模式,然后通过J-Link进行连接以确认调试器是否可以检测到目标并与目标通信。   顺祝商祺! MatLiu Re: Unable to debug i.MXRT1064 custom board. 你好@nxpsachve、 我认为MCUXpresso IDE不会更改启动配置,恩智浦RT的启动行为由硬件启动配置和启动模式引脚决定。 由于可以在串行下载模式下检测到目标,这表明 ROM 仍在正常运行。下一步,您可以 执行全芯片擦除、 将板切换到内部启动模式,然后 尝试重新连接 MCUXpresso IDE 进行调试。 或者,您也可以使用 MCUXpresso 安全配置工具对应用程序映像进行编程。 顺祝商祺! MayLiu
記事全体を表示
RT1021 input max current Hello, do you know how much current a GPIO input can handle? I'm using GPIO_AD_B1_02 and 8mA are flowing through that pin. What is the maximum current an input can handle before damaging the pin? The pin is on it's default values, if I understood right it is configured as input with 100k pulldown resistor by default Thank you Re: RT1021 input max current Hi @jtrujillo, In general, the maximum current for any RT1xxx GPIO pin should be limited to 25mA whether it is sourcing or sinking current. This is the safe limit for the technology to prevent reliability issues, like latent damage due to electromigration, and can be sustained for long durations if the pin needs to. BR, Edwin.
記事全体を表示
单通道 ABS SB0401 监测模块问题 你好@nxp、 我使用的是 SB0401 单通道 ABS 模块 IC,其 SPI 主控芯片是恩智浦 S32K31xEVB-Q48 MCU。我每 10 毫秒传输一次监控/模块数据,但是 SB0401 监控模块似乎会重复 RESET/重启(大约每 50 毫秒一次)。与此同时,每次 SPI 传输时,我的 SPI "错误计数 "都会增加。 以下是设置和我的具体问题。 硬件/软件设置 MCU(SPI Master):s32k31xEVB-Q48(S32K31x 系列) 设备:SB0401(单通道 ABS 模块 IC) 接口:SPI (LPSPI)(基于 DMA 传输) 周期性传输:每 10 毫秒 观察到的问题:SB0401 监控模块每大约 50 毫秒 RESET/重启 一次(参见随附日志) 观察到的行为 每次传输 SPI 字节/字时,错误计数器都会增加。 我从 SB0401 报文 18 中读取 AR(种子),并根据 AR 计算 MR。 尽管定期发送帧,SB0401 监控模块仍会RESET。 问题 MR 计算与 AR 比较(信息 18) 每次 SPI 传输时,我的错误次数都会增加。 我使用从 SB0401 报文 18 中收到的 AR 值计算 MR。 在这种情况下,错误计数器是否会在每次传输时递增,还是表示 MR/AR 逻辑不正确? 请确认与 AR 相关的正确的 MR 计算流程/计时(消息 18)以及任何常见的陷阱(例如,使用过时的 AR、错误的字节/位提取、定时窗口、计数器对齐)。 写入报文 0 时的 ACK 位置 如果我将数据写入 信息 0在 TxBuf[0]我应该在哪里检查确认? 举例说明:对于写入 TxBuf[0]中,ACK 是否出现在 RxBuf[0](同一字)中,还是在 RxBuf[1](下一个字)? 如果定义了 "ACK 出现在下一个 SPI 字/帧中 "的规则,请分享确切的映射。 参考 SW / CDD 驱动程序 是否有任何用于 SB0401(C 源代码或 AUTOSAR 风格的 CDD 集成)的参考 CDD / 示例驱动程序可供共享以获取指导? 如果不可共享,你能推荐官方的 SB0401 软件包/应用说明/参考实现细节吗? Re: Single channel ABS SB0401 Monitoring Module Issue HI 是否可以在这里显示您的公司和项目信息? Re: Single channel ABS SB0401 Monitoring Module Issue 你好@guoweisun 好的。 公司: Ettiksoft technologies Pvt ltd: Ettiksoft technologies Pvt ltd. 项目: 两轮车单通道 ABS。 Re: Single channel ABS SB0401 Monitoring Module Issue 你好@guoweisun 好的 还有其他参考代码,比如这个模块的行为。 Re: Single channel ABS SB0401 Monitoring Module Issue 对于我无法在此发布的示例代码,您能否从案例端口提交票据? 家用 Re: Single channel ABS SB0401 Monitoring Module Issue 让我再次查看有关这个特殊部分的参考代码。 Re: Single channel ABS SB0401 Monitoring Module Issue 该部件没有 CDD 或其他软件驱动器,参考原理图也需要客户签署保密协议然后共享。
記事全体を表示
CSEc エラー S32K144 で CSEc を使用する場合、BOOT_DEFINE 中に KEY_INVAILD エラーが返されるのはいつですか? 答えが得られることを祈り、毎日幸せになることを祈っています! Re: CSEc Error こんにちは@xiaozhi BOOT_DEFINE 関数を呼び出すときにこのようなエラーが発生する理由がCANわかりません。この関数は、BOOT_MAC_KEY がまだプロビジョニングされていない場合でも呼び出すことができるため、キーは必要ありません。 よろしくお願いいたします。 ルーカス
記事全体を表示
imx95 low power mode I am working on a custom i.MX95 board running Linux 6.12 (Yocto-based). I am facing a suspend-to-RAM (deep sleep) failure related to the USB3 host controller. When executing echo mem > /sys/power/state, the system aborts suspend with xhci-hcd: WARN: xHC CMD_RUN timeout followed by PM: failed to suspend async: error -110. The issue occurs consistently when USB host mode is enabled, even with no active USB traffic. I am using a fixed 5V VBUS regulator controlled by a GPIO, and the USB3 controller, PHY, clocks, and power-domains are defined in the DTS (attached). My requirement is to fully power off USB VBUS during low power mode while allowing the system to enter deep sleep successfully. I have attached the full suspend/resume dmesg logs and the relevant USB-related DTS nodes for reference. I would like guidance on the correct DTS and/or driver-side handling required to avoid the xHCI suspend timeout on i.MX95. Re: imx95 low power mode In custom board iam using fusb302 but not enabled as usb3.0 , we are using it as usb2.0 . but when entering into deep sleep ( echo mem > /sys/power/state ) The error is occuring in xhci-hcd driver. Test Setup: • SoC: i.MX95 • OS: Yocto Linux (kernel 6.x, NXP BSP) • USB Mode: Host (xHCI, USB3) • Connected Device: USB flash drive (Mass Storage) Boot the board normally. Connect a USB storage device to the USB3 host port. Verify enumeration using lsusb and confirm device is accessible. Enter low power mode using: echo mem > /sys/power/state After this step itself it is showing error. Resume the system using the configured wake-up source (power button/ GPIO). After resume, observe that the USB device either: is not detected, or shows xHCI / DWC3 related errors in dmesg, or requires USB re-plug to work again. ERROR LOGS : echo mem > /sys/power/state [ 117.057281] PM: suspend entry (deep) [ 117.066009] Filesystems sync: 0.005 seconds [ 117.071209] Freezing user space processes [ 117.076800] Freezing user space processes completed (elapsed 0.001 seconds) [ 117.083781] OOM killer disabled. [ 117.087011] Freezing remaining freezable tasks [ 117.132725] Freezing remaining freezable tasks completed (elapsed 0.041 seconds) [ 117.140164] printk: Suspending console(s) (use no_console_suspend to debug) [ 117.156868] sd 0:0:0:0: [sda] Synchronizing SCSI cache [ 117.267552] xhci-hcd xhci-hcd.2.auto: WARN: xHC CMD_RUN timeout [ 117.267611] xhci-hcd xhci-hcd.2.auto: PM: dpm_run_callback(): platform_pm_suspend returns -110 [ 117.267631] xhci-hcd xhci-hcd.2.auto: PM: failed to suspend async: error -110 [ 117.267702] PM: Some devices failed to suspend, or early wake event detected [ 117.268017] hub 1-0:1.0: hub_ext_port_status failed (err = -108) [ 117.268044] usb usb1-port1: cannot disable (err = -108) [ 117.516365] PM: resume devices took 0.248 seconds [ 117.570639] OOM killer enabled. [ 117.573777] Restarting tasks ... done. [ 117.575261] sd 0:0:0:0: [sda] Test Unit Ready failed: Result: hostbyte=0x01 driverbyte=DRIVER_OK [ 117.578423] random: crng reseeded on system resumption [ 117.587117] sda: detected capacity change from 120164352 to 0 [ 117.598136] PM: suspend exit -sh: echo: write error: Connection timed out Re: imx95 low power mode Could you share us the details steps, that we can reporcuce it on our EVK Board? Thanks Re: imx95 low power mode Hi @kannappan , OK, we are going to have the New Year's Day holiday. when I back to office I will try it on our board and then give your reply. Wish you have a nice day Best Regards Rita Re: imx95 low power mode Hi @kannappan , Sorry for too busy this week, I will test it for you next week and share the result to you. Wish you have a nice day Best Regards Rita Re: imx95 low power mode HI @Rita_Wang , Is there any reply for the above issue. Best Regards Kannappan
記事全体を表示
spi 示例代码 你好,我正在研究恩智浦提供的名为 "Spi_Transfer_S32K312 "项目中的 spi 示例代码。我想知道代码中每个函数的含义,能否告诉我头文件的位置? Re: spi example code 你好@mingimin 头文件位于项目目录中的 RTD → include 下。 此外,我建议您阅读 S32K3/S32M27x SPI 驱动器集成手册和 RTD 随附的用户手册。这些文件提供了有关驱动程序的详细信息,包括其限制、硬件和软件要求、使用指南和配置说明。它们有助于深入了解驾驶员的行为和能力。 例如,您可以在以下路径找到这些资源: C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32K3\RTD\Spi_TS_T40D34M50I0R0\doc 请注意,具体路径可能因 S32DS 版本和安装目录而异。 BR、VaneB
記事全体を表示