Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
Micron MT35XU01GBBA on S32G399のFLSドライバーサポート NXPのエキスパートの皆様、こんにちは。 私はAUTOSARのソフトウェアエンジニアで、S32G399プラットフォームを扱っています。 私の理解では、 MX25UW51245GXDR00シリアルNORフラッシュはS32G-VNP-RDB3ボードに搭載されています。SW32G_RTD_4.4_5.0.0_QLP07に示されているFLSドライバの例はS32G-VNP-RDB3ボードのサポートを示しているため、NXP FLSドライバはこのMX25UW51245GXDR00デバイスで検証済みだと推測します。 最近、 Micron MT35XU01GBBA シリアルNORフラッシュを使用している顧客用ボードを受け取りました。 SW32G_RTD_4.4_5.0.0_QLP07に含まれるFLSドライバがMicron MT35XU01GBBAデバイスをサポートしているのか、教えていただけますか? サポートがある場合、MX25UW51245GXDR00からMT35XU01GBBAへの移行時に注意すべき特定の設定変更や制限はありますか? Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 本当にありがとうございます!! Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 こんにちは、 詳細を共有していただきありがとうございます。QSPIフラッシュをMX25UW51245GXDR00からMicron MT35XU01GBBAに移行する際に考慮すべき関連パラメータや要件、FLSドライバのサポート、必要な構成変更、潜在的な制限事項などをレビューします。 レビューが完了次第、詳細をご連絡いたします。 よろしくお願いいたします。 Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 全ての情報を確認する間、お待ちいただきありがとうございました。 既にご存知かもしれませんが、S32G-VNP-RDB3のサンプルで使用されているFLS構成はデバイス固有のものです。そのため、フラッシュID、メモリジオメトリ、ページサイズ、消去サイズ、コマンドLUT、アドレスサイクル、ダミーサイクル、リセットシーケンス、SPIモードとOPIモード間の遷移など、各デバイスごとに設定する必要のあるパラメータが含まれます。したがって、Macronixの構成はMicronデバイスに再利用できません。 考慮すべき主な相違点は以下のとおりです。 メモリサイズ:マクロニクスのデバイスは512Mbですが、MT35XU01GBBAは512Mbのダイを2つ積層した1Gbのデバイスです。したがって、FLSのアドレス範囲とメモリサイズをそれに応じて更新する必要があります。 インターフェースとタイミング:Micronデバイスは1.8V Xccelaインターフェースを使用し、オクタルSDR/DDR動作をサポートしています。DQS対応ではSDRで最大166 MHz、DDRで最大200 MHzまでサポートします。コントローラモード、DDR/SDR設定、DQSサンプリング、DLL/タイミングパラメータ、ダミーサイクルは、Micronデバイスおよび基板デザインに応じて設定する必要があります。 コマンドシーケンス:読み取り、プログラム、消去、レジスタアクセス、モード遷移のLUTは、Micronコマンドセット用に再作成する必要があります。例えば、Micron社のデバイスは8進数の読み出し/書き込みコマンドを使用し、4バイトのコマンドバリアントを別々に用意しています。これらはMacronix社のコマンドシーケンスとは異なります。 アドレッシングとジオメトリ:Micronデバイスは3バイトおよび4バイトアドレッシングをサポートしています。8進数DDRモードでは、4バイトのアドレス指定が必要です。Micronのデータシートには、256バイトのプログラムページ、128KBの均一セクタ消去、および4KB/32KBのサブセクタ消去オプションが記載されている。これらの値は、FLSのメモリおよびセクター構成に反映されなければなりません。 デバイス識別:期待されるJEDEC識別は異なります。Micronのデータシートには、1.8Vデバイスの場合、メーカーIDが0x2C、メモリタイプが0x5B、容量コードが1Gbの場合0x1Bと記載されています。FLSの読み取りIDシーケンスと期待されるデバイスIDは更新されなければなりません。また、正確な拡張IDはお客様ボード上の完全なご注文コードと照合する必要があります。 8進数DDRにおけるプログラミングの制限:Micronのデータシートには、8進数DDRプログラミングにおけるバス遷移の要件が規定されています。奇数の開始アドレスや終了アドレスはアラインメントや0xFFのパディングが必要な場合があるため、ページプログラムの処理は慎重に検証する必要があります。 リセットおよび起動状態:Micronのリセットシーケンスと、デバイスの揮発性/不揮発性構成レジスタを確認する必要があります。リセット後はコントローラとメモリが同じプロトコルとタイミングモードで起動しなければなりません。XIPまたはDDR起動を使用する場合、起動設定もMicronのご注文オプションと正確に一致しなければなりません。 内部で確認したところ、過去にMT35XU01GBBAは正常に使われていましたが、統合はLinux側で行われたため、ハードウェアペリフェラルがメモリをサポートしていることは保証できます。ただし、FLSドライバに特別な懸念があるかどうかは確認する必要があります。この件については社内チームにエスカレーションしました。回答が得られ次第、共有いたします。 参考までに: AN13563:S32G QuadSPIディープダイブ:AN13563:S32G QuadSPIディープダイブ – アプリケーションノート S32G QSPI NORカスタマイズガイド: S32G QSPI Norカスタマイズドキュメント 1Gbit Micron MT35XU01GBBAに対するUBOOT/Linux BSPサポート:https://community.nxp.com/t5/S32G-Internal-Community/gh-p/52149 よろしくお願いします、 アルド。 Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 あなたの情報はとても役に立ちます。ご支援ありがとうございます。 MT35XU01GBBAのために設定例を教えていただけますか?EB tresosプロジェクトでFlsモジュールを設定する際の参考資料として使用したいと考えています。 さらに、以下のリンクにアクセスできません。 UBOOT/Linux BSP対応の1Gbit Micron MT35XU01GBBA: https://community.nxp.com/t5/S32G-Internal-Community/gh-p/52149 関連する情報を共有していただくか、代替リンクを教えていただけませんか Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 こんにちは、クアンさん。 残念ながら、AUTOSARプロジェクト向けにEB tresosを通じてFLSモジュール内のMT35XU01GBBAメモリを有効にする構成例はありません。このデバイスはテストされていないことを確認しました。また、入手可能なRTD FIのデモでは、RDBボード上のMX25UW51245Gの設定のみを提供しています。 明確化のために言うと、内部のU-Boot/Linuxの議論は、同じフラッシュデバイスに対する一般的なBSPサポートの評価と、200MHzでのJEDEC ID読み取りを含むフラッシュプロービングの問題の調査に焦点を当てていました。これはEBトレソのAUTOSAR FLSモジュールのリファレンス実装や構成ではありませんでした。 そのため、現時点ではMT35XU01GBBAの参考例を提供することはできません。それでも、利用可能なデバイスドキュメントと現在のセットアップに基づいて開発と統合を進めることをお勧めします。 実装中に特定のエラーや予期せぬ動作が発生した場合は、詳細情報と関連するログまたは設定情報を共有してください。問題分析のお手伝いを喜んでさせていただきます。さらにサポートが必要な場合は、より専門的なサポートを提供できるよう、プライベートサポートチケットを開設してください。 ご迷惑をおかけして申し訳ございません。ご理解いただけますようお願い申し上げます。 よろしくお願いいたします、アルド Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 こんにちは、Aldo_Bucioさん。 第6.2節。RTD 2.0.0の「AN13563: S32G QuadSPI Deep Dive」のFLS例では、BootROMも外部フラッシュの初期化に関与しているのを見ていますが、後のアプリケーションで再びフラッシュをリセットするのも見られます。質問ですが、BootROMなしで外部フラッシュは正常に初期化できますか?BootROMがここでどのような役割を果たしているのか、私にはよく分かりません。 もしアプリケーションが直接起動するなら(外付けフラッシュから起動する必要はなく、アプリケーションをRAMに読み込んで実行します)、アプリケーションは独立して初期化や外部フラッシュを使ってデータを保存できるのですよね? Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 こんにちは、 この点について検討する間、お待ちいただきありがとうございました。続けて、主な違いはBootROM構成とFLSドライバ構成が異なる段階に適用されることです。 • BootROMは最初に実行されるソフトウェアです。その後、セキュアブートの場合はHSEファームウェアに、非セキュアブートの場合はカスタマーアプリケーションに制御を移します。(AN13456 — S32G3 ブートプロセス、セクション6、10ページ) ・QSPIブートには、QSPI再構成パラメータは必須ではありません。フラッシュがブート要件を満たしていれば、BootROMはこれらのカードなしでより低いインターフェース速度で起動可能です。これらのパラメータは起動時の通信を最適化するものであり、オプション項目は再構成であって、BootROM自体ではありません。(AN13456、第9節、15ページ) • RTD 2.0.0 FLSの例では、外部フラッシュをSPIモードにリセットし、その後フラッシュとQuadSPIコントローラの両方をOPI動作に設定します。(AN13563 — S32G QuadSPIディープダイブ、セクション6.2、30ページ) したがって、BootROMは自身の設定を使ってブートイメージにアクセスしますが、FLSドライバはアプリケーションからフラッシュを操作するために独自の設定を必要とします。BootROM互換性だけではMicron MT35XU01GBBAのFLSドライバーサポートは確立されません。さらに、AN13563の例はMacronix MX25UW51245Gを使用しているため、その構成がMicronデバイスに直接適用されるとは限りません。 私は引き続きこの捜査を支援し、追加の詳細事項についても検討する用意があります。 敬具 アルド 参考文献:  AN13456: S32G3 ブートプロセス アプリケーションノート AN13563:S32G QuadSPIディープダイブ – アプリケーションノート
View full article
S32G399 上的 Micron MT35XU01GBBA 的 FLS 驱动程序支持 各位NXP专家,大家好! 我是一名使用 S32G399 平台的 AUTOSAR 软件工程师。 据我了解, MX25UW51245GXDR00串行 或非 Flash 安装在S32G-VNP-RDB3板上。SW32G_RTD_4.4_5.0.0_QLP07中提供的 FLS 驱动程序示例表明支持 S32G-VNP-RDB3 板,因此我假设 NXP FLS 驱动程序已经通过 MX25UW51245GXDR00 设备的验证。 我最近收到一块客户的板,它使用的是Micron MT35XU01GBBA串行或非Flash。 请问SW32G_RTD_4.4_5.0.0_QLP07中包含的FLS驱动程序是否支持Micron MT35XU01GBBA设备? 如果有技术支持,从 MX25UW51245GXDR00 迁移到 MT35XU01GBBA 时,我应该注意哪些具体的配置更改或限制? Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 太感谢了!!! Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 您好, 感谢您分享详细信息。我将审查将 QSPI Flash 从 MX25UW51245GXDR00 迁移到 Micron MT35XU01GBBA 时需要考虑的相关参数和要求,包括 FLS 驱动程序支持、所需的配置更改以及任何潜在的限制。 我完成审查后会尽快回复您更多细节。 顺祝商祺! Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 感谢您在我查阅所有资料期间的耐心等待。 您可能已经知道,S32G-VNP-RDB3 示例使用的 FLS 配置是特定于设备的。因此,它包含了诸如闪存 ID、存储器几何形状、页面大小、擦除大小、命令 LUT、地址周期、虚拟周期、复位序列以及 SPI 和 OPI 模式之间的转换等参数,这些参数需要为每个设备进行配置。因此,Macronix 的配置不能重复使用于 Micron 的设备。 需要考虑的主要区别有: 内存容量:Macronix 设备为 512 Mb,而 MT35XU01GBBA 是 1 Gb 设备,由两个堆叠的 512 Mb 芯片实现。因此,FLS 地址范围和内存大小必须相应更新。 接口和时序:Micron 设备采用 1.8 V Xccela 接口,支持八路 SDR/DDR 操作。它在 SDR 模式下支持高达 166 MHz 的频率,在 DDR 模式下支持高达 200 MHz 的频率(带 DQS)。控制器模式、DDR/SDR 设置、DQS 采样、DLL/定时参数和虚拟周期必须根据 Micron 设备 and the board design 进行配置。 命令序列:必须为 Micron 命令集重新创建读取、编程、擦除、寄存器访问和模式转换 LUT。例如,Micron 设备使用八进制读取/编程命令,并有单独的 4 字节命令变体;这些与 Macronix 命令序列不同。 寻址和几何形状:Micron 设备支持 3 字节和 4 字节寻址。在八进制 DDR 模式下,需要 4 字节寻址。Micron 数据表规定了 256 字节的程序页、128 KB 的统一扇区擦除以及 4 KB/32 KB 的子扇区擦除选项。这些值必须反映在 FLS 内存和扇区配置中。 设备标识:预期的 JEDEC 标识有所不同。Micron 数据手册规定,1.8 V 设备的制造商 ID 为 0x2C,内存类型为 0x5B,1 Gb 的容量代码为 0x1B。必须更新 FLS 读取 ID 序列和预期设备 ID;还应根据客户板上的完整订购代码验证确切的扩展 ID。 八进制 DDR 的编程限制:Micron 数据手册规定了八进制 DDR 编程的偶数总线转换要求。奇数起始地址或结束地址可能需要对齐或 0xFF 填充,因此应仔细验证页面程序处理。 RESET 和启动状态:必须检查 Micron 复位序列和设备的易失性/非易失性配置寄存器。RESET后,控制器和存储器必须以相同的协议和定时模式启动。如果使用 XIP 或 DDR 启动,则启动配置也必须与 Micron 订购选项完全匹配。 值得一提的是,我已进行内部检查,MT35XU01GBBA 过去曾成功使用过,但是,集成是在 Linux 端完成的,因此我可以保证硬件外设支持该内存,但是,我需要检查 FLS 驱动程序是否存在任何特殊问题。我已经将此问题提交给内部团队,一旦收到他们的反馈,我会立即分享。 供参考,引用: AN13563:S32G QuadSPI 深度解析: AN13563:S32G QuadSPI 深度解析 – 应用笔记 S32G QSPI 或非 定制指南: S32G QSPI 或非 定制文档 UBOOT/Linux 电路板支持包 对 1Gbit Micron MT35XU01GBBA 的支持:https://community.nxp.com/t5/S32G-Internal-Community/gh-p/52149 此致, 阿尔多。 Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 您提供的信息非常有帮助。感谢您的支持。 请问能否提供MT35XU01GBBA的配置示例?我想在我的 EB tresos 项目中配置 Fls 模块时将其用作参考,引用。 此外,我无法访问以下链接: UBOOT/Linux 电路板支持包对 1Gbit Micron MT35XU01GBBA 的支持: https://community.nxp.com/t5/S32G-Internal-Community/gh-p/52149 请您分享相关信息或提供其他链接。 Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 你好,Quang, 遗憾的是,我们没有通过 EB tresos 在 AUTOSAR 项目中启用 FLS 模块中 MT35XU01GBBA 内存的配置示例。我们确认该设备未经测试,可用的 RTD FI 演示仅提供 RDB 板上 MX25UW51245G 的配置。 为明确起见,U-Boot/Linux 内部讨论的重点是评估对同一闪存设备的通用电路板支持包支持,并调查闪存探测问题,包括在 200 MHz 下读取 JEDEC ID。它不是 EB tresos 中 AUTOSAR FLS 模块的参考,引用实现或配置。 因此,我们目前无法提供 MT35XU01GBBA 的参考,引用示例。尽管如此,我们仍鼓励您根据现有的设备文档和您当前的设置继续进行开发和集成。 如果在实施过程中遇到任何具体错误或意外行为,请分享详细信息以及相关日志或配置信息。我们很乐意协助分析这个问题。如果您需要进一步的帮助,请提交私人支持工单,以便我们提供更有针对性的支持。 由此给您带来的不便,我们深表歉意,并感谢您的理解。 此致敬礼,阿尔多 Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 你好 Aldo_Bucio, 在第 6.2 节中。在 RTD 2.0.0 的 FLS 示例中(参见“AN13563:S32G QuadSPI 深度解析”),我看到 BootROM 也参与了外部闪存的初始化,但我发现后续应用程序会再次重新初始化闪存。我的问题是,如果没有 BootROM,外部闪存能否成功初始化?我不太明白 BootROM 在这里的作用。 如果我的应用程序在启动时直接运行(不需要从外部闪存启动,因为我将应用程序加载到 RAM 中并运行它),应用程序仍然可以独立运行以初始化并使用外部闪存来存储数据,对吗? Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 你好, 感谢您在我审查这一点期间的耐心等待。需要进一步说明的是,BootROM 配置和 FLS 驱动程序配置的关键区别在于它们适用于不同的阶段: • BootROM 是第一个执行的软件。然后,它将控制权移交给 HSE 固件以进行安全启动,或者移交给客户应用程序以进行非安全启动。(AN13456 — S32G3 启动过程,第 6 节,第 10 页) • QSPI 重配置参数对于 QSPI 启动并非强制性的。如果闪存满足启动要求,BootROM 可以在没有这些组件的情况下以较低的接口速度启动。这些参数优化了启动期间的通信;可选的是重新配置,而不是 BootROM 本身。(AN13456,第 9 节,第 15 页) • RTD 2.0.0 FLS 示例将外部闪存重置为 SPI 模式,然后将闪存和 QuadSPI 控制器配置为 OPI 操作。(AN13563 — S32G QuadSPI 深度解析,第 6.2 节,第 30 页) 因此,BootROM 使用其自身的配置来访问启动映像,而 FLS 驱动程序需要其自身的配置才能从应用程序操作闪存。仅 BootROM 兼容性并不能确定 Micron MT35XU01GBBA 是否支持 FLS 驱动程序。此外,AN13563 中的示例使用的是 Macronix MX25UW51245G,因此不应假定其配置直接适用于 Micron 设备。 我将继续配合这项调查,并审查任何其他细节。 此致, 阿尔多 参考: AN13456:S32G3 启动过程应用笔记 AN13563:S32G QuadSPI 深度解析 – 应用笔记
View full article
CodeWarrior License for MPC82xx Debug I have a need to debug a PowerQuicc MPC82xx processor in CodeWarrior for Power Architecture 8.8.x.  In looking around NXP site, the only option seems to be the very expensive CW-DS-NETAPPS license.  Is there anything less expensive that can be used for this?  I really just need to be able to Debug/JTAG via a TAP pod that I already have. Re: CodeWarrior License for MPC82xx Debug You can also download  Evaluation Edition(free-trial) from below link but it has 30-day time restriction Every customer account (email address) can download the Evaluation Edition from the link below. Please select “DOWNLOAD EVAL”. https://www.nxp.com/design/software/development-software/codewarrior-development-tools/codewarrior-network-applications/codewarrior-development-suites-for-networked-applications:CW-DS-NETAPPS Thanks
View full article
MCUの選択とディスプレイサイズは? 皆さんこんにちは。私は、地元の駅の公開APIを通じて、私の住む都市のリアルタイム列車データを取得する小さなプロジェクトに取り組んでいます。最終的にはこれをマイクロコントローラーで画面に表示し、壁に看板を貼りたいと思っています。おすすめのMCUやディスプレイはありますか?ディスプレイは大きめのものが欲しいです(できれば幅30cm以上)。これまでmBedや小型液晶ディスプレイ付きのArduinoしか扱ったことがないので、どんなご提案でも歓迎します。
View full article
MPC82xxデバッグ用CodeWarriorライセンス PowerQuicc MPC82xxプロセッサをCodeWarrior for Power Architecture 8.8.xでデバッグする必要があります。NXPのサイトを見回したところ、唯一の選択肢は非常に高価なCW-DS-NETAPPSライセンスのようです。これに使えるもっと安価なものはありますか?本当に必要なのは、すでに持っているTAPポッドを使ってデバッグやJTAGができるようになればいいだけです。 Re: CodeWarrior License for MPC82xx Debug また、以下のリンクから評価版(無料トライアル)をダウンロードすることもできますが、30日間の制限があります すべてのお客様のアカウント(メールアドレス)は、以下のリンクから評価版をダウンロードできます。 「評価版をダウンロード」を選択してください。 https://www.nxp.com/design/software/development-software/codewarrior-development-tools/codewarrior-network-applications/codewarrior-development-suites-for-networked-applications:CW-DS-NETAPPS よろしくお願いします。
View full article
MCU choice and Display size? Hello all, I'm working on a small project that gets my local station's real time train data for my city via their public API. I want to ultimately display this on a screen, via a micro controller and attach the sign to my wall. Do you have any MCU/display recommendations? I'm wanting the display to be on the larger side (maybe at least 30cm in width if possible). Open to any suggestions, as I've only worked with mBeds and Arduinos with rather small lcd displays before.
View full article
新组装的基于 i.MX8ULP 15 × 15 EVK 的 SOM 在 SDPS 启动时失败,并出现 LIBUSB_ERROR_NO_DEVICE (-4) 错误。 NXP社区的各位朋友,大家好! 我正在组装一个基于 i.MX8ULP EVK 15 × 15 设计的新 SOM。我使用了参考SOM,并将元器件组装到板上。 当尝试使用 UUU 刷写 Android 预构建镜像时,检测到处理器处于串行下载模式,但在初始SDPS: 启动命令期间操作失败。 软件环境 主机:Linux Android镜像包: android-14.0.0_2.2.0_image_8ulpevk 显示的 UUU 版本: libuuu_1.5.179-0-g02da3bf 目标存储介质:eMMC USB检测 跑步: uuu -lsusb 显示: Connected Known USB Devices Path Chip Pro Vid Pid BcdVersion 3:1 MX8ULP SDPS: 0x1FC9 0x014A 0x0001 主闪光尝试 我在 Android 镜像目录中运行了以下命令: sudo ./uuu_imx_android_flash.sh -f imx8ulp -a -e -t emmc -u trusty-dual 该脚本识别受支持的 Android 分区功能,生成 UUU 脚本,并调用 UUU。然后它报错: Success 0 Failure 1 HID(W): LIBUSB_ERROR_NO_DEVICE (-4) SDPS: boot -f u-boot-imx8ulp-evk-uuu.imx24274 上面的文件名与附图中的文件名一致。 其他尝试 我还尝试了: sudo uuu -b emmc u-boot-imx8ulp.imx 目前已知 UUU使用SDPS协议检测到处理器为MX8ULP 。 故障发生在初始启动映像下载期间。 捕获到的输出结果没有显示进入 Fastboot 或 eMMC 分区刷写阶段的进展。 我尚未确定故障是由图像/配置、USB 通信、板 RESET、电源时序还是组装问题引起的。 我还需要核对组装好的处理器、DDR内存和电源管理芯片的零件编号与参考物料清单是否一致。 问题 上述命令和trusty-dual映像变体是否适用于基于 i.MX8ULP 15 × 15 EVK 设计的新组装 SOM 的初始烧录? 对于在工厂 EVK 上已经完成的新组装元器件,是否需要任何初始配置步骤或 PMIC 配置要求? 在SDPS: 启动阶段,如何区分 USB 传输失败与 RESET 或启动映像执行失败? DDR配置不匹配是否会导致此阶段出现这种特定故障?哪些 UART 输出或其他证据可以帮助确定 DDR 初始化是否已完成? 硬件启动过程中,应该首先检查哪些电源轨、复位信号、时钟和启动配置信号? 在尝试完整刷写 Android 系统之前,是否有推荐的最小启动映像或诊断程序来检查初始启动和 DDR 运行情况? 谢谢! Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- 你好, 1.您的命令对于您的设计是正确的,trusty-dual 是一个有效的 Android 引导加载程序变体。 我建议你使用 -i 选项进行测试,因为它只会加载 U-Boot 并进入 Fastboot 模式: sudo ./uuu_imx_android_flash.sh -f imx8ulp -i 2. 不,它使用与 POR/冷复位相同的上电顺序。 3. 这两种情况下都会显示 LIBUSB_ERROR_NO_DEVICE 错误,即使板无法进入 fastboot 模式。 4. 不,这在现阶段应该不是问题,请使用 Cortex-A UART 调试端口。在这里你可以看到板是否能够进入fastboot模式。 5. 基本上,请检查所有上电顺序是否与文档一致,以及设计中的所有其他信号,包括晶振(晶体振荡器)中的正确时钟信号。 6.您可以尝试只刷入引导加载程序并进入 U-boot 模式。 sudo ./uuu_imx_android_flash.sh -f imx8ulp -i 顺祝商祺! Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- 你好,豪尔赫, 感谢您的回复和故障排除建议。 我尝试了您建议的仅针对 U-Boot 的命令: sudo ./uuu_imx_android_flash.sh -f imx8ulp -i 但是,操作仍然失败,我无法进入 U-Boot/Fastboot 系统。 我想澄清一下我组装的SOM与i.MX8ULP 15 × 15 EVK参考设计之间的以下区别: 参考 EVK PMIC: PCA9460AUK 我的SOM上安装的PMIC: PCA9460BUKZ 我的系统模块上安装的DDR内存: Micron MT53D512M32D1ZW 据我了解,MT53D512M32D1ZW 支持 LPDDR4 和 LPDDR4X 操作。我在使用 PCA9460BUKZ 时启用了两条配置路径,但我不太确定这是否是正确的配置。 我怀疑 PMIC 的型号或其配置可能是导致故障的原因,但我尚未证实这一点。请问您能否澄清以下问题? 该SOM能否使用PCA9460BUKZ而不是PCA9460AUK启动?这些PMIC型号之间的差异是否可以解释运行上述命令时出现的失败? 对于 MT53D512M32D1ZW,我应该只启用 LPDDR4 配置路径还是 LPDDR4X 配置路径?同时启用两条路径是否合适? 我应该预期24 MHz和32.768 kHz晶振的振荡器引脚上的电压等级是多少?我想在硬件启动过程中验证这些测量结果。 我应该使用哪个引导加载程序镜像来适配我的 PMIC 和 DDR 组合?我可以使用 android-14.0.0_2.2.0_image_8ulpevk 中的预编译镜像吗?还是需要定制镜像?请确认合适的镜像文件名,并说明trusty-dual版本是否仍然适用。 谢谢你的帮助。 Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- 大家好, 我在NXP i.MX开发板上运行Android系统时,遇到了持续的启动循环/启动失败问题。有趣的是,当我将标准的 Yocto 镜像刷入同一块板子时,它启动完全正常,没有任何问题。但是,切换到 Android 系统后,系统会在启动初期崩溃。 我已将完整的启动日志附在下方。请问有人可以帮我分析一下这个日志,指出哪里出了问题吗?我怀疑这可能与两个操作系统之间的分区表、U-Boot 环境变量或 AVB 配置差异有关,但我非常希望得到专家的指点。     谢谢!    
View full article
LPCLink 2 is not detected automatically by free master, detect procedure it the same for MCULINK ? Dear Support  I'm trying to connect LCPLink 2 to FreeMaster 3.2.7.5, with config string : (int=3;baddr=268439020;autoscan=1;laddr=0x10000000;haddr=0x10007fff;accto=40;respto=40;devid=0;dapid=0;DAP_Port=SW;DAP_SWJ=Y;DAP_Clock=1000000;), but LPCLInk 2  is not recognized However if: 1) I disconnect and reconnect LPCLINK to the USB than 2)  I lunch LinkerServer with the command C:\nxp\LinkServer_24.12.21>linkserver probes INFO: Booting LPC-LINK 2 probe # Description Serial Device Board --- -------------------------- -------- -------- ------- 1 LPC-LINK2 CMSIS-DAP V5.460 IWFWOTET I see that LPCLink 2 is detected, and only at this point FreeMaster is able to recognize LPCLink 2 A) Is the the proper way to detect LPCLink 2. B) Is it the same way in which MCULink work ? , I mean MCULink is automaticy detected by FreeMaster or I need to make it detectable by LinkServer ? Regards Paolo Re: LPCLink 2 is not detected automatically by free master, detect procedure it the same for MCULINK Dear Paolo, both MCU Link and LPC Link2 shall be detected as CMSIS-DAP device directly in FreeMASTER. Running the LinkServer shall not be needed. You just need to make sure the same device is not currently used by a debugger session. The CMSIS-DAP device cannot be shared by two client applications simultaneously. The LinkServer may act as a gateway for multiple clients, so in this case you could theoretically use FreeMASTER AND a debugger simultaneously, but we have not tested this setup thoroughly. Regards, Michal Re: LPCLink 2 is not detected automatically by free master, detect procedure it the same for MCULINK Dear All I found the problem. The LPCLink 2 had a JP1 open, so it was in boot mode. MCUXpresso and olso LinkServer are able to detect this situation an they send the CMSIS firmware in the LPC43xx RAM. Only after the this phase FreeMASTER is able to detect the probe. FreeMaster is not able to detect this situation, because it ha a generic driver for all CMSIS probe. I flashed the CMSIS firmware of the MCULink2 probe,  via LPCScrypt using the batch file program_CMSIS, and finally I reboot the LPCLink 2 after closing JP1. Everything work now Thanks
View full article
LPCLink 2 无法被自由主控自动检测到,MCULINK 的检测过程是否相同? 尊敬的客服人员 我正在尝试将 LCPLink 2 连接到 FreeMaster 3.2.7.5,配置字符串如下: (int=3;baddr=268439020;autoscan=1;laddr=0x10000000;haddr=0x10007fff;accto=40;respto=40;devid=0;dapid=0;DAP_Port=SW;DAP_SWJ=Y;DAP_Clock=1000000;), 但 LPCLink 2 无法识别 但是如果: 1)我断开并重新连接 LPCLINK 与 USB 的连接 2) 我使用以下命令启动 LinkerServer C:\nxp\LinkServer_24.12.21>linkserver 探针 信息:正在启动 LPC-LINK 2 探针 # 描述 串行设备板 --- -------------------------- -------- -------- ------- 1 LPC-LINK2 CMSIS-DAP V5.460 IWFWOTET 我看到检测到了 LPCLink 2,只有此时 FreeMaster 才能识别 LPCLink 2。 A) 这是检测 LPCLink 2 的正确方法吗? B) MCULink 的工作方式是否相同?我的意思是,FreeMaster 会自动检测到 MCULink,还是我需要让 LinkServer 检测到它? 问候 Paolo Re: LPCLink 2 is not detected automatically by free master, detect procedure it the same for MCULINK 亲爱的保罗, FreeMASTER 应直接将 MCU Link 和 LPC Link2 检测为 CMSIS-DAP 设备。无需运行 LinkServer。你只需要确保当前没有调试会话正在使用同一设备即可。CMSIS-DAP 设备不能同时被两个客户端应用程序共享。 LinkServer 可以作为多个客户端的网关,因此理论上您可以同时使用 FreeMASTER 和调试器,但我们尚未彻底测试此设置。 问候, 米哈尔 Re: LPCLink 2 is not detected automatically by free master, detect procedure it the same for MCULINK 各位 我找到问题所在了。LPCLink 2 的 JP1 端口已打开,因此处于启动模式。MCUXpresso 和 olso LinkServer 能够检测到这种情况,并将 CMSIS 固件发送到 LPC43xx RAM 中。只有经过这一阶段后,FreeMASTER 才能检测到探针。FreeMaster 无法检测到这种情况,因为它有一个适用于所有 CMSIS 探测器的通用驱动程序。我使用批处理文件 program_CMSIS 通过 LPCScrypt 将 MCULink2 探针的 CMSIS 固件刷写到 LPCLink 2 上,最后在关闭 JP1 后重新启动了 LPCLink 2。现在一切正常 谢谢!
View full article
Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (-4) Hello NXP Community, I am bringing up a newly assembled SOM based on the i.MX8ULP EVK 15 × 15 design. I used the reference SOM and had the components assembled onto the board. When attempting to flash the Android prebuilt images using UUU, the processor is detected in serial download mode, but the operation fails during the initial SDPS: boot command. Software environment Host: Linux Android image package: android-14.0.0_2.2.0_image_8ulpevk UUU version displayed: libuuu_1.5.179-0-g02da3bf Intended storage target: eMMC USB detection Running: uuu -lsusb shows: Connected Known USB Devices Path Chip Pro Vid Pid BcdVersion 3:1 MX8ULP SDPS: 0x1FC9 0x014A 0x0001 Main flashing attempt From the Android image directory, I ran: sudo ./uuu_imx_android_flash.sh -f imx8ulp -a -e -t emmc -u trusty-dual The script identifies the supported Android partition features, generates the UUU script, and invokes UUU. It then fails with: Success 0 Failure 1 HID(W): LIBUSB_ERROR_NO_DEVICE (-4) SDPS: boot -f u-boot-imx8ulp-evk-uuu.imx24274 The filename above is shown as it appears in the attached screenshot. Other attempts I also tried: sudo uuu -b emmc u-boot-imx8ulp.imx What is currently known UUU detects the processor as MX8ULP using the SDPS protocol. The failure occurs during the initial boot-image download. The captured output does not show progression to Fastboot or eMMC partition flashing. I have not yet established whether the failure is caused by the image/configuration, USB communication, a board reset, power sequencing, or an assembly issue. I still need to verify the exact assembled processor, DDR, and PMIC part numbers against the reference BOM. Questions Is the command above and the trusty-dual image variant appropriate for initial flashing of a newly assembled SOM based on the i.MX8ULP 15 × 15 EVK design? Are any initial provisioning steps or PMIC configuration requirements needed for newly assembled components that would already have been completed on a factory EVK? What is the recommended way to distinguish a USB transfer failure from a reset or boot-image execution failure at this SDPS: boot stage? Could a DDR configuration mismatch cause this particular failure at this stage? What UART output or other evidence would help determine whether DDR initialization has been reached? Which power rails, reset signals, clocks, and boot configuration signals should be checked first during hardware bring-up? Is there a recommended minimal boot image or diagnostic procedure for checking initial boot and DDR operation before attempting a complete Android flash? Thank you. Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- Hello, 1. Your command is correct for your design, and trusty-dual is a valid Android bootloader variant. I suggest you use the -i option to test because it only loads U-Boot and enters Fastboot: sudo ./uuu_imx_android_flash.sh -f imx8ulp -i 2. No, uses the same power-up sequence as POR/cold reset. 3. In both cases will show the LIBUSB_ERROR_NO_DEVICE error, even if the board is not able to inter in fastboot mode. 4. No, this should not be an issue at this stage, use the Cortex-A UART debug port. Here you can see if the board is not able to enter in fastboot mode. 5. Basically all, check the power-up sequence aligned with the documentation and all MISC signals in your design, including the correct clock signals in crystals/oscillators.  6. You could try flashing just the bootloader and enter to U-boot. sudo ./uuu_imx_android_flash.sh -f imx8ulp -i Best regards. Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- Hello Jorge, Thank you for your response and troubleshooting recommendations. I tried the U-Boot-only command you suggested: sudo ./uuu_imx_android_flash.sh -f imx8ulp -i However, the operation still fails, and I have not been able to reach U-Boot/Fastboot. I would like to clarify the following differences between my assembled SOM and the i.MX8ULP 15 × 15 EVK reference design: Reference EVK PMIC: PCA9460AUK PMIC installed on my SOM: PCA9460BUKZ DDR installed on my SOM: Micron MT53D512M32D1ZW My understanding is that the MT53D512M32D1ZW supports LPDDR4 and LPDDR4X operation. I enabled both configuration paths while using the PCA9460BUKZ, but I am unsure whether this is the correct configuration. I suspect that the PMIC variant or its configuration may be contributing to the failure, although I have not confirmed this. Could you please clarify the following? Can this SOM boot using the PCA9460BUKZ instead of the PCA9460AUK? Could the difference between these PMIC variants explain the failure when running the command above? For the MT53D512M32D1ZW, should I enable only the LPDDR4 or LPDDR4X configuration path? Is enabling both paths appropriate? What voltage levels should I expect at the oscillator pins associated with the 24 MHz and 32.768 kHz crystals? I would like to verify these measurements during hardware bring-up. Which exact bootloader image should I use for this PMIC and DDR combination? Can I use the prebuilt image from android-14.0.0_2.2.0_image_8ulpevk, or do I need a customized image? Please confirm the appropriate image filename and whether the trusty-dual variant remains suitable. Thank you for your assistance. Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- Hi everyone, I am experiencing a persistent boot loop/failure when trying to run Android on my NXP i.MX board. Interestingly, when I flash a standard Yocto image to the exact same board, it boots perfectly fine without any issues. However, switching over to Android causes it to crash during the early boot sequence. I have attached my complete boot log below. Could anyone help me analyze this log to point out what is failing? I suspect it might be related to partition tables, U-Boot environment variables, or AVB configuration differences between the two operating systems, but I would really appreciate an expert eye.     Thank you.    
View full article
LPCLink 2はフリーマスターによって自動的に検出されません。検出手順はMCULINKと同じですか? 親愛なるサポートへ LCPLink 2 を FreeMaster 3.2.7.5 に接続しようとしています。設定文字列は次のとおりです。 (int=3;baddr=268439020;autoscan=1;laddr=0x10000000;haddr=0x10007fff;accto=40;respto=40;devid=0;dapid=0;DAP_Port=SW;DAP_SWJ=Y;DAP_Clock=1000000;) しかし、LPCLInk 2は認識されません ただし、以下の場合は: 1) LPCLINKをUSBから切断して再接続すると、 2) LinkerServerを以下のコマンドで起動します C:\nxp\LinkServer_24.12.21>リンクサーバー プローブ 情報: LPC-LINK 2プローブを起動しています # 説明 シリアルデバイスボード --- -------------------------- -------- -------- ------- 1 LPC-LINK2 CMSIS-DAP V5.460 IWFWOTET LPCLink 2が検出されていることが確認でき、この時点でFreeMasterはLPCLink 2を認識できるようになります。 A) LPCLink 2を検出する適切な方法は何ですか。 B) MCULink の動作と同じ仕組みですか?つまり、MCULink は FreeMaster によって自動的に検出されるのでしょうか、それとも LinkServer で検出できるように設定する必要があるのでしょうか? よろしくお願いいたします パオロ Re: LPCLink 2 is not detected automatically by free master, detect procedure it the same for MCULINK 親愛なるパオロ、 MCU LinkおよびLPC Link2は、FreeMASTER内でCMSIS-DAPデバイスとして直接検出されます。LinkServerを実行する必要はありません。同じデバイスが現在デバッガーセッションで使用されていないことを確認するだけで済みます。CMSIS-DAPデバイスは、2つのクライアントアプリケーションで同時に共有することはできません。 LinkServerは複数のクライアントのゲートウェイとして機能する可能性があるため、理論的にはFreeMASTERとデバッガを同時に使うことも可能ですが、この構成は十分にテストしていません。 よろしくお願いいたします。 ミハル Re: LPCLink 2 is not detected automatically by free master, detect procedure it the same for MCULINK 親愛なるみんな 問題を発見しました。LPCLink 2はJP1が開いていたので、起動モードに入っていました。MCUXpressoとLinkServerは、この状況を検知し、CMSISファームウェアをLPC43xx RAMに送信します。この段階を経た後で初めて、FreeMASTERはプローブを検出できるようになります。FreeMasterはこの状況を検出できません。なぜなら、すべてのCMSISプローブに対して汎用ドライバを持っているからです。バッチファイル program_CMSIS を使用して LPCScrypt 経由で MCULink2 プローブの CMSIS ファームウェアをフラッシュし、最後に JP1 を閉じてから LPCLink 2 を再起動しました。すべて正常に動作しています よろしくお願いします。
View full article
新しく組み立てられた i.MX8ULP 15 × 15 EVK ベースの SOM が SDPS ブート時に LIBUSB_ERROR_NO_DEVICE (-4) エラーで失敗します。 こんにちは、NXPコミュニティの皆さん、 i.MX8ULP EVK 15 × 15デザインに基づく新たに組み立てたSOMを紹介します。私は参照用のSOM(構造測定図)を使用し、部品を基板上に組み立てました。 UUUを使ってAndroidのプリビルドイメージをフラッシュしようとすると、プロセッサはシリアルダウンロードモードで検出されますが、初期のSDPS: bootコマンド中に動作が失敗します。 ソフトウェア環境 ホスト:Linux Androidイメージパッケージ: android-14.0.0_2.2.0_image_8ulpevk 表示されたUUUバージョン: libuuu_1.5.179-0-g02da3bf 想定されるストレージターゲット: eMMC USB検出 実行中: uuu -lsusb 表示: Connected Known USB Devices Path Chip Pro Vid Pid BcdVersion 3:1 MX8ULP SDPS: 0x1FC9 0x014A 0x0001 メインの点滅試行 Androidのイメージディレクトリから、私は次のように実行しました: sudo ./uuu_imx_android_flash.sh -f imx8ulp -a -e -t emmc -u trusty-dual このスクリプトはサポートされているAndroidパーティション機能を識別し、UUUスクリプトを生成し、UUUを呼び出します。その後、以下のエラーが発生します。 Success 0 Failure 1 HID(W): LIBUSB_ERROR_NO_DEVICE (-4) SDPS: boot -f u-boot-imx8ulp-evk-uuu.imx24274 上記のファイル名は、添付のスクリーンショットに表示されているとおりです。 その他の試み 私も試してみました: sudo uuu -b emmc u-boot-imx8ulp.imx 現在分かっていること UUUはSDPSプロトコルを用いてプロセッサをMX8ULPとして検出します。 この障害は、最初のブートイメージのダウンロード中に発生します。 キャプチャされた出力には、FastbootやeMMCパーティションのフラッシュへの進行状況は示されていません。 故障の原因がイメージ/設定、USB通信、基板のリセット、電源供給シーケンス、または組み立て上の問題によるものなのか、まだ特定できていません。 まだ、正確な組み立て済みプロセッサ、DDRおよびPMIC部品番号を参考BOMと照らす必要があります。 質問 上記のコマンドと 信頼できるデュアル イメージバリアントは、i.MX8ULP 15 × EVK設計に基づく新たに組み立てられたSOMの初期フラッシュに適切でしょうか? 工場出荷時のEVKでは既に完了している初期プロビジョニング手順やPMIC構成要件を、新たに組み立てられたコンポーネントに対して行う必要はありますか? SDPSのブート段階で、USB転送の失敗とリセットまたはブートイメージ実行の失敗を区別するための推奨される方法は何ですか? DDRの設定ミスマッチがこの段階でこの特定の故障を引き起こす可能性はありますか?DDR初期化が完了したかどうかを判断するのに役立つUART出力やその他の証拠は何ですか? ハードウェアの起動時に、どの電源レール、リセット信号、クロック、およびブート構成信号を最初にチェックすべきでしょうか? 完全なAndroidフラッシュを試みる前に、初期起動とDDRの動作を確認するための推奨される最小限の起動イメージや診断手順はありますか? よろしくお願いします。 Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- こんにちは、 1.あなたのコマンドは設計に合っており、trusty-dualは有効なAndroidブートローダーのバリアントです。 -i オプションを使用してテストすることをお勧めします。このオプションは U-Boot をロードして Fastboot に入るだけです。 sudo ./uuu_imx_android_flash.sh -f imx8ulp -i 2. いいえ、POR/コールドリセットと同じ電源投入シーケンスを使用します。 3. どちらの場合も、fastbootモードでボードがインターチェンジできなくてもLIBUSB_ERROR_NO_DEVICEエラーが表示されます。 4. いいえ、この段階では問題ないはずです。Cortex-A UARTデバッグポートを使ってください。ここでは、fastbootモードでボードが入れないかどうかを確認できます。 5. 基本的にすべて、電源入力の順序をドキュメントに沿ったものと、デザイン内のすべてのMISC信号、クリスタルやオシレーターの正しいクロック信号も確認してください。 6.ブートローダーだけをフラッシュしてU-bootに入ってみるのも手です。 sudo ./uuu_imx_android_flash.sh -f imx8ulp -i よろしくお願いいたします。 Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- こんにちは、ホルヘさん。 ご回答とトラブルシューティングのご提案をありがとうございました。 あなたが提案してくれたU-Boot専用のコマンドを試してみました。 sudo ./uuu_imx_android_flash.sh -f imx8ulp -i しかし、操作は依然として失敗し、U-Boot/Fastbootにアクセスできていません。 組み立てたSOMとi.MX8ULP 15 × 15 EVKリファレンスデザインの違いについて、以下の点を明確にしたいと思います。 EVK PMICの型番: PCA9460AUK 私のSOMに搭載されているPMIC: PCA9460BUKZ 私のSOMに搭載されているDDRメモリ: Micron MT53D512M32D1ZW 私の理解では、MT53D512M32D1ZWはLPDDR4とLPDDR4X操作をサポートしています。PCA9460BUKZを使用している際に両方の設定パスを有効にしましたが、これが正しい設定かどうか確信が持てません。 PMICのバリアントまたはその構成が故障の原因となっている可能性が疑われますが、これはまだ確認できていません。以下の点を明確にしていただけますか? このSOMはPCA9460AUKではなくPCA9460BUKZで起動できますか? これらのPMICバリアントの違いが、上記のコマンドを実行した際の失敗の説明になるのでしょうか? MT53D512M32D1ZWの場合、LPDDR4だけを有効にするべきでしょうか、それともLPDDR4X設定パスを有効にしるべきでしょうか? 両方のパスを有効にするのは適切でしょうか? 24MHzおよび32.768kHzの水晶発振器に関連する発振器ピンでは、どのくらいの電圧レベルが期待できるでしょうか?ハードウェアの起動時にこれらの測定値を確認したいと考えています。 このPMICとDDRの組み合わせには、どの正確なブートローダーイメージを使うべきでしょうか?Android-14.0.0_2.2.0_image_8ulpevkのプリビルドイメージを使えますか?それともカスタマイズされたイメージが必要ですか?適切なイメージファイル名と、信頼できるデュアルバリアントが引き続き適しているかを確認してください。 ご協力ありがとうございました。 Re: Newly assembled i.MX8ULP 15 × 15 EVK-based SOM fails at SDPS boot with LIBUSB_ERROR_NO_DEVICE (- こんにちは、皆さん NXPの i.MX ボードでAndroidを動かそうとすると、持続的なブートループや失敗が発生しています。興味深いことに、標準のYoctoイメージをまったく同じボードにフラッシュすると、問題なく起動します。しかし、Androidに切り替えると初期起動時にクラッシュします。 以下に、起動ログ全体を添付しました。このログの解析を手伝って、何が故障しているのか教えていただけませんか?パーティションテーブル、U-Boot環境変数、または2つのオペレーティングシステム間のAVB構成の違いに関連しているのではないかと疑っていますが、専門家の意見をいただけると大変ありがたいです。     よろしくお願いします。    
View full article
MCU选择和显示屏尺寸? 大家好,我正在做一个小项目,通过公共 API 获取我所在城市的本地车站的实时列车数据。我最终想通过微控制器将此内容显示在屏幕上,并将标牌固定在墙上。您对MCU/显示器有什么推荐吗?我希望显示屏尺寸大一些(如果可能的话,宽度至少要30厘米)。欢迎提出任何建议,因为我之前只使用过带小型液晶显示屏的mBed和Arduino。
View full article
FLS Driver Support for Micron MT35XU01GBBA on S32G399 Hi NXP Experts, I am an AUTOSAR software engineer working with the S32G399 platform. From my understanding, the MX25UW51245GXDR00 serial NOR Flash is mounted on the S32G-VNP-RDB3 board. The FLS driver examples provided in SW32G_RTD_4.4_5.0.0_QLP07 indicate support for the S32G-VNP-RDB3 board, so I assume the NXP FLS driver has been validated with the MX25UW51245GXDR00 device. I have recently received a customer board that uses a Micron MT35XU01GBBA serial NOR Flash instead. Could you please clarify whether the FLS driver included in SW32G_RTD_4.4_5.0.0_QLP07 supports the Micron MT35XU01GBBA device? If support is available, are there any specific configuration changes or limitations that I should be aware of when migrating from the MX25UW51245GXDR00 to the MT35XU01GBBA? Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 Thank you so much!!! Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 Hi, Thanks for sharing the details. I will review the relevant parameters and requirements to consider when migrating the QSPI Flash from the MX25UW51245GXDR00 to the Micron MT35XU01GBBA, including FLS driver support, required configuration changes, and any potential limitations. I will get back to you with more details once I complete the review. Best regards. Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 Thank you for your patience while I reviewed all the information. As you may already know the FLS configuration used by the S32G-VNP-RDB3 example is device-specific. And thus includes parameters such as the flash ID, memory geometry, page size, erase size, command LUTs, address cycles, dummy cycles, reset sequence, and the transition between SPI and OPI modes that need to be configured for each device. Therefore, the Macronix configuration cannot be reused for the Micron device. The main differences to consider are: Memory size: The Macronix device is 512 Mb, whereas the MT35XU01GBBA is a 1 Gb device implemented with two stacked 512 Mb dies. The FLS address range and memory size must therefore be updated accordingly. Interface and timing: The Micron device uses the 1.8 V Xccela interface and supports Octal SDR/DDR operation. It supports up to 166 MHz in SDR and up to 200 MHz in DDR with DQS. The controller mode, DDR/SDR setting, DQS sampling, DLL/timing parameters, and dummy cycles must be configured according to the Micron device and the board design. Command sequences: The read, program, erase, register-access, and mode-transition LUTs must be recreated for the Micron command set. For example, the Micron device uses Octal read/program commands and has separate 4-byte command variants; these are different from the Macronix command sequences. Addressing and geometry: The Micron device supports 3-byte and 4-byte addressing. In Octal DDR mode, 4-byte addressing is required. The Micron data sheet specifies a 256-byte program page, 128-KB uniform sector erase, and 4-KB/32-KB subsector erase options. These values must be reflected in the FLS memory and sector configuration. Device identification: The expected JEDEC identification is different. The Micron data sheet specifies manufacturer ID 0x2C, memory type 0x5B for the 1.8 V device, and capacity code 0x1B for 1 Gb. The FLS read-ID sequence and expected device ID must be updated; the exact extended ID should also be verified against the full ordering code on the customer board. Programming limitation in Octal DDR: The Micron data sheet specifies even bus-transition requirements for Octal DDR programming. Odd start or end addresses may require alignment or 0xFF padding, so page-program handling should be verified carefully. Reset and startup state: The Micron reset sequence and the device's volatile/nonvolatile configuration registers must be checked. The controller and memory must start in the same protocol and timing mode after reset. If XIP or DDR boot is used, the boot configuration must also match the exact Micron ordering option. It is worth mentioning that I have checked internally and the MT35XU01GBBA has been used successfully in the past, however, the integration was done on the Linux side, thus I can assure the hardware peripheral supports the memory, however, I will need to check if there is any particular concern on the FLS driver. I have escalated this question to the internal team, I will share their feedback as soon as I receive it. For reference: AN13563: S32G QuadSPI Deep Dive: AN13563: S32G QuadSPI Deep Dive – Application note S32G QSPI NOR customization guide: S32G QSPI Nor customization doc UBOOT/Linux BSP support for 1Gbit Micron MT35XU01GBBA: https://community.nxp.com/t5/S32G-Internal-Community/gh-p/52149 Best regards,  Aldo. Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 Your information is very helpful. Thank you for your support. Could you please provide a configuration example for MT35XU01GBBA? I would like to use it as a reference when configuring the Fls module in my EB tresos project. Additionally, I am unable to access the following link: UBOOT/Linux BSP support for 1Gbit Micron MT35XU01GBBA: https://community.nxp.com/t5/S32G-Internal-Community/gh-p/52149 Could you please share the relevant information or provide an alternative link Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 Hi Quang, Unfortunately, we do not have a configuration example for enabling the MT35XU01GBBA memory in the FLS module through EB tresos for an AUTOSAR project. We confirmed that this device has not been tested, and the available RTD FIs demo only provides the configuration for the MX25UW51245G on the RDB board. For clarity, the internal U-Boot/Linux discussion was focused on evaluating general BSP support for the same flash device and investigating a flash-probing issue, including the JEDEC ID read at 200 MHz. It was not a reference implementation or configuration for the AUTOSAR FLS module in EB tresos. Therefore, we are unable to provide a reference example for the MT35XU01GBBA at this time. Nevertheless, we encourage you to proceed with your development and integration based on the available device documentation and your current setup. If you encounter any specific error or unexpected behavior during the implementation, please share the details and relevant logs or configuration information. We will be happy to help analyze the issue. If you need further assistance, please open a private support ticket so we can provide more focused support. We apologize for the inconvenience and appreciate your understanding. Best regards, Aldo Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 Hi Aldo_Bucio, in section 6.2. The FLS example from RTD 2.0.0 of "AN13563: S32G QuadSPI Deep Dive", i see that BootROM also contribute in initialize external flash, but i see that later application will reinit flash again. My question is without BootROM, can external flash is initialized successfully? I don't really understand the role of BootROM here. If my application runs directly at the start (not booting from external flash needed because i load the application to RAM and run it), application can still run independently for initializing and using external flash for storing Data, right? Re: FLS Driver Support for Micron MT35XU01GBBA on S32G399 Hi, Thank you for your patience while I reviewed this point. As a follow-up, the key distinction is that the BootROM configuration and the FLS driver configuration apply to different stages: • BootROM is the first software executed. It then transfers control to HSE firmware for secure boot or to the customer application for non-secure boot. (AN13456 — S32G3 Boot Process, Section 6, page 10) • QSPI reconfiguration parameters are not mandatory for QSPI boot. BootROM can boot without them at a lower interface speed, provided that the flash meets the boot requirements. These parameters optimize communication during boot; the optional item is the reconfiguration, not BootROM itself. (AN13456, Section 9, page 15) • The RTD 2.0.0 FLS example resets the external flash to SPI mode and then configures both the flash and the QuadSPI controller for OPI operation. (AN13563 — S32G QuadSPI Deep Dive, Section 6.2, page 30) Therefore, BootROM uses its configuration to access the boot image, whereas the FLS driver requires its own configuration to operate the flash from the application. BootROM compatibility alone does not establish FLS driver support for the Micron MT35XU01GBBA. In addition, the example in AN13563 uses the Macronix MX25UW51245G, so its configuration should not be assumed to apply directly to the Micron device. I remain available to continue supporting this investigation and to review any additional details. Best regards, Aldo References:  AN13456: S32G3 Boot Process Application Note AN13563: S32G QuadSPI Deep Dive – Application note
View full article
CodeWarrior MPC82xx 调试版许可证 我需要使用 CodeWarrior for Power Architecture 8.8.x 调试 PowerQuicc MPC82xx 处理器。在NXP网站上查找后,似乎唯一的选择是价格昂贵的CW-DS-NETAPPS许可证。有没有更便宜的替代方案?我只需要能够通过我已有的TAP pod进行调试/JTAG操作即可。 Re: CodeWarrior License for MPC82xx Debug 您也可以从以下链接下载评估版(免费试用版),但试用期为 30 天。 每个客户账户(电子邮件地址)均可通过以下链接下载评估版。 请选择“下载评估版”。 https://www.nxp.com/design/software/development-software/codewarrior-development-tools/codewarrior-network-applications/codewarrior-development-suites-for-networked-applications:CW-DS-NETAPPS 谢谢!
View full article
EMIOS counter bus configuration issue Hello experts, I configured .mex file for controller S32K342 with RTD 7.0.0. I am getting following error: I copied the configuration from S32K344 configuration with RTD 6.0.0 (because pin configuration and Peripherals configuration are same). I put all the counter bus correctly which we require. few screenshots for Emios_Mcl_Ip   Thanks. Re: EMIOS counter bus configuration issue Thank you for quick response. No, I did not copy entirely. I created new project with choosing 342 controller and copied the peripheral configurations. Not the whole project. Hope this helps. Thanks. Re: EMIOS counter bus configuration issue Thank you for the project. I copied the .mex file into one of my projects and, interestingly, I don't see any errors when generating code from it.. Could you please clarify what you mean by: "I copied the configuration from an S32K344 configuration with RTD 6.0.0"? Did you copy the .mex file from a project that was originally created with RTD 6.0.0? Regards, Daniel Re: EMIOS counter bus configuration issue Please the refer the configuration shared. Thanks. Re: EMIOS counter bus configuration issue Hello @sbidkar, Can you please share the .mex file? Thank you Re: EMIOS counter bus configuration issue Thank you, Daniel, for your response. I am using IDE version 3.6.4 BR. Re: EMIOS counter bus configuration issue Hi @sbidkar, Last time, I opened the .mex file in S32 Design Studio 3.6.9 with RTD 7.0.1, and the issue did not occur. When I tested it in S32 Design Studio 3.6.5 with RTD 7.0.0, I was able to reproduce the issue. Which IDE version are you using? I haven't found an existing report for this issue yet. I'll check with the IDE team and get back to you. Thank you, BR, Daniel Re: EMIOS counter bus configuration issue Hello Daniel, Any update on this? Re: EMIOS counter bus configuration issue Hi @sbidkar, Yes, this is the problem in RTD 7.0.0, fixed in RTD 7.0.1 Regards, Daniel
View full article
EMIOSカウンタバス構成の問題 こんにちは、専門家の皆様、 .mexを設定しましたRTD 7.0.0でコントローラ S32K342ファイルを作成しました。 以下のエラーが発生しています。 RTD 6.0.0のS32K344設定から設定をコピーしました(ピン構成とペリフェラル構成が同じため)。 必要なカウンターバスをすべて正しく設置しました。 Emios_Mcl_Ip のスクリーンショットをいくつか   ありがとうございます。 Re: EMIOS counter bus configuration issue 迅速なご対応ありがとうございます。 いいえ、完全にコピーしたわけではありません。342コントローラーを選択して新しいプロジェクトを作成し、ペリフェラルの設定をコピーしました。プロジェクト全体ではない。 これがお役に立てば幸いです。 ありがとうございます。 Re: EMIOS counter bus configuration issue プロジェクトをありがとうございました。 .mexファイルをコピーしましたファイルを私のプロジェクトの一つに取り込んでみたところ、興味深いことに、そこからコードを生成してもエラーは発生しませんでした。 「RTD 6.0.0のS32K344構成から設定をコピーした」というのはどういう意味か、もう少し詳しく教えていただけますか?.mexファイルをコピーしましたか?RTD 6.0.0で作成されたプロジェクトのファイルですか? よろしくお願いいたします。 ダニエル Re: EMIOS counter bus configuration issue 共有されている設定ファイルを参照してください。 ありがとうございます。 Re: EMIOS counter bus configuration issue こんにちは、 @sbidkar さん、 .mexファイルを教えていただけますかファイル? よろしくお願い申し上げます。 Re: EMIOS counter bus configuration issue こんにちは、 @sbidkar さん。 前回は.mexファイルを開いたS32 Design Studio 3.6.9のファイルRTD 7.0.1では、この問題は発生しませんでした。S32 Design Studio 3.6.5(RTD 7.0.0)でテストしたところ、問題を再現することができました。 どのIDEバージョンを使っていますか? この問題に関する既存の報告はまだ見つかっていません。IDEsチームに確認して、またご連絡します。 ありがとうございました。 BR、ダニエル Re: EMIOS counter bus configuration issue ダニエルさん、ご回答ありがとうございます。 私はIDEバージョン3.6.4を使っています BR。 Re: EMIOS counter bus configuration issue こんにちは、ダニエルさん。 この件について何か進展はありますか? Re: EMIOS counter bus configuration issue こんにちは、 @sbidkar さん。 はい、これはRTD 7.0.0の問題点です。RTD 7.0.1で修正済み よろしくお願いいたします。 ダニエル
View full article
GPIO 简介:如何读取微控制器 (MCX A153) 的引脚并控制 LED(日语博客) 目录 介绍 了解MCX A153微控制器的引脚配置 GPIO 使用设置 检查引脚与电路板(FRDM-MCXA153)之间的关系。 演示:执行 GPIO 设置并体验 LED 控制。 额外知识点:了解LED灯的“开/关”原理 附加题——如果将两个LED并联会发生什么?   介绍 作为嵌入式系统开发的初学者,我是在接到撰写一篇关于GPIO文章的邀请后开始学习它的。本文记录了我尝试点亮单个LED灯的过程中,通过反复试验所学到的知识和心得体会。 本文解释了如何使用 GPIO(通用输入/输出),它是微控制器开发中最基本的外部设备之一。 GPIO 是嵌入式系统的基础,用于将微控制器连接到外部电路,实现诸如打开 LED、读取开关状态和接收来自传感器的信号等功能。 另一方面,在实际的微控制器开发中,“使用GPIO”并不仅仅意味着编写程序。微控制器有许多引脚,每个引脚除了GPIO之外还被分配了其他功能,例如定时器和通信接口。 所以, 要使用 GPIO,您需要了解数据手册中的引脚分配和功能。 PinMUX(引脚复用)设置,用于将GPIO分配给引脚 输入/输出方向设置 这件事必须妥善处理。 这次,我们将以FRDM-MCXA153为例,研究 MCX A153 的引脚配置和 PinMUX 机制,使用 Pins Tool 配置 GPIO 设置,最后演示连接到面包板上的 LED 闪烁。   了解MCX A153微控制器的引脚配置 FRDM-MCXA153搭载了一颗型号为 MCXA153VLH 的微控制器。该微控制器采用 LQFP 64 封装,共有 64 个引脚。其中 52 个引脚可用作 GPIO。其余引脚包括电源引脚 (VDD/VSS)、USB 引脚和模拟输入引脚,这些引脚不能用作 GPIO。 然而,即使它标有“52个GPIO”,这并不意味着这52个引脚都专用于GPIO。许多可用于GPIO的引脚也与其他外设功能(例如UART、SPI、I²C和定时器)共享。因此,要真正将它们用作GPIO,您需要使用PinMUX函数将这些引脚配置为GPIO。 让我们从数据手册中查看MCX A153的引脚配置。从第54页开始列出了每个引脚可以分配的功能。 例如,查看引脚名称为 P1_8 的“引脚复用分配”信息,可以看到有六种可能的功能。GPIO 被分配到“ALT0 - P1_8”。其他分配包括“ALT2 - LPUART1_RXD”,表示它将被用作 UART 接收端 (RXD);以及“ALT3 - LPI2C0_SDA”,表示它将被用作 I²C 数据线 (SDA)。 如您所见,一个引脚可以分配给多个功能,不仅包括 GPIO,还包括 UART、I²C 和定时器。   GPIO 使用设置 1. 选择引脚功能(PinMUX) 如前文所述,P1_8 引脚有多种潜在功能,包括 GPIO、UART 和 I²C。但是,同一个引脚不能同时用作 GPIO 和 UART。 因此,典型的微控制器都配备了一种称为 PinMUX 的机制。 PinMUX 就像一个拨动开关,用于将单个物理引脚连接到内部外设。 例如,P1_8 有六个潜在的连接目标。通过使用 PinMUX 选择 GPIO,P1_8 即可用作 GPIO 引脚。 2. 设置引脚的电气特性。 引脚不仅可以配置其功能,还可以配置其电气特性。典型设置包括: • 引体向上 • 下拉 驱动力 明渠 以下是一些示例。例如,开关输入通常会启用上拉电阻,驱动 LED 或高速信号时可以调整驱动强度。即使用作 GPIO,也必须根据应用进行适当的电气设置。 本文将省略对这些电气特性的详细解释。 3. 设置 GPIO 的输入/输出方向。 最后一步是确定信号流的方向。GPIO 有两种主要的工作模式。 • 输入 – 接收来自外部的信号 • 输出 – 向外部发送信号 微控制器内部在输入输出方面究竟发生了什么? MCX A153 是一款工作电压为 3.3V 的微控制器。因此,其 GPIO 引脚基本上处理两种状态:低电平(约 0V)和高电平(约 3.3V)。A153 的工作电压范围为 1.71V 至 3.6V,FRDM 板使用 3.3V。 GPIO输出值 引脚电压 低(0) 大约 0V 高(1) 约3.3伏 例如,如果您将某个 GPIO 引脚设置为输出并连接一个外部 LED,将其设置为高电平(约 3.3V)会在 GPIO 引脚和 GND 之间产生电位差,从而允许电流流过 LED。将其设置为低电平(约 0V)会消除与 GND 之间的电位差,因此没有电流流过。换句话说,LED 的“闪烁”是由于 GPIO 引脚的电压在高电平 (1) 和低电平 (0) 之间反复切换,从而导致 LED 闪烁和熄灭交替发生。 另一方面,在输入模式下,微控制器会监控GPIO引脚的状态。例如,如果从外部电路输入约3.3V电压,则识别为高电平(1);如果输入约0V电压,则识别为低电平(0)。 上述引脚功能选择、电气特性设置和输入/输出设置均可通过 GUI 使用引脚工具(NXP 的免费配置工具中包含)进行配置。   检查引脚与电路板(FRDM-MCXA153)之间的关系。 到目前为止,我们已经了解到,要使用 GPIO,需要配置 PinMUX 设置和输入/输出方向设置。 接下来,让我们确认 FRDM-MCXA153 板上 MCU 引脚的连接位置,同时牢记我们将要进行的演示。 检查原理图,确认上一章中作为示例使用的引脚“P1_8”的布线位置。 查看电路图第 8 页,我们可以看到 P1_8 连接到 FRDM-MCXA153 上的Arduino 接头 J2 的 D18 。 FRDM-MCXA153原理图 那么,Arduino 接头 J2 上的 D18 在哪里呢? 接下来,我们来查阅一下电路板用户手册。 FRDM-MCXA153 开发板用户手册 第 6 页包含板上安装的连接器的示意图,这使我能够确定 Arduino 接头 J2 上的 D18 的位置。 在本练习中,我们将使用面包板上的 D18 引脚连接一个外部 LED。但是,如果您没有面包板或 LED,也可以使用 FRDM-MCXA153 开发板上自带的 RGB LED。 然而,有一点需要注意。当使用板载 RGB LED 时,LED 的阳极 (+) 连接到 VDD_BOARD (3.3V),阴极 (-) 连接到 GPIO。因此,与前面提到的外接 LED 不同,将 GPIO 设置为高电平 (1) 也会使 GPIO 电压达到约 3.3V,LED 两端的电位差几乎消失,导致 LED 熄灭。 另一方面,将 GPIO 设置为低电平 (0) 会在 LED 两端产生电位差,从而导致电流流动并使 LED 点亮。 当你检查电路图中的每个引脚时…… P3_12 是一个红色 LED P3_13 是一个绿色 LED P3_0 是一个蓝色 LED 它支持这些功能。通过配置引脚复用器 (PinMUX) 设置和输入/输出设置,您还可以使用板上的 LED 指示灯来验证其运行情况。 这样,您就可以使用电路图和电路板用户手册来检查微控制器内部的物理引脚在电路板上的连接位置。   演示:执行 GPIO 设置并体验 LED 控制。 在本章中,我们将使用 MCUXpresso 配置工具中的引脚工具来配置 GPIO 并控制面包板上外部连接的 LED。 演示中使用的设备: FRDM-MCXA153 面包板 LED • 电阻器和跳线 本演示将假设您已在 VS Code 环境中安装了 MCUXpresso SDK 和配置工具。 *如果您尚未安装 MCUXpresso SDK 和配置工具,请参阅此博客文章。 MCUXpresso 配置工具:引脚工具的使用方法(日语博客) 注意:虽然博客文章描述了 FRDM-MCXN947 的 SDK 安装,但本文中请安装 FRDM-MCXA153 的 SDK。 我手头有一个红色LED和一个绿色LED,但我不知道它们的型号,所以我先尝试点亮红色LED。我有一个390Ω的电阻。红色LED的正向电压(Vf)通常在1.8~2.2V之间,所以我假设它是2.0V,并计算流过LED的电流。 微控制器的工作电压为3.3V。Vf使用 2.0V 电压和 390Ω 电阻,可以根据欧姆定律计算电流值,如下所示。请注意,LED 具有规定的最大正向电流 (Ifmax),许多通用 LED 的 Ifmax 为 20mA。务必谨慎选择电阻值,因为超过 20mA 的电流可能会损坏 LED。 此外,GPIO引脚的输出电流也有限制。根据数据手册,MCX A153在正常工作状态下的电气特性是基于4mA电流(高驱动引脚为6mA)设定的。因此,当使用GPIO引脚直接点亮LED时,需要选择一个合适的电阻值,该电阻值不仅要考虑LED的电流限制,还要考虑GPIO引脚的电流限制。 电路板和面包板接线 首先,我们要进行线路连接。 在 FRDM 板上,我们将使用之前确定的 Arduino 接头 J2 上的“D18”和“14 GND” 。 下图是根据电路板用户手册绘制的。 FRDM-MCXA153 开发板用户手册 请参考以下视频了解接线说明。 (function() { var wrapper = document.getElementById('lia-vid-6405195304112w960h540r888'); 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'); }); }); }); } }})(); (显示我的视频) 导入示例代码 接下来,我们将从 FRDM-MCXA153 SDK 导入示例代码。 点击左侧面板中的“从存储库导入示例”。 在右侧显示的选项卡中,选择“存储库”下的导入的 FRDM-MCXA153 SDK,然后选择“板”下的 FRDM-MCXA153。 使用的模板是“driver_examples/gpio/gpio_led_output”。 选择所需的工具链,然后单击“导入”。 导入完成后,它将被添加到左侧面板的“项目”部分。 查看源代码 gpio_led_output.c。 这次,我们要使用引脚工具配置 GPIO 输入/输出设置,因此我们将从源代码中删除红色方框内包含的 GPIO 输出设置代码。 使用引脚工具配置GPIO设置。 接下来,打开配置工具。右键单击项目,然后选择“使用 MCUXpresso 配置工具打开”。稍等片刻,配置工具将启动。 打开配置工具后,首先在右侧面板的“概览”中选择“引脚”。 图钉工具现已打开。 启用引脚 P1_8。 点击 P1_8 将打开另一个窗口,如下图所示。在此窗口中找到“GPIO1:GPIO,8(P1_8)”,并勾选其旁边的复选框。 选中该复选框后,将出现以下窗口,但您可以单击“否”将其关闭。 完成这些步骤后,P1_8 将添加到引脚工具底部的布线详细信息中。 接下来,按如下方式更改 GPIO 输入/输出设置。 将输出端的引脚 #38 (P3_12) 连接到未指定端,将未指定端的引脚 #2 (P1_8) 连接到输出端。 GPIO #38 的初始状态将出现错误,请将其从逻辑 0 更改为 n/a。 完成这些步骤后,您就可以重写示例代码了。首先,点击“配置工具”屏幕左上角的“更新代码”。 此时会弹出一个窗口。您可以在这里根据需要查看代码更改。已修改的文件旁边会显示“更改”字样。 返回 VS Code 后,您会在屏幕顶部看到三个复选框。请确保选中它们,然后单击“确定”。 不久之后,源代码的修改就会完成。 接下来,我们将修改源代码 gpio_led_output.c 中的 GPIO 控制目标。 打开 gpio_led_output.c 文件时, 内容如下:   while (1) { delay(); GPIO_PortToggle(BOARD_LED_GPIO, 1u << BOARD_LED_GPIO_PIN); } 按如下方式修改 GPIO_PinInit() 和 GPIO_PortToggle() 的内容: 这里,P1_8 被指定为控制目标,每次调用该函数时,P1_8 的状态都会在高 (1) 和低 (0) 之间切换。 while (1) { delay(); GPIO_PortToggle(GPIO1, 1u << 8); } 更多详情:GPIO 引脚以 Px_y 格式表示,其中x为 GPIO 端口号, y为该端口内的位位置。例如, P1_8表示“GPIO 端口 1 的第 8 位”。 在代码中 GPIO_PortToggle(GPIO1, 1U << 8); 在, GPIO1 1U << 8 表示 GPIO 端口 1, 是一个位掩码,其中只有第 8 位设置为 1。 1U << 8 ↓ 0000 0001 0000 0000 (2進数) 这样就可以只反转(在高电平和低电平之间切换)GPIO 端口 1 中的第 8 位。 将 PC 连接到 FRDM-MCXA153。 调试(构建、编写和运行应用程序)。 调试过程完成后,程序将在断点处停止,因此请点击屏幕顶部的“|▶”图标。 LED灯将开始闪烁。 (function() { var wrapper = document.getElementById('lia-vid-6404528566112w304h540r105'); 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'); }); }); }); } }})(); (显示我的视频) 额外知识——了解 LED 的“开/关”状态 顺便问一下,这个LED灯何时亮起,取决于GPIO输出是高电平(1)还是低电平(0)?我之前提到过,当输出高电平(1)时它会亮起,但我们来验证一下是否正确。 以下是我们之前使用的代码。 `while(1)` 语句表示一个无限循环,重复执行花括号 {} 内的代码。 此外,delay() 函数用于等待特定时间段。GPIO_PortToggle() 是一个 GPIO 控制函数,用于反转高电平 (1) 和低电平 (0)。 while (1) { delay(); GPIO_PortToggle(GPIO1, 1u<<8); } } 但是,这段代码并没有告诉我们,当 LED 为高电平 (1) 或低电平 (0) 时,LED 是亮起还是熄灭。 因此,我们使用不同的函数 GPIO_PinWrite() 来显式控制 GPIO 的状态。 具体来说,代码将修改为在高电平 (1) 状态下等待一次 delay() 调用,然后在低电平 (0) 状态下等待五次 delay() 调用。这样应该能让 LED 保持熄灭状态更长时间。 while (1) { GPIO_PinWrite (GPIO1,8U ,1); delay(); GPIO_PinWrite(GPIO1,8U ,0); delay(); delay(); delay(); delay(); delay(); } 运行调试程序,然后点击屏幕顶部的“|▶”图标。 (function() { var wrapper = document.getElementById('lia-vid-6404528052112w304h540r114'); 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'); }); }); }); } }})(); (显示我的视频) 正如预期的那样,LED灯关闭了更长时间。 这使我们能够验证 LED 在点亮时输出高电平 (1),在熄灭时输出低电平 (0)。 总结一下,当 GPIO 为高电平 (1) 时,设置为 GPIO 引脚的 P1_8 处的电压约为 3.3V。该电压与 GND 之间形成电位差,导致电流流过电阻和 LED。此时,LED 两端施加正向电压(约 2.0V),剩余的约 1.3V 电压施加在电阻两端。因此,LED 点亮。 另一方面,当 GPIO 为低电平 (0) 时,P1_8 端的电压接近 0V。由于 GPIO 引脚与 GND 之间没有电位差,因此没有电流流过,LED 熄灭。 如果你觉得使用大量的 `delay()` 函数看起来很丑陋,你也可以使用循环函数。 while (1) { GPIO_PinWrite(GPIO1, 8U, 1); delay(); GPIO_PinWrite(GPIO1, 8U, 0); for (int i = 0; i < 5; i++) { delay(); } } 附加题——如果将两个LED并联会发生什么? 我尝试将手边的一个绿色LED与一个红色LED并联起来。 由于绿色 LED 的正向电压 (Vf) 一般为 2.0 至 2.2V,我假设它与红色 LED 类似,为 2.0V,并搭建了以下电路。 由于无需更改引脚设置,我使用之前的代码进行调试,红色 LED 闪烁,但绿色 LED 没有闪烁。这是为什么呢? (function() { var wrapper = document.getElementById('lia-vid-6404530194112w304h540r514'); 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'); }); }); }); } }})(); (显示我的视频) LED的特性是,当正向电压(Vf)超过其值时,电流会迅速增加。因此,如果将一个红色LED和一个绿色LED简单地并联,电流会集中在Vf较低的LED上,而另一个LED可能几乎不会发光。在这种情况下,红色LED的Vf低于绿色LED,因此电流集中在红色LED上。 当我用测试仪实际测量 LED 两端的电压时,红色 LED 的电压为 1.765V,绿色 LED 的电压为 1.766V。 在这个电压下,红色LED可以点亮,但绿色LED接收到的电压不足以产生足够的电流。因此,红色LED会亮,而绿色LED不会亮,因为几乎没有电流流过它。 如上图所示,简单地将不同类型的LED并联,即使正向电压(Vf)存在微小差异,也会导致电流出现显著偏差。因此,并联LED时,通常的做法是为每个LED串联一个限流电阻。 添加电阻时,需要考虑 GPIO 的电流限制。如果我们像之前那样直接添加一个 390Ω 的电阻并计算电流,那么施加到 GPIO 上的电流将超过 6mA。因此,为了确保总电流不超过 4mA,我们连接了两个 680Ω 的电阻,并搭建了以下电路。 当我再次调试同一段代码时,红色和绿色 LED 都亮了起来。 (function() { var wrapper = document.getElementById('lia-vid-6405719291112w304h540r698'); 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'); }); }); }); } }})(); (显示我的视频) 测量LED两端的电压时,红色LED的电压为1.750V,绿色LED的电压为1.906V。通过在每个LED上串联一个电阻,可以使合适的电流流过每个LED。 本文解释了嵌入式开发初学者会遇到的“问题”和“障碍”,内容涵盖如何解读各种文档、使用配置工具以及LED的工作原理等。我们希望本文能对那些首次尝试使用NXP微控制器实现LED闪烁的用户有所帮助。 =========================​ 我们目前无法 回复 此帖子“ 评论”部分留下的评论。 对于由此造成的不便,我们深表歉意,但 在进行咨询时, 请 参考“ NXP 技术问题 - 如何联系我们 ( 日语博客 ) ” 。 (如果您已经是 恩智浦的 分销商或 与 恩智浦 有合作关系 ,您可以直接咨询您的代表。) 本文以 LED 闪烁为例,解释了如何使用 GPIO(通用输入/输出),这是微控制器开发中最基本的外部设备之一。 GPIO 是许多微控制器开发人员最先接触的外设之一。很多人想用 GPIO 来点亮 LED,但他们可能不知道如何阅读数据手册或如何配置引脚。本文以 FRDM-MCXA153 为例,讲解 GPIO 的基础知识,面向微控制器开发初学者。我们将学习如何从数据手册和电路图中读取引脚信息,如何使用引脚工具配置设置,并最终体验如何控制外部 LED。 (预计时间:15 分钟)*假设开发环境已安装。 MCUXpresso MCUXpresso 配置工具 MCUXpresso IDE MCUXpresso SDK MCX 日本博客
View full article
GPIO入門:マイコン(MCX A153)のピンを読み解き、LEDを制御する方法(日本語ブログ) 目次 はじめに MCX A153マイコンのピン構成を理解する GPIOを使用するための設定 ピンとボード(FRDM-MCXA153)の関係を確認する デモンストレーション:GPIO設定を行いLED制御を体感する おまけ LEDの「点・滅」について理解する おまけ – 2つのLEDを並列に接続したら?   はじめに 組み込み開発初心者である筆者は、「GPIOについて記事を書いてほしい」という依頼をきっかけにGPIOの学習を始めました。本記事は、LEDを一つ点灯させるために試行錯誤する中で学んだ内容や気づきを、備忘録としてまとめたものです。 本記事では、マイコンを使った開発において最も基本的なペリフェラルの一つであるGPIO(General Purpose Input/Output)の使い方を解説します。 GPIOは、LEDを点灯したり、スイッチの状態を読み取ったり、センサからの信号を受け取ったりと、マイコンと外部回路をつなぐための組み込みシステムの基盤となっています。 一方で、実際のマイコン開発において、「GPIOを使う」と言っても、単にプログラムを書くだけではありません。マイコンには多数のピンが存在し、それぞれのピンにはGPIO以外にもタイマや通信インターフェースなどの機能が割り当てられています。 そのため、 GPIOを利用するには、データシートからピンの配置や機能を理解すること GPIOをピンに割り当てるためのPinMUX(ピン・マルチプレックス)設定 入出力方向の設定 を適切に行う必要があります。 今回はFRDM-MCXA153を題材に、MCX A153のピン構成やPinMUXの仕組みを確認しながら、Pins Tool上でGPIO設定を行い、最終的にはブレッドボード上に接続したLED点滅のデモンストレーションを紹介します。   MCX A153マイコンのピン構成を理解する FRDM-MCXA153にはMCXA153VLHという型番のマイコンが搭載されています。このマイコンはLQFP 64パッケージを採用しており、全部で64本のピンが存在します。そのうち52本がGPIOとして利用可能です。残りは電源端子(VDD/VSS)やUSB端子、アナログ専用端子などGPIOとして利用できない端子で構成されています。 ただし、「52本のGPIOがある」といっても、52本のGPIO専用ピンが用意されているわけではありません。GPIOとして利用可能なピンの多くは、UARTやSPI、I²C、タイマなどの周辺機能と共有されています。そのため、実際にGPIOとして利用する際には、PinMUX機能を使い、そのピンをGPIOとして動作させるための設定が必要になります。 MCX A153のピン構成をデータシートから確認してみます。54ページ以降に各ピンに割り当て可能な機能が一覧で記載されています。 例えば、Pin Name :P1_8 の「Pinmux Assignment」を見ると、6つの機能候補があります。GPIOは”ALT0 - P1_8”が該当します。他にも”ALT2 - LPUART1_RXD”はUARTの受信端子(RXD)、”ALT3 - LPI2C0_SDA”はI²Cデータ線(SDA)として使用することを意味します。 このように1本のピンに対してGPIOだけでなく、UARTやI²C、タイマなどの複数の機能が割り振られていることがわかります。   GPIOを使用するための設定 1. ピン機能の選択(PinMUX) 前節で確認したように、P1_8にはGPIO、UART、I²Cなど複数の機能候補が存在します。しかし、同じピンを同時にGPIOとUARTとして利用することはできません。 そこで一般的なマイコンには PinMUXという仕組みが用意されています。 PinMUXは、1本の物理ピンと内部ペリフェラルを接続するための切替スイッチのようなものです。 例えばP1_8には6つの接続先候補がありました。PinMUXによってGPIOを選択すると、P1_8はGPIOとして利用することができるようになります。 2. ピンの電気的特性を設定する ピンには機能だけでなく、電気的な振る舞いも設定できます。 代表的な設定として、 ・Pull-up(プルアップ) ・Pull-down(プルダウン) ・Drive Strength(ドライブ強度) ・Open Drain(オープンドレイン) などがあります。 例えばスイッチ入力ではプルアップ抵抗を有効にすることが多く、LEDや高速信号を駆動する場合にはドライブ強度を調整することがあります。 GPIOとして使用する場合でも、アプリケーションに応じた適切な電気的設定を行うことが重要です。 本記事ではこの電気的特性に関する詳細な説明は割愛します。 3. GPIOの入出力方向を設定する 最後に決めるのが信号の流れる方向です。GPIOには大きく分けて2つの動作モードがあります。 ・Input(入力) – 外部から信号を受け取る ・Output(出力) – 外部へ信号を出力する Input・Outputとはマイコン内部で何が起こっているのでしょうか? MCX A153は3.3Vで動作するマイコンです。そのためGPIOピンは、基本的にLow(約0V)とHigh(約3.3V)の2つの状態を扱います(なお、MCX A153の動作電圧範囲は1.71V〜3.6Vであり、FRDMボードでは3.3Vが採用されています)。 GPIO出力値 ピン電圧 Low (0) 約0V High (1) 約3.3V 例えば特定のGPIOピンをOutputに設定し、外部にLEDを接続した場合、High(約3.3V)にするとGPIOとGNDの間に電位差が生じ、LEDに電流が流れ、Low(約0V)の状態にするとGNDとの電位差がなくなるので電流が流れなくなります。つまり、LEDの”点滅”はGPIOピンの電圧をHigh(1)とLow(0)の間で切り替えることで点滅と消灯という動作を繰り返していることになります。 一方、InputではGPIOピンの状態をマイコンが監視します。例えば外部回路から約3.3Vが入力されればHigh(1)、約0Vが入力されればLow(0)として認識します。 ここまで説明したピンの機能選択・電気的特性の設定・入出力設定はPins Tool(Pins ToolはNXPが無償提供しているConfig Toolsに含まれます)を用いてGUI上で設定することが可能です。   ピンとボード(FRDM-MCXA153)の関係を確認する ここまでで、GPIOを利用するためにはPinMUX設定や入出力方向の設定が必要であることが分かりました。 続いて今回のデモンストレーションを想定し、MCUのピンがFRDM-MCXA153ボード上のどこに接続されているのかを確認しておきましょう。 Schematics(回路図)を確認し、前章で例として取り上げたピン "P1_8"はどこに引き出されているのかを確認します。 回路図の8ページを見てみると、P1_8はFRDM-MCXA153上にあるArduinoヘッダー: J2のD18に接続されていることがわかります。 FRDM-MCXA153 Schematics では、Arduinoヘッダー J2のD18とはどこでしょうか? 続いてBoard User Manualを確認します。 FRDM-MCXA153 Board User Manual 6ページ目にボードに搭載されているコネクタの外観図が載っており、ArduinoヘッダーJ2のD18はどこかを特定することができました。 今回は勉強のため、D18ピンからブレッドボードを経由してLEDを外部接続しますが、ブレッドボードやLEDをお持ちでない場合は、FRDM-MCXA153のボード上に搭載されているRGB LEDを活用することができます。 ただし一点注意があります。ボード上のRGB LEDを使用する場合はLEDのアノード側(+)がVDD_BOARD(3.3V)に接続されており、カソード側(-)がGPIOに接続されています。そのため、先ほどの外部接続したLEDとは逆でGPIOをHigh(1)にするとGPIO側も約3.3Vとなり、LED両端の電位差がほとんどなくなるためLEDは消灯します。 一方、GPIOをLow(0)にするとLED両端に電位差が生じて電流が流れ、LEDは点灯します。 回路図でそれぞれのピンを確認すると P3_12は赤色LED P3_13は緑色のLED P3_0は青色LED に対応しています。これらのPinMUX設定や入出力設定を行うことでボードに搭載されているLEDを使った動作を確認することもできます。 このように回路図やBoard User Manualを使って、マイコン内部の物理ピンがボード上のどこに接続されているかを確認することができます。   デモンストレーション:GPIO設定を行いLED制御を体感する この章では、MCUXpresso Config Toolsの Pins Tool を使用してGPIOの設定を行い、ブレッドボード上に外部接続したLEDを制御してみます。 デモンストレーションで使用した備品 ・FRDM-MCXA153 ・ブレッドボード ・LED ・抵抗 ・ジャンパ線 また今回はVS Code環境にてMCUXpresso SDKとConfig Toolsをインストール済みという前提でデモンストレーションを進めます。 ※MCUXpresso SDKとConfig Toolsのインストールがお済みでない方はこちらのブログをご参照ください。 MCUXpresso Config Tools : Pins Toolの使い方 (日本語ブログ) 注意:ブログ内ではFRDM-MCXN947のSDKをインストールしていますが本記事においてはFRDM-MCXA153のSDKをインストールしてください。 手元に品番不明の赤色LEDと緑色LEDがあったので、まずは赤色LEDの点灯から試してみます。抵抗は390Ωのものがありました。赤色LEDの順方向電圧(Vf)は一般的に1.8~2.2Vのため、仮に2.0VとしてLEDに流れる電流値を求めます。 マイコンの動作電圧は3.3Vです。Vf 2.0Vと抵抗390Ωを用いると、オームの法則から以下のように電流値が求められます。なおLEDには最大順方向電流(Ifmax)が規定されており、多くの汎用LEDでは20mAと言われています。20mAを超える電流が流れると破損する可能性があるので抵抗値にはご注意ください。 また、GPIOにも出力可能な電流に制限があります。データシートを参照するとMCX A153の通常動作時の電気特性は4mA(High Drive対応ピンでは6mA)を基準として規定されています。このため、GPIOからLEDを直接点灯する場合は、LEDだけでなくGPIO側の電流制限も考慮して抵抗値を選定する必要があります。 ボードとブレッドボードの配線 はじめに配線を行います FRDMボード上では、先ほど特定した ArduinoヘッダーJ2の"D18"と"14 GND"を使用します。 以下の図はBoard User Manualを参照しています。 FRDM-MCXA153 Board User Manual 以下の動画を参考に配線してください。 (function() { var wrapper = document.getElementById('lia-vid-6405195304112w960h540r888'); 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'); }); }); }); } }})(); (マイビデオを表示) サンプルコードのインポート 続いて、FRDM-MCXA153のSDKからサンプルコードのインポートへ進みます。 左側のパネルから「Import Example From Repository」をクリックしてください。 右側に表示された各タブ内で、「Repository」ではインポートしたFRDM-MCXA153のSDKを選択、「Board」はFRDM-MCXA153を選択してください。 「Template」は、「driver_examples/gpio/gpio_led_output」を使用します。 任意のToolchainを選択して、「Import」をクリックしてください。 Importが完了すると左側のパネルのProjectsに追加されます。 ソースコード gpio_led_output.cを確認します。 今回は、Pins Toolを用いてGPIOの入出力設定を行いたいので、ソースコード側から赤枠で囲んだGPIO出力設定に関する記述を削除します。 Pins ToolでGPIOの設定を行う 続いてConfig Toolsを開きます。Project上で右クリックして「Open with MCUXpresso Config Tools」を選択してください。少し待つとConfig Toolsが立ち上がります。 Config Toolsが開いたらまずは右側のパネルにあるOverviewよりPinsを選択します。 これでPins Toolが開いた状態になりました。 ピンP1_8を有効にします。 P1_8をクリックすると、下記画像のように別のWindowが開くので、ここから「GPIO1:GPIO,8(P1_8)」を探して✓を入れてください。 ✓を入れると同時に下記のWindowが表示されますがNoで閉じていただいて問題ありません。 ここまで完了するとPins Tool下部のRouting DetailsにP1_8が追加されます。 続いてGPIOの入出力設定を以下のように変更します。 #38(P3_12)のピンをOutput → Not Specifiedへ、#2(P1_8)のピンをNot Specified → Output へ。 #38のGPIO initial stateにエラーが出ますので、Logical 0→n/aへ変更してください。 ここまで完了したらサンプルコードを書き換えます。まずはConfig Toolsの画面左上にあるUpdate Codeをクリックしてください。 その後Windowが表示されます。ここで必要に応じてコードの変更点を確認することができます。変更が生じたファイルには「change」の記載があります。 VS Codeに戻ると、画面上部に3つのチェックボックスが表示されているので✓が入った状態でOKをクリックします。 少し時間が経つと、ソースコードへの変更が完了します。 続いてソースコード gpio_led_output.cよりGPIOの制御対象を変更します。 gpio_led_output.cを開くと、 以下の記述があります。   while (1) { delay(); GPIO_PortToggle(BOARD_LED_GPIO, 1u << BOARD_LED_GPIO_PIN); } GPIO_PinInit()およびGPIO_PortToggle()の中身を以下のように変更します。 ここではP1_8を制御対象として指定しており、関数が呼ばれるたびにP1_8の状態がHigh(1)とLow(0)の間で切り替わります。 while (1) { delay(); GPIO_PortToggle(GPIO1, 1u << 8); } さらに詳しく:GPIOピンは Px_y という形式で表記されます。ここで x はGPIOポート番号、y はそのポート内のビット位置を表します。例えば P1_8 は「GPIOポート1の8ビット目」を意味します。 コード中の GPIO_PortToggle(GPIO1, 1U << 8); において、 GPIO1 はGPIOポート1を表し、 1U << 8 は8ビット目だけを1にしたビットマスクです。 1U << 8 ↓ 0000 0001 0000 0000 (2進数) となり、GPIOポート1の中の8ビット目のみを反転(HighとLowを切り替える)させることができます。 PCとFRDM-MCXA153を接続します。 デバッグ(ビルド&書き込み&アプリケーションの実行)します。 デバッグのプロセスが完了したら、プログラムがブレイクポイントで止まっているので、画面上部のアイコン内の"|▶"をクリックします。 LEDが点滅を開始します。 (function() { var wrapper = document.getElementById('lia-vid-6404528566112w304h540r105'); 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'); }); }); }); } }})(); (マイビデオを表示) おまけ – LEDの「点・滅」について理解する  ところで、このLEDはGPIOからHigh(1) , Low(0) どちらを出力したときに点灯しているのでしょうか?先ほどはHigh(1)を出力したときに点灯していると言及しましたが、本当か検証してみます。 以下が先ほど使用したコードです。 while(1)は無限ループを意味し、波括弧{}の中の処理を繰り返し実行します。 また、delay()は一定時間待機するための関数です。GPIO_PortToggle()はGPIO制御関数なので、High(1)とLow(0)を反転します。 while (1) { delay(); GPIO_PortToggle(GPIO1, 1u<<8); } } しかしながら、このコードではLEDがHigh(1)のときに点灯しているのか、Low(0)のときに点灯しているのかがわかりません。 そこで異なる関数GPIO_PinWrite() を使用して、GPIOの状態を明示的に制御します。 具体的には以下のようにHigh(1)の状態でdelay()1回分待機し、その後Low(0)の状態でdelay()5回分待機するコードへ変更します。これでLEDの消灯時間のほうが長くなるはずです。 while (1) { GPIO_PinWrite (GPIO1,8U ,1); delay(); GPIO_PinWrite(GPIO1,8U ,0); delay(); delay(); delay(); delay(); delay(); } デバッグを実行し、画面上部のアイコン内の"|▶"をクリックします。 (function() { var wrapper = document.getElementById('lia-vid-6404528052112w304h540r114'); 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'); }); }); }); } }})(); (マイビデオを表示) 狙い通り、LEDの消灯時間のほうが長くなりました。 これによりLEDが点灯しているときにはHigh(1)を出力し、消灯しているときにはLow(0)を出力していることが検証できました。 おさらいすると、GPIOがHigh(1)になると、GPIOピンとして設定したP1_8は約3.3Vになります。GNDとの間に電位差が生じるため、抵抗とLEDを通して電流が流れます。このときLEDの両端には順方向電圧(約2.0V)がかかり、残りの約1.3Vが抵抗にかかります。その結果、LEDが発光します。 一方、GPIOがLow(0)になるとP1_8の電圧は約0Vになります。GPIOピンとGNDの間に電位差がなくなるため電流は流れず、LEDは消灯します。 delay()がたくさん並ぶのはかっこ悪いという方はループ関数も使えます。 while (1) { GPIO_PinWrite(GPIO1, 8U, 1); delay(); GPIO_PinWrite(GPIO1, 8U, 0); for (int i = 0; i < 5; i++) { delay(); } } おまけ – 2つのLEDを並列に接続したら? 手元にあった緑色のLEDを赤色LEDと並列接続しようと試みました。 緑色の順方向電圧(Vf)は一般的に2.0~2.2Vのため、赤色LEDと同様に仮に2.0Vとして以下のような回路を組みました。 ピンの設定は変える必要がないため、そのまま先ほど使ったコードでデバッグを行ったところ、赤色LEDは点滅しますが緑色LEDは点滅しません。なぜでしょうか? (function() { var wrapper = document.getElementById('lia-vid-6404530194112w304h540r514'); 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'); }); }); }); } }})(); (マイビデオを表示) LEDには、順方向電圧(Vf)を超えると急激に電流が流れ始めるという特性があります。そのため赤色LEDと緑色LEDを単純に並列接続すると、Vfの低いLEDに電流が集中し、もう一方はほとんど点灯しないことがあります。つまり今回の場合は赤色LEDのVfが緑色LEDに比べて低いので、赤色LEDに電流が集中したという状態となっています。 実際にテスターでLED両端の電圧を測定したところ、赤色LEDは1.765V , 緑色LEDは1.766Vでした。 この電圧では赤色LEDは発光できるものの、緑色LEDは十分な電流が流れるほどの電圧に達していません。その結果、赤色LEDには電流が流れて点灯しますが、緑色LEDにはほとんど電流が流れず点灯しませんでした。 このように、LEDを異なる種類のまま単純に並列接続すると、わずかなVfの差によって電流の流れ方が大きく偏ることがあります。そのためLEDを並列接続する場合は、LEDごとに電流制限抵抗を設けるのが一般的です。 抵抗を追加する際にはGPIOの電流制限を考慮する必要があります。単純にこれまで使ってきた390Ωをひとつ追加して電流値を計算すると計算上では6mAを超える電流がGPIOに掛かってしまいます。したがって、総電流が4mA超えないよう680Ωの抵抗を2つ接続し、以下のような回路を組みました。 再度同じコードでデバッグを行ったところ、赤色LED、緑色LEDともに点灯しました。 (function() { var wrapper = document.getElementById('lia-vid-6405719291112w304h540r698'); 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'); }); }); }); } }})(); (マイビデオを表示) LED両端の電圧を測定したところ、赤色LEDは1.750V , 緑色LEDは1.906Vでした。抵抗をそれぞれのLEDに追加したことで、各LEDに適切な電流が流れるようになりました。 以上、今回は各種ドキュメントの読み解き方、Config Toolsの使い方からLEDの動作原理にいたるまで組み込み開発初心者の目線から「困った」「詰まった」点を解説しました。NXPマイコンを使って初めてLチカにチャレンジするという方のご参考になれば幸いです。 =========================​ 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。​ お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。​ (既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。) マイコンを使った開発において最も基本的なペリフェラルの一つであるGPIO(General Purpose Input/Output)をLEDの点滅を例に使い方を解説します。 GPIOは多くのマイコン開発者が最初に学ぶペリフェラルです。GPIOを使ってLEDを光らせてみたいけれど、「データシートの見方がわからない」「ピンの設定方法がわからない」という方も多いのではないでしょうか。本記事ではマイコン開発初心者向けに、FRDM-MCXA153を使ったGPIO入門を解説します。データシートや回路図からピン情報を読み解き、Pins Toolを使った設定を行いながら、最終的に外部LEDの制御を体験します。 (作業時間:15分) ※開発環境をインストール済みの前提 MCUXpresso MCUXpresso Conig Tools MCUXpresso IDE MCUXpresso SDK MCX 日本語ブログ
View full article
GPIO Introduction: How to Read the Pins of a Microcontroller (MCX A153) and Control an LED (Japanese Blog) table of contents Introduction Understanding the pin configuration of the MCX A153 microcontroller Settings for using GPIO Check the relationship between the pins and the board (FRDM-MCXA153). Demonstration: Perform GPIO settings and experience LED control. Bonus: Understanding the "on/off" of LEDs Bonus – What happens if you connect two LEDs in parallel?   Introduction As a beginner in embedded systems development, I began learning about GPIO after receiving a request to write an article about it. This article is a record of what I learned and the insights I gained through trial and error while trying to light up a single LED. This article explains how to use GPIO (General Purpose Input/Output), one of the most basic peripherals in microcontroller development. GPIO is the foundation of embedded systems for connecting microcontrollers to external circuits, enabling functions such as turning on LEDs, reading the state of switches, and receiving signals from sensors. On the other hand, in actual microcontroller development, "using GPIO" doesn't simply mean writing a program. Microcontrollers have numerous pins, and each pin is assigned functions other than GPIO, such as timers and communication interfaces. Therefore, To use GPIO, you need to understand the pin assignments and functions from the datasheet. PinMUX (pin multiplex) settings for assigning GPIO to pins Input/Output Direction Settings This needs to be done properly. This time, using the FRDM-MCXA153 as an example, we will examine the pin configuration of the MCX A153 and the mechanism of PinMUX, configure GPIO settings using Pins Tool, and finally demonstrate blinking LEDs connected to a breadboard.   Understanding the pin configuration of the MCX A153 microcontroller The FRDM-MCXA153 is equipped with a microcontroller with the model number MCXA153VLH. This microcontroller uses an LQFP 64 package and has a total of 64 pins. Of these, 52 are available as GPIOs. The remaining pins consist of power terminals (VDD/VSS), USB terminals, and analog-only terminals, which cannot be used as GPIOs. However, even though it has "52 GPIOs," this doesn't mean that 52 pins are dedicated to GPIO. Many of the pins available for GPIO use are shared with peripheral functions such as UART, SPI, I²C, and timers. Therefore, to actually use them as GPIOs, you need to use the PinMUX function to configure those pins to function as GPIOs. Let's check the pin configuration of the MCX A153 from the datasheet . A list of functions that can be assigned to each pin is provided starting on page 54. For example, looking at the "Pinmux Assignment" for Pin Name: P1_8, there are six possible functions. GPIO is assigned to "ALT0 - P1_8". Other assignments include "ALT2 - LPUART1_RXD" which means it will be used as the UART receive terminal (RXD), and "ALT3 - LPI2C0_SDA" which means it will be used as the I²C data line (SDA). As you can see, a single pin can be assigned to multiple functions, including not only GPIO but also UART, I²C, and timers.   Settings for using GPIO 1. Select pin function (PinMUX) As confirmed in the previous section, P1_8 has several potential functions, including GPIO, UART, and I²C. However, the same pin cannot be used as both GPIO and UART simultaneously. Therefore, typical microcontrollers are equipped with a mechanism called PinMUX. PinMUX is like a toggle switch for connecting a single physical pin to an internal peripheral. For example, P1_8 had six potential connection destinations. By selecting GPIO using PinMUX, P1_8 becomes available for use as a GPIO pin. 2. Set the electrical characteristics of the pins. Pins can be configured not only for their function but also for their electrical behavior. Typical settings include: • Pull-up • Pull-down Drive Strength Open Drain These are some examples. For instance, pull-up resistors are often enabled for switch inputs, and the drive strength may be adjusted when driving LEDs or high-speed signals. Even when used as GPIO, it is important to make appropriate electrical settings according to the application. This article will omit a detailed explanation of these electrical characteristics. 3. Set the input/output direction of the GPIO. The final step is determining the direction in which the signal flows. GPIO has two main operating modes. • Input – Receives signals from the outside • Output – Sends signals to the outside What exactly is happening inside the microcontroller when it comes to Input and Output? The MCX A153 is a microcontroller that operates at 3.3V. Therefore, the GPIO pins basically handle two states: Low (approximately 0V) and High (approximately 3.3V).The A153 has an operating voltage range of 1.71V to 3.6V, and 3.3V is used for the FRDM board. GPIO output values Pin voltage Low (0) Approximately 0V High (1) Approximately 3.3V For example, if you set a specific GPIO pin to Output and connect an external LED, setting it to High (approximately 3.3V) creates a potential difference between the GPIO and GND, allowing current to flow through the LED. Setting it to Low (approximately 0V) eliminates the potential difference with GND, so no current flows. In other words, the "blinking" of the LED is caused by repeatedly switching the voltage of the GPIO pin between High (1) and Low (0), alternating between blinking and being off. On the other hand, in Input mode, the microcontroller monitors the state of the GPIO pins. For example, if approximately 3.3V is input from an external circuit, it is recognized as High (1), and if approximately 0V is input, it is recognized as Low (0). The pin function selection, electrical characteristic settings, and input/output settings described above can all be configured via a GUI using the Pins Tool (which is included in NXP's free Config Tools).   Check the relationship between the pins and the board (FRDM-MCXA153). So far, we've learned that in order to use GPIO, you need to configure PinMUX settings and input/output direction settings. Next, let's confirm where the MCU pins are connected on the FRDM-MCXA153 board, keeping in mind the demonstration we'll be performing. Check the schematics and confirm where pin "P1_8", which was used as an example in the previous chapter, is routed. Looking at page 8 of the circuit diagram, we can see that P1_8 is connected to D18 of Arduino header J2 on the FRDM-MCXA153. FRDM-MCXA153 Schematics So, where is D18 on the Arduino header J2? Next, let's check the Board User Manual. FRDM-MCXA153 Board User Manual Page 6 contains a diagram of the connectors mounted on the board, which allowed me to identify the location of D18 on the Arduino header J2. For this learning exercise, we will connect an external LED via a breadboard using the D18 pin. However, if you do not have a breadboard or LED, you can use the RGB LED mounted on the FRDM-MCXA153 board. However, there is one point to note. When using the RGB LED on the board, the anode (+) of the LED is connected to VDD_BOARD (3.3V), and the cathode (-) is connected to GPIO. Therefore, unlike the externally connected LED mentioned earlier, setting GPIO to High (1) will also bring the GPIO voltage to approximately 3.3V, and the potential difference across the LED will almost disappear, causing the LED to turn off. On the other hand, setting GPIO to Low (0) creates a potential difference across the LED, causing current to flow and the LED to light up. When you check each pin in the circuit diagram... P3_12 is a red LED P3_13 is a green LED P3_0 is a blue LED It supports these features. By configuring these PinMUX settings and input/output settings, you can also verify the operation using the LEDs on the board. In this way, you can use the circuit diagram and the Board User Manual to check where the physical pins inside the microcontroller are connected on the board.   Demonstration: Perform GPIO settings and experience LED control. In this chapter, we will use the Pins Tool in MCUXpresso Config Tools to configure GPIO and control an externally connected LED on a breadboard. Equipment used in the demonstration: FRDM-MCXA153 Breadboard LED • Resistors and jumper wires This demonstration will assume that you have already installed the MCUXpresso SDK and Config Tools in your VS Code environment. *If you have not yet installed the MCUXpresso SDK and Config Tools, please refer to this blog post. MCUXpresso Config Tools: How to Use the Pins Tool (Japanese Blog) Note: While the blog post describes installing the SDK for FRDM-MCXN947, please install the SDK for FRDM-MCXA153 in this article. I had a red LED and a green LED on hand, but I didn't know the part numbers, so I'll start by trying to light up the red LED. I had a 390Ω resistor. The forward voltage (Vf) of a red LED is generally 1.8~2.2V, so I'll assume it's 2.0V and calculate the current flowing through the LED. The microcontroller's operating voltage is 3.3V. VfUsing 2.0V and a 390Ω resistor, the current value can be calculated using Ohm's law as follows. Note that LEDs have a specified maximum forward current (Ifmax), which is said to be 20mA for many general-purpose LEDs. Be careful with the resistance value, as currents exceeding 20mA may cause damage. Furthermore, GPIO pins also have limitations on the current they can output. According to the datasheet, the MCX A153's electrical characteristics during normal operation are specified based on 4mA (6mA for High Drive pins). Therefore, when directly lighting an LED using a GPIO pin, you need to select a resistor value that takes into account not only the LED's current limit but also the GPIO's current limit. Board and breadboard wiring First, we'll do the wiring. On the FRDM board, we will use "D18" and "14 GND" on the Arduino header J2 that we identified earlier . The following diagram is based on the Board User Manual. FRDM-MCXA153 Board User Manual Please refer to the following video for wiring instructions. (function() { var wrapper = document.getElementById('lia-vid-6405195304112w960h540r888'); 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'); }); }); }); } }})(); (Show My Videos) Importing sample code Next, we will proceed to import the sample code from the FRDM-MCXA153 SDK. Click "Import Example From Repository" in the panel on the left. In the tabs displayed on the right, select the imported FRDM-MCXA153 SDK under "Repository" and select FRDM-MCXA153 under "Board". The template used is "driver_examples/gpio/gpio_led_output". Select your desired Toolchain and click "Import". Once the import is complete, it will be added to the Projects section in the left-hand panel. Check the source code gpio_led_output.c. This time, we want to configure GPIO input/output settings using Pins Tool, so we will remove the GPIO output setting code enclosed in the red box from the source code. Configure GPIO settings using Pins Tool. Next, open Config Tools. Right-click on the Project and select "Open with MCUXpresso Config Tools". After a short wait, Config Tools will launch. Once Config Tools opens, first select Pins from Overview in the right-hand panel. The Pins Tool is now open. Enable pin P1_8. Clicking on P1_8 will open another window as shown in the image below. Find "GPIO1:GPIO,8(P1_8)" in this window and check the box next to it. When you check the box, the following window will appear, but you can close it by clicking No. Once you've completed these steps, P1_8 will be added to the Routing Details at the bottom of the Pins Tool. Next, change the GPIO input/output settings as follows. Connect pin #38 (P3_12) from Output to Not Specified, and pin #2 (P1_8) from Not Specified to Output. An error will occur in the GPIO initial state of #38, so please change it from Logical 0 to n/a. Once you've completed these steps, you can rewrite the sample code. First, click Update Code in the upper left corner of the Config Tools screen. A window will then appear. Here you can review the code changes as needed. Files that have been modified will have "change" written next to them. When you return to VS Code, you will see three checkboxes at the top of the screen. Make sure they are checked and click OK. After a short while, the changes to the source code will be completed. Next, we will change the target of GPIO control in the source code gpio_led_output.c. When you open gpio_led_output.c, The following is stated:   while (1) { delay(); GPIO_PortToggle(BOARD_LED_GPIO, 1u << BOARD_LED_GPIO_PIN); } Modify the contents of GPIO_PinInit() and GPIO_PortToggle() as follows: Here, P1_8 is specified as the control target, and each time the function is called, the state of P1_8 switches between High (1) and Low (0). while (1) { delay(); GPIO_PortToggle(GPIO1, 1u << 8); } Further details: GPIO pins are represented in the format Px_y, where x is the GPIO port number and y represents the bit position within that port. For example, P1_8 means "bit 8 of GPIO port 1". In the code GPIO_PortToggle(GPIO1, 1U << 8); In, GPIO1 1U << 8 represents GPIO port 1, is a bitmask where only the 8th bit is set to 1. 1U << 8 ↓ 0000 0001 0000 0000 (2進数) This allows you to invert (switch between High and Low) only the 8th bit in GPIO port 1. Connect the PC to the FRDM-MCXA153. Debugging (build, write, and run the application). Once the debugging process is complete, the program will have stopped at the breakpoint, so click the "|▶" icon at the top of the screen. The LED will start blinking. (function() { var wrapper = document.getElementById('lia-vid-6404528566112w304h540r105'); 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'); }); }); }); } }})(); (Show My Videos) Bonus – Understanding LED "on/off" By the way, when does this LED light up, based on whether the GPIO outputs High (1) or Low (0)? Earlier I mentioned that it lights up when High (1) is output, but let's verify if that's true. The following is the code we used earlier. The `while(1)` statement implies an infinite loop, repeatedly executing the code within the curly braces {}. Additionally, delay() is a function for waiting for a certain period of time. GPIO_PortToggle() is a GPIO control function, so it inverts High (1) and Low (0). while (1) { delay(); GPIO_PortToggle(GPIO1, 1u<<8); } } However, this code doesn't tell us whether the LED is lit when it's High (1) or Low (0). Therefore, we use a different function, GPIO_PinWrite(), to explicitly control the state of the GPIO. Specifically, the code will be changed to wait for one delay() call while in a High (1) state, and then wait for five delay() calls while in a Low (0) state. This should make the LED stay off for a longer period of time. while (1) { GPIO_PinWrite (GPIO1,8U ,1); delay(); GPIO_PinWrite(GPIO1,8U ,0); delay(); delay(); delay(); delay(); delay(); } Run the debug and click the "|▶" icon at the top of the screen. (function() { var wrapper = document.getElementById('lia-vid-6404528052112w304h540r114'); 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'); }); }); }); } }})(); (Show My Videos) As intended, the LEDs were turned off for a longer period. This allowed us to verify that the LED outputs High (1) when it is lit and Low (0) when it is off. To recap, when the GPIO goes high (1), the voltage at P1_8, which is set as the GPIO pin, becomes approximately 3.3V. A potential difference is created between this voltage and GND, causing current to flow through the resistor and the LED. At this time, a forward voltage (approximately 2.0V) is applied across the LED, and the remaining approximately 1.3V is applied across the resistor. As a result, the LED lights up. On the other hand, when GPIO goes low (0), the voltage at P1_8 becomes approximately 0V. Since there is no potential difference between the GPIO pin and GND, no current flows, and the LED turns off. If you think having a lot of `delay()` functions looks ugly, you can also use loop functions. while (1) { GPIO_PinWrite(GPIO1, 8U, 1); delay(); GPIO_PinWrite(GPIO1, 8U, 0); for (int i = 0; i < 5; i++) { delay(); } } Bonus – What happens if you connect two LEDs in parallel? I tried connecting a green LED I had on hand in parallel with a red LED. Since the forward voltage (Vf) of a green LED is generally 2.0 to 2.2V, I assumed it to be 2.0V, similar to the red LED, and built the following circuit. Since there was no need to change the pin settings, I debugged using the same code as before, and the red LED blinked, but the green LED did not. Why is that? (function() { var wrapper = document.getElementById('lia-vid-6404530194112w304h540r514'); 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'); }); }); }); } }})(); (Show My Videos) LEDs have the characteristic that current starts flowing rapidly when the forward voltage (Vf) is exceeded. Therefore, if a red LED and a green LED are simply connected in parallel, the current will concentrate on the LED with the lower Vf, and the other LED may hardly light up at all. In this case, the Vf of the red LED is lower than that of the green LED, so the current is concentrated on the red LED. When I actually measured the voltage across the LEDs with a tester, the red LED was 1.765V and the green LED was 1.766V. At this voltage, the red LED can light up, but the green LED does not receive enough voltage to generate sufficient current. As a result, the red LED lights up, but the green LED does not light up because almost no current flows through it. As shown above, simply connecting different types of LEDs in parallel can cause significant bias in current flow due to even small differences in forward voltage (Vf). Therefore, when connecting LEDs in parallel, it is common practice to install a current-limiting resistor for each LED. When adding resistors, you need to consider the GPIO current limit. If you simply add one more 390Ω resistor as we've been using and calculate the current, the calculated current applied to the GPIO will exceed 6mA. Therefore, to ensure the total current does not exceed 4mA, we connected two 680Ω resistors and built the following circuit. When I debugged the same code again, both the red and green LEDs lit up. (function() { var wrapper = document.getElementById('lia-vid-6405719291112w304h540r698'); 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'); }); }); }); } }})(); (Show My Videos) When the voltage across the LEDs was measured, the red LED was 1.750V and the green LED was 1.906V. By adding a resistor to each LED, the appropriate current was able to flow through each LED. In this article, we've explained the "problems" and "stumbling blocks" encountered by a beginner in embedded development, from how to interpret various documents and use Config Tools to the operating principles of LEDs. We hope this will be helpful for those attempting to blink an LED for the first time using an NXP microcontroller. =========================​ We are currently unable to respond to comments left in the " Comment " section of this post . We apologize for the inconvenience, but please refer to " Technical Questions to NXP - How to Contact Us ( Japanese Blog ) " when making inquiries . (If you are already an NXP distributor or have a relationship with NXP , you may ask your representative directly.) This article explains how to use GPIO (General Purpose Input/Output), one of the most basic peripherals in microcontroller development, using the blinking of an LED as an example. GPIO is one of the first peripherals that many microcontroller developers learn about. Many people want to use GPIO to light up an LED, but they may not know how to read the datasheet or how to configure the pins. This article explains the basics of GPIO using the FRDM-MCXA153, aimed at beginners in microcontroller development. We will learn to read pin information from the datasheet and circuit diagram, configure settings using Pins Tool, and finally experience controlling an external LED. (Estimated time: 15 minutes) *Assuming the development environment is already installed. MCUXpresso MCUXpresso Configuration Tools MCUXpresso IDE MCUXpresso SDK MCX Japanese Blog
View full article