Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
KW38 - 使用 OTAP 客户端软件对 KW38 设备进行重新编程 简介 空中编程(OTAP)是NXP提供的一项基于蓝牙低功耗(Bluetooth LE)的定制服务,提供升级微控制器中运行的软件的解决方案。本文件指导用户通过空中编程(OTAP)Bluetooth LE服务,将新的软件镜像加载到KW38设备中。。 软件要求 MCUXpresso IDE 或 IAR Embedded Workbench IDE。 FRDM-KW38 SDK。 IoT Toolbox 应用程序,适用于 Android 和 iOS 系统。你也可以从以下帖子下载 IoT Toolbox 应用程序的 APK 文件:Android 版 IoT Toolbox 硬件要求 FRDM-KW38板。 带有 IoT Toolbox 应用程序的智能手机。 OTAP 客户端软件在更新过程中使用的 KW38 闪存 默认情况下,512KB KW38 闪存被分区为: 一个 256KB 的程序闪存阵列 (P-Flash),分为 2KB 的扇区,闪存地址范围从 0x0000_0000 到 0x0003_FFFF。 一个256KB的FlexNVM数组,分为2KB的扇区,地址范围从0x1000_0000到0x1003_FFFF。 别名内存 (Alias memory),地址范围从 0x0004_0000 到 0x0007_FFFF。对别名内存的写入或读取操作分别会修改或返回 FlexNVM 的内容。换句话说,别名内存是使用不同地址来访问 FlexNVM 内存的另一种方式。 以下几点将简化说明 OTAP 服务的工作原理:   OTAP 应用程序由两个独立的部分组成,即 OTAP 引导加载程序和 OTAP 客户端。OTAP 引导加载程序会验证 OTAP 客户端中是否有可用的新镜像,以对设备进行重新编程。另一方面,OTAP 客户端软件提供了所需的蓝牙低功耗自定义服务,使 OTAP 客户端设备(待重新编程的设备)能够与 OTAP 服务器设备(包含用于重新编程 OTAP 客户端设备的镜像的设备)进行通信。因此,首次准备软件时,需要对 OTAP 客户端设备进行两次编程,首先是 OTAP 引导加载程序,然后是 OTAP 客户端软件。使两个不同的软件能够在同一设备中共存的机制是将它们分别存储在不同的内存区域。这是通过在链接器文件中为每个软件指定不同的内存区域来实现的。对于 KW38 设备,OTAP 引导加载程序预留了一个从 0x0000_0000 到 0x0000_1FFF 的 8KB 存储空间,因此,内存的其余部分除其他用途外,由 OTAP 客户端软件预留。     为 OTAP 客户端设备生成新的镜像文件时,我们需要在链接器文件中指定代码将以 8KB 的偏移量进行放置(就像 OTAP 客户端软件所做的那样),因为必须保留这些地址范围以避免覆盖 OTAP 引导加载程序。新应用程序还应在相应的地址包含引导加载程序标志,以确保其正常工作(稍后我们将回到这一点)。     当 OTAP 客户端设备和 OTAP 服务器设备连接且正在进行下载时,OTAP 服务器设备通过蓝牙低功耗将镜像数据包(称为块)发送到 OTAP 客户端设备。OTAP 客户端设备可以将这些块存储在外部 SPI 闪存(FRDM-KW38 开发板上已预装)或片上 FlexNVM 区域中。这些块的存储目的地可在 OTAP 客户端软件中选择(本文将提供修改存储目的地的说明)。     当镜像传输完成且所有块都已从 OTAP 服务器设备发送到 OTAP 客户端设备后,OTAP 客户端软件会将诸如软件更新源(外部闪存或 FlexNVM)之类的信息写入称为引导加载程序标志的内存部分。然后,OTAP 客户端对微控制器(MCU)执行软件复位,以执行 OTAP 引导加载程序代码。接着,OTAP 引导加载程序代码读取引导加载程序标志,以获取使用新应用程序对设备进行重新编程所需的信息。请参见以下流程图,该图解释了这两个应用程序的流程。   由于新应用程序是按 8KB 的偏移量构建的,因此 OTAP 引导加载程序从 0x0000_2000 地址开始对设备进行编程,因此,OTAP 客户端应用程序会被新镜像覆盖。然后,OTAP 引导加载程序转移应用程序的流程,开始执行新代码。     实际上,如第 3 点所述,当启用 FlexNVM 存储时,OTAP 客户端软件和软件更新之间的边界并非恰好位于 P-Flash 和 FlexNVM 内存区域的边界上,此外,这些值可能会根据你的链接器设置而变化。要了解边界的位置,你应该检查项目中的实际内存地址。       在 IAR Embedded Workbench IDE 中配置和编程 OTAP 客户端软件 如最后一节所述,要完成 OTAP 实现所需的软件,需要在 FRDM-KW38 开发板上编程两个软件,即 OTAP 引导加载程序和 OTAP 客户端。本节将指导你使用 IAR Embedded Workbench IDE 进行编程,并配置设置以在外部存储和内部存储之间进行选择。 1- 第一步是在 KW38 中编程 OTAP 引导加载程序。解压 SDK,然后在以下路径中找到 OTAP 引导加载程序软件: \boards\frdmkw38\wireless_examples\framework\bootloader_otap\bm\iar\bootloader_otap.eww 2- 点击 “Download and Debug” 图标 (Ctrl + D),在开发板上编程 OTAP 引导加载程序项目。 KW38 编程完成并开始调试会话后,中止会话 (Ctrl + Caps Lock + D) ,以安全地停止 MCU。 3- 此时,您已将OTAP引导程序编程到您的KW38中。接下来是编程和配置 OTAP 客户端软件。请在以下路径找到 OTAP 客户端软件: FreeRTOS项目版本: \boards\frdmkw38\wireless_examples\bluetooth\otac_att\freertos\iar\otap_client_att_freertos.eww 裸机 (Baremetal) 项目版本: \boards\frdmkw38\wireless_examples\bluetooth\otac_att\bm\iar\otap_client_att_bm.eww 4- 然后,配置 OTAP 客户端以选择外部存储或内部存储。 要选择外部存储,请按照以下步骤操作(这是 SDK 项目中的默认配置): 4.1- 在工作区的源文件夹中找到 “app_preinclude.h” 头文件。搜索 “gEepromType_d” 定义,并将其值设置为 “gEepromDevice_AT45DB041E_c”。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_AT45DB041E_c 4.2- 打开项目选项窗口 (Alt + F7)。在 “Linker->Config” 窗口中,设置 “gUseInternalStorageLink_d=0”。   要选择内部存储,请按照以下步骤操作: 4.1 - 在工作区的源文件夹中找到 “app_preinclude.h” 头文件。搜索 “gEepromType_d” 定义,并将其值设置为 “gEepromDevice_InternalFlash_c”。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_InternalFlash_c 4.2- 打开项目选项窗口 (Alt + F7)。在 “Linker->Config” 窗口中,设置 “gUseInternalStorageLink_d=1”。   5- 配置好存储设置后,保存项目中的更改。然后点击 “Download and Debug” 图标(Ctrl + D) ,在开发板上编程软件。KW38 编程完成并开始调试会话后,中止会话 (Ctrl + Caps Lock + D) ,以安全地停止 MCU。 在 IAR Embedded Workbench IDE 中创建用于更新 OTAP 客户端软件的 SREC 镜像 本节将展示如何以无线示例为起点,创建与 OTAP 兼容的镜像,以使用 IAR Embedded Workbench IDE 对 KW38 OTAP 客户端进行重新编程。 1- 从 SDK 包的 Bluetooth 文件夹中选择任意示例,使用 IAR IDE 打开。Bluetooth 示例位于以下路径: \boards\frdmkw38\wireless_examples\bluetooth  在本示例中,我们将使用葡萄糖传感器项目: \boards\frdmkw38\wireless_examples\bluetooth\glucose_s\freertos\iar\glucose_sensor_freertos.eww 2- 打开 IAR 中的项目选项窗口 (Alt + F7)。在 “Linker->Config” 窗口中,编辑选项以包含 “gUseBootloaderLink_d=1” 标志,并更新 “gEraseNVMLink_d=0” 标志。当 gUseBootloaderLink_d 标志为 true 时,它向链接器文件指示镜像必须在第一个闪存扇区之后寻址,以避免覆盖 OTAP 引导加载程序软件(如我们之前所述)。另一方面,gEraseNVMLink_d 符号用于用 0xFF 模式填充未使用的 NVM 闪存区域。禁用此标志后,我们的软件镜像将不包含此模式,因此,镜像的总大小会减小,并提高 OTAP 下载速度和内存使用率。 3- 进入 “Output Converter” 窗口。取消选中 “Override default” 复选框,然后展开 “Output format” 下拉框,选择 “Motorola S-records” 格式。点击 “OK” 按钮完成设置。 4- 构建项目。 5- 在以下路径中找到 S-Record 文件 (.srec),并将其保存到智能手机上的已知位置。 \boards\frdmkw38\wireless_examples\bluetooth\glucose_s\freertos\iar\debug\glucose_sensor_freertos.srec 在 MCUXpresso IDE 中配置和编程 OTAP 客户端软件 如前文所述,为了完成OTAP实现,您需要在FRDM-KW38上编写两个软件:OTAP引导加载程序和OTAP客户端。本节将指导您使用MCUXpresso IDE对设置进行编程和配置,以选择外部存储或内部存储。 1- 打开 MCUXpresso IDE。在"快速入门面板"中点击"导入SDK示例"。 2- 选择 FRDM-KW38 图标,然后点击 “Next>”。 3- 导入 OTAP 引导加载程序项目。它位于 “wireless_examples -> framework -> bootloader_otap -> bm -> bootloader_otap”。点击 “Finish” 按钮。 4- 点击 “Debug” 图标 ,在开发板上编程 OTAP 引导加载程序项目。KW38 编程完成并开始调试会话后,中止会话 (Ctrl + F2),以安全地停止 MCU。 5- 重复步骤 1 到 3,在 MCUXpresso IDE 中导入 OTAP 客户端软件。对于 FreeRTOS 版本,它位于 “wireless_examples -> bluetooth -> otac_att -> freertos -> otap_client_att_freertos”;如果你更喜欢裸机版本,则位于 “wireless_examples -> bluetooth -> otac_att -> bm -> otap_client_bm_freertos”。。 6- 然后,配置 OTAP 客户端以选择外部存储或内部存储。 要选择外部存储,请按照以下步骤操作(这是 SDK 项目中的默认配置): 6.1- 在工作区的源文件夹下找到 “app_preinclude.h” 文件。搜索 “gEepromType_d” 定义,并将其值设置为 “gEepromDevice_AT45DB041E_c”。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_AT45DB041E_c 6.2- 导航至 “Project -> Properties -> C/C++ Build -> MCU settings -> Memory details”。按照下图所示编辑 Flash 字段,保持 RAM 不变。 要选择内部存储,请按照以下步骤操作: 6.1- 在工作区的源文件夹下找到 “app_preinclude.h” 文件。搜索 “gEepromType_d” 定义,并将其值设置为 “gEepromDevice_InternalFlash_c”。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_InternalFlash_c 6.2- 导航至 “Project -> Properties -> C/C++ Build -> MCU settings -> Memory details”。按照下图所示编辑 Flash 字段,保持 RAM 不变。 7- 配置好存储设置后,保存项目中的更改。然后点击 “Debug” 图标 ,在开发板上编程软件。KW38 编程完成并开始调试会话后,中止会话 (Ctrl + F2),以安全地停止 MCU。 在 MCUXpresso IDE 中创建 SREC 镜像以更新 OTAP 客户端中的软件 本节将展示如何以无线示例为起点,创建与 OTAP 兼容的镜像,以使用 MCUXpresso IDE 对 KW38 OTAP 客户端进行重新编程。 1- 如前所述,从 SDK 包的 Bluetooth 文件夹中导入任意示例。在 SDK 导入向导中,Bluetooth 示例位于 “wireless_examples -> bluetooth” 文件夹中。本示例将使用 “wireless_examples -> bluetooth -> glucose_s -> freertos -> glucose_sensor_freertos” 中的葡萄糖传感器项目。见下图。 2- 导航至 “Project -> Properties -> C/C++ Build -> MCU settings -> Memory details”。按照下图所示编辑 Flash 字段,保持 RAM 不变。最后几个字段向链接器文件指示镜像必须在第一个闪存扇区之后寻址,以避免覆盖 OTAP 引导加载程序软件,如我们在本文简介中所述。 3- 解压 KW38 SDK 包。将 “main_text_section.ldt” 链接脚本从以下路径拖放到工作区的 “linkscripts” 文件夹中。结果应与下图类似。 \middleware\wireless\framework\Common\devices\MKW38A4\mcux\linkscript_bootloader\main_text_section.ldt 4- 在 MCUXpresso IDE 中打开位于 linkscripts 文件夹中的 “end_text.ldt” 链接脚本文件。找到下图所示的部分,并删除 “FILL” 和 “BYTE” 语句。BYTE 和 FILL 行用于用 0xFF 模式填充未使用的 NVM 闪存区域。删除此代码后,我们的软件镜像将不包含此模式,因此,镜像的总大小会减小,并提高 OTAP 下载速度和内存使用率。 5- 打开 “app_preinclude.h” 文件,将 “gEepromType_d” 定义为内部存储。这是一个必要的虚拟定义,用于将引导加载程序标志放置在正确的地址,因此,这不会影响你之前在 MCU 中编程 OTAP 客户端和 OTAP 引导加载程序软件时选择的存储方法。 /* Specifies the type of EEPROM available on the target board */ #define gEepromType_d gEepromDevice_InternalFlash_c 6- 在项目的 “framework” 文件夹中包含 “OtaSupport” 文件夹及其文件。同时在项目的 “framework -> Flash” 文件夹中包含 “External” 文件夹及其文件。“OtaSupport” 和 “External” 文件夹可在 SDK 中找到。你可以轻松地从 SDK 下载路径中拖动这些文件夹并将其放入 MCUXpresso 的工作区中。“OtaSupport” 和 “External” 文件夹位于: OtaSupport middleware\wireless\framework\OtaSupport External 中间件\无线\框架\Flash\External 结果应如以下图所示:  7- 依次进入 “Project -> Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU C Compiler -> Includes”。点击 “Include paths” 旁边的图标(见下图)。会弹出一个新窗口,然后点击 “Workspace” 按钮。 8- 在 “Folder selection” 窗口中展开项目目录,然后选择 “framework -> Flash -> External -> interface”(框架 -> 闪存 -> 外部 -> 接口)和 “framework -> OtaSupport -> interface” 文件夹。点击 “OK”按钮保存更改。 9- 确保 “OtaSupport” 和 “External” 文件夹已导入 “Include paths” 窗口中。然后点击 “Apply and Close” 按钮保存更改。 10- 点击此图标 保存并构建项目。然后,展开项目中的 “Binaries” 图标。右键点击 “.axf” 文件,选择 “Binary Utilities -> Create S-Record” 选项。生成的 S 记录文件将以 “.s19” 为扩展名保存在工作区的 Debug 文件夹中。将该 S 记录文件保存到智能手机上的已知位置。 使用 IoT Toolbox 应用程序测试 OTAP 客户端 本节介绍如何使用 IoT Toolbox 应用测试 OTAP 客户端软件。 1- 在你的智能手机上打开 IoT Toolbox 应用。选择 OTAP,然后点击 “SCAN” 以开始扫描合适的 OTAP 客户端设备。  2- 按下 FRDM-KW38 开发板上的 ADV 按钮 (SW2) 以开始广播。 3- 当你的智能手机找到 FRDM-KW38 开发板后,该设备将显示为 “NXP_OTAA”。将你的智能手机与此设备连接。随后,智能手机上会显示一个新窗口。  4- 点击 “Open” 按钮,查找 SREC 软件更新文件。 5- 点击 “Upload” 开始传输。等待下载完成。更新成功后,会显示确认消息。  6- 等待几秒钟,直到软件更新被编程到你的 MCU 中。新代码将自动开始运行。 如果对本主题有任何问题,请告知我。 BLE软件 千瓦 回复:KW38 - 使用 OTAP 客户端软件对 KW38 设备进行重新编程 嗨,EdgarLomeli   很多人无法使用 Google 应用商店,你能提供 IoT Toolbox 的最新 apk 安装包吗?  非常感谢。
View full article
Unable to debug i.MXRT1064 custom board. Hi,       I'm getting "Break at address "0x20d102" with no debug information available" message while trying to run my code in debug mode.       I'm using i.MXRT1064 custom board and programming it using, LinkServer LPC-Link2.       This board was working earlier without issue but now all of a sudden, this message appears.        I'm tried Release mode. I can successfully flash my board with the release code but then it seems the program doesn't run. I don't see any output, either from serial terminal or from display.       I also tried programming this board using Secure Provisioning Tool but it still doesn't work.         Can anyone help on where to focus or any leads for this issue? Re: Unable to debug i.MXRT1064 custom board. Hi MayLiu,        Thanks for your response.         Earlier, I did try that setting as suggested by you, but the IDE prompted an error (Failed to execute MI command: -target-download) when try to debug. I have attached a snapshot of that error for your reference.         Going back to the previous message, I wish to add that when I checked the address of where the current program is executing, it was showing that the code is in ROM region (address 0x20E35A). So somehow the code is unable to reach/start application code and is struck in ROM. Is my assumption correct? Can there be such a scenario? Re: Unable to debug i.MXRT1064 custom board. Hi @nxpsachve , Thank you so much for your interest in our products and for using our community. 1: Please try select Link application to RAM, then debug again. If your application can run successfully from RAM, please set the board as Serial Downloader mode, and then use the Secure Provisioning Tool to program your board by UART1 or USB1.   If your application  fails to run, I suggest you using an oscilloscope to check your board the power‑on sequence.   Wish it helps you. Best Regards MayLiu Re: Unable to debug i.MXRT1064 custom board. Hi @nxpsachve , I do not think MCUXpresso IDE  change BOOT configuration,  Boot behavior on NXP RT is determined by hardware boot config and boot mode pins.  Since the target can be detected in Serial Downloader mode, this indicates that the ROM is still running correctly. As a next step, you could: Perform a full chip erase, Switch the board to Internal Boot mode, and Try reconnecting with MCUXpresso IDE for debugging. Alternatively, you may also use the MCUXpresso Secure Provisioning Tool to program the application image. Best Regards MayLiu Re: Unable to debug i.MXRT1064 custom board. Hi MayLiu, Thanks for your suggestion. I would like to check if there are any such setting/configuration within MCUXpresso that can alter or impact the BOOT Conf? Just to rule out the IDE. The link server is able to detect the target when in serial download mode. Re: Unable to debug i.MXRT1064 custom board. Hi @nxpsachve , Thanks for your updated information. Based on the information you provided, it is possible that the CPU is currently executing code from the Boot ROM rather than your application code.   I would suggest checking the BOOT CFG and BOOT mode pin settings, ensuring that the device is configured to boot from user flash.   You may also try to set your board as serial downloader mode and then connecting via J-Link to confirm whether the debugger can  detect and communicate with the target.   Best Regards MatLiu
View full article
KSDKの例のリスト <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 現在のKSDK 1.3の例は、C:\Freescale\KSDK_1.3.0\examplesにあります。 C:\Freescale\KSDK_1.3.0\middleware の下にあるミドルウェア (tcpip、ファイルシステム) の例   他にも作成された例があります。   KSDK 1.3 (英語) KSDK 1.3 で FTM PWM を使用したレインボーカラー KDS3.0 + KSDK1.3でprintf()を使用して文字列をUARTに出力する方法 KSDKドライバーを使用した16x2 LCDの駆動 NFCコントローラーライブラリとKSDKの統合 KL43ZによるsLCDおよびKDS3.0 + KSDK1.3.0 +プロセッサエキスパートによるタッチセンスのサポート   KSDK 1.2 (英語) DMAを使用したKSDKによるADCフレキシブルスキャンモードのエミュレーション 初めてのKSDK1.2を書くKDS3.0 でのアプリケーション - Hello World と GPIO 割り込み付きトグル LED KSDKによるDCモータの速度制御とサーボモータの位置制御 [FTM + GPIO] KSDK搭載ラインスキャンカメラ [ADC + PIT + GPIO] フリースケール・カップ・スマート・レースのトラックの中心を検出する簡単な方法 Kinetis Design StudioのKSDKを使用したFatFs + SDHCデータロガー KSDKのセグメントLCDの例 KSDK GPIOドライバーとProcessor Expertの DAC Sinus Demo(PEx + KSDK 1.2 + KDS 3.0を使用) KSDKデモコードに基づいてカスタマイズされたKSDKプロジェクトを開始する方法   KSDK 1.1 (英語) SDKとCMSISを使用したKV31へのFIR機能実装のサンプルプロジェクト KDS 2.0 と KSDK 1.1.0 で LED を切り替える方法およびプロセッサエキスパート KSDK SPIマスタースレーブ(FRDM-K64F付き) Kinetisソフトウェア開発キット(KSDK)による超音波トランスデューサによる距離測定の設定(英語) Kinetis SDK 1.1.0用のUSB HID双方向汎用デバイスのデモ・プロジェクト 赤外線 (IR) センサで距離を測定するためのKinetisソフトウェア開発キット (SDK) の構成 KDSで初めてのKSDKアプリケーションの作成-Hello WorldとGPIO割り込み   KSDK 1.0 (英語) FRMD-K64F + KDS 1.1.0を使用した最初のトグルLEDアプリケーションの作成+ KSDK 1.0.0非プロセッサエキスパート SDKを使用した低消費電力アプリケーション KSDK I2C EEPROM の例 全般 Re:KSDKの例のリスト <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> これらの例はKSDK 2.0用に更新されますか - これらの例は廃止されたKSDKバージョン用です。 また、Processor Expertは明らかに時代遅れで、これ以上開発されることはないのでしょうか? 感謝 よろしくお願いします、デイブ
View full article
Example S32K144 FlexCAN Pretended Networking STOP mode test S32DS.ARM.2.2 ********************************************************************************  Detailed Description:  Example shows how to use FlexCAN 0 Pretended networking mode to allow FlexCAN  module to wake up MCU from STOP mode.  Wake up by Timeout and wake up by Match events are enabled.  Also pin interrupt can be used to exit STOP mode.  So MCU enters STOP mode by pressing SW3 button.  MCU exits STOP mode when one of following happens:  - no CAN message comes in 8sec (CAN PN timeout event)  - message with standard ID 0x554 or 0x555 comes (CAN PN match event)  - SW2 button is pressed (PTC12 interrupt)  In run mode blue LED is dimming and the rate is different for each wakeup event  ------------------------------------------------------------------------------  Test HW: S32K144 EVB-Q100  MCU: FS32K144UAVLL 0N57U  Fsys: 160MHz  Debugger: Lauterbach, OpenSDA  Target: internal_FLASH ******************************************************************************** General
View full article
CAN FDとCAN(動作していません) NXPコミュニティの皆様、こんにちは。 現在、CAN 構成に関する問題が発生しています。CAN 通信には基本設定を使用していますが、 PEAK CAN ViewerでCAN-FD モードを使用する場合にのみ機能します。ただし、標準のClassical CAN (非 FD) を試しても、応答がありません。 参考までに私のプロジェクトを添付しました。どなたか親切にレビューして、不足している構成や設定が見落とされているかどうか教えていただけませんか? 要約すると: CAN-FD + PEAK CAN Viewer :期待通りに動作 標準CAN + PEAK CANビューア:ボードからの応答なし ご提案やご指導をいただければ幸いです。 お手数ですが、よろしくお願いいたします。 よろしくお願いします、 ガネーシュ・バグワット Re: CAN FD and CAN(not Working) こんにちは、ジュリアン ご返信ありがとうございます。 最初はソフトウェアの構成の問題を疑ったので、ここに投稿しました。しかし、それは TJA1443 トランシーバ接続に関するハードウェア関連の問題であることが判明しました。フローティング ピンのため、通常の CAN では CAN メッセージを受信または送信できませんでしたが、FD ではなぜ動作していたのかはわかりません。 ハードウェアの問題を解決した後、すべてが期待どおりに動作するようになりました。 ご返信いただき、また、役に立つコミュニティ投稿を紹介していただき、改めて感謝申し上げます。 よろしくお願いします、 ガネーシャ Re: CAN FD and CAN(not Working) こんにちは@GaneshBhagwat PCAN-View ツールは、モード、ボーレート、サンプリング ポイントに対して正しく構成されていますか? バス上で表示されている内容を共有することは可能ですか?(ロジックアナライザまたはオシロスコープを使用して)フレームが正しく送信されているかどうかを確認するだけです。また、「機能していない」とはどういう意味か詳しく説明してください。受付時にコールバックを入力できますか?問題があるのはトランスミッションだけですか? CANInit 関数で、ID 0x80000 が受け入れ用に設定されていることがわかります。これが CAN アナライザーでも設定されているかどうかを確認してください。 このコミュニティ投稿を CAN 構成のガイダンスとして使用できます:例: S32K358 FlexCAN TXRX ISR S32DS35 RTD400/500 - NXPコミュニティ。 よろしくお願いします、 ジュリアン
View full article
KW47ナレッジハブ KW47 ファミリでは、96 MHz Arm® Cortex®-M33コアをBluetooth LEサブシステムとカップリングしています。この無線サブシステムは独立しており、コアやメモリも専用で、メインCPUの負荷を軽減するので、プライマリ・アプリケーションの分が保持され。また、ファームウェア・アップデートによる将来のワイヤレス標準のサポートも可能です。EdgeLock® Secure Enclave Core Profileを統合した高度なセキュリティのKW47は、NXPのEdgeLock 2GOクラウド・サービスによるサポートで認証情報の共有にも対応します。 KW47ファミリにはBluetoothのチャネル・サウンディング機能が搭載されており、オンチップの専用Localization Compute Engineで測距遅延を短縮します。アプリケーション固有のコード、コネクティビティ・スタック、OTA(Over-The-Air)ファームウェア・アップデートをサポートするための追加メモリも搭載されています。これにより、無線のリアルタイム動作がアプリケーションとは別のコアで実行されるため、信頼性の高いワイヤレス性能が得られます。 オートモーティブ・ソリューションを提供してきたNXPの豊富な経験に基づくKW47ファミリは、-40°C~125°Cの幅広い動作温度範囲と、車載アプリケーション向けペリフェラルを備えるほか、KW47は、長期使用をサポートするNXPの15年間の長期製品供給プログラムの対象ともなっています。 KW47シリーズは、MCUXpresso開発者エクスペリエンスによってサポートされ、組込みシステム開発の最適化、簡素化、迅速化に役立ちます。 KW47は製造開始前ですが、開発者はピンやソフトウェアの互換性があるKW45なら今すぐ使用を開始できます。       早期アクセスプログラム KW47早期アクセスプログラムはこちらKW47 Early Accessから参加できます。 アクセスのリクエストはNXPセールスチームまでご連絡ください。   チャネル・サウンディング チャネル・サウンディングご紹介プレゼンテーション CCC CS消費電力計算ツールあり(Excelファイル添付)   Bluetooth仕様 Bluetooth_5.0_Feature_Overview  Bluetooth_5.1_Feature_Overview Bluetooth_5.2_機能_概要 Bluetooth_5.3_機能_概要 Bluetooth_5.4_Feature_Overview Bluetooth_6_Feature_Overview   トレーニング Bluetooth Low Energy 6.0 NXPご紹介 RFスイッチの比較 吸収型と反射型 規格の比較 ETSI/FCC/ARIB要件 BLEチャネルサウンディング - 概要 BLEチャネル・サウンディング - RFハードウェア BLEチャネル・サウンディング - ANSYSモデリング・ツール BLEチャネル・サウンディング - アンテナのプロトタイプの検証測定 機器 ワイヤレス機器:この記事には、プロジェクト策定に役立つ機器へのリンクが掲載されています。 便利なリンク リファレンスデザイン - NXP Community KW45/KW47/MCXW71/MCXW72でのSignal Frequency Analyzer(SFA)モジュールを使用したクロック測定 - NXPコミュニティ:このコミュニティでは、Signal Frequency Analyzerの使用方法に関する手順を提示しています。 [MCUXSDK]KW4x、MCXW7x、MCXW2xにGitHub SDKを使用する方法 - NXPコミュニティ GitHub SDKの使用方法をステップ別に紹介しています。 [MCUXSDK]GitHub SDK - Bluetooth LEプラットフォームのドキュメント - NXPコミュニティ BLEプラットフォーム用ドキュメントを提供しています。  KW47(オートモーティブ)またはMCXW712(IIoT)を使用してPCBを初めて正しく構築するための最適な方法 - コミュニティ:このコミュニティには、KW45またはK32W148/MCXW71を使用してPCBを構築するための重要なリンクと、無線性能、低電力、無線認証(CE/FCC/ICC)に関するあらゆる情報があります。 HCI_bbをKinetisファミリ製品で使用してDTMモードにアクセスする方法:この記事は次の2つの部分に分かれています。 HCI_bbバイナリを Kinetis製品へフラッシュする方法。 R&S CMW270を使用してRF測定を行う BLE HCIアプリケーションによるトランスミッタ/レシーバテストコマンドの設定:この記事では、ユーザーはどのようにすればシリアルコマンドをデバイスに送信できるかを示す手順を説明します。 Bluetooth LE HCI Black Boxクイックスタートガイド:この記事では、ユーザーが無線をシリアルコマンドで制御できるようにするためのシンプルなプロセスを説明します。 Kinetis(K32/38/KW45およびK32W1/MCXW71)パワー・プロファイル・ツール:Kinetis(KW35/KW38/KW45)およびMCX W7x(MCX W71)パワー・プロファイル・ツールに的を絞ったページです。お使いのアプリケーション(自動車またはIoT)での電力消費量を試算したり、ソリューションのバッテリ寿命を評価したりするのに役立ちます。  
View full article
AR1335 相机传感器驱动程序 @kerryzhou 我想知道您是否使用过这种摄像头传感器:AR1335 与任何恩智浦 MCU 配合使用。如果是,请与我分享驱动程序源代码。 此致, 法里德 Re: AR1335 camera sensor driver 你好,法比奥, ,我正在使用 yocto。 您可以在此处找到最新的 ar1335 传感器内核驱动程序: https://github.com/nxp-imx/isp-vvcam/tree/lf-5.15.y_2.0.0/vvcam/v4l2/sensor/ar1335 如果使用 Yocto,除了上述isp-vvcam之外,还需要 isp-imx: 如果对源代码感兴趣,可以在 Ubuntu 主机上下载并执行 bin 文件获取: https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/isp-imx-4.2.2.20.0.bin 用你在电路板支持包中使用的版本替换版本(这里我们使用 v20) 以下是如何为另一个传感器部署驱动程序的示例:https://www.nxp.com/docs/en/application-note/AN13712.pdf Re: AR1335 camera sensor driver 你好,谢谢。我是新手,所以我的问题可能很愚蠢。 您使用的是 Debian 还是 Yocto?能否提供股票驱动程序的链接? Re: AR1335 camera sensor driver 你好,法比奥, 是的,我可以使用原版驱动程序。 到目前为止,我使用的是高清 1080p 分辨率。 计划过几天还将尝试 4K 及以上的分辨率。 Re: AR1335 camera sensor driver 您好。 我想知道你们是否成功地将 AR1335 摄像机与 Mx8 plus 相连接。 请 法比奥 Re: AR1335 camera sensor driver 嗨,迈克尔、 >>我已经使用恩智浦 iMX8M Mini SoC 运行了这个传感器 我对此非常感兴趣。你有可能提供源代码和设备树文件吗? 我正试图让iMX8M-plus 也能这样做,因为它与 iMX8M-plus 非常相似。 谢谢 MC Re: AR1335 camera sensor driver 嗨,迈克-帕特黑、 已经请我们的内部专家进行了仔细检查,并在您的新帖中给您回复。 如有任何新问题,请关注该新帖。 顺祝商祺! kerry Re: AR1335 camera sensor driver 谢谢你,凯瑞!我开设了一个新主题来讨论这个问题: https://community.nxp.com/t5/i-MX-RT/RT1170-Using-MIPI-CSI-with-grayscale-or-raw-image-sensors/m-p/1270310#M14031 Re: AR1335 camera sensor driver 嗨,迈克-帕特黑、 从 AE 的内部描述来看,是芯片 MIPI CSI 无法支持,而不是 SDK 的问题。 因此,参考手册将来会添加相关描述。 但如果要使用原始数据,则需要使用并行 CSI 接口,而不是 mipi-csi。 很抱歉给您带来不便。 顺祝商祺! kerry Re: AR1335 camera sensor driver 嗨,凯瑞、 这是否意味着 RT1176(准确地说是 OV9281,数据格式为 RAW8)无法使用 8 位单色灰度图像传感器?这是硬件的基本限制,还是 SDK 的问题,将来会得到修复? 我已经使用恩智浦 iMX8M Mini SoC 运行了这个传感器,它似乎使用了类似的 MIPI CSI 外设,但需要移植到 RT1176。 贝斯特,迈克尔 Re: AR1335 camera sensor driver 适用于 Jetson nano 的 AR1335 Linux 设备驱动程序: https://www.arducam.com/docs/camera-for-jetson-nano/mipi-camera-modules-for-jetson-nano/driver-installation/ Re: AR1335 camera sensor driver 你好,fmabrouk、 很抱歉迟迟没有回复。 只要得到内部的 AE 回复,这对你来说确实是一个悲惨的故事:由于 VIDEO_MUX 错误,MIPI-CSI2 无法支持原始数据,这些信息将添加到 RT1170 参考手册中。 因此,请检查外部 AR1335 是否可以配置为支持,例如RGB? 现在是 10bit 原始数据,确实没有解决方法。 很抱歉回复晚了,非常感谢你们的努力。 顺祝商祺! kerry Re: AR1335 camera sensor driver 论坛其他成员或恩智浦团队对我的问题是否有任何反馈。我真的没时间了,需要解决这个问题!如果可以,请提供帮助。 Re: AR1335 camera sensor driver @kerryzhou 我希望你一切都好!我只是想跟进一下,看看你们是否对我的问题有任何更新。 我再次需要帮助配置 CSI 驱动程序,这样我才能捕获每个输出像素数据的 10 位原始数据。捕获数据后,我可以使用自己的软件将数据转换为 RGB 888 格式。 谢谢! Re: AR1335 camera sensor driver 你好,凯瑞、 还有一件事我想告诉你,相机传感器的输出格式是 RAW10(10 位):RAW10(10 位),而在当前的恩智浦 CSI/相机驱动程序中,我没有看到支持这种格式。我只看到这些: /*!@brief 像素格式定义。*/ typedef enum _video_pixel_format { /* RGB */ kVIDEO_PixelFormatXRGB8888 = FSL_VIDEO_FOURCC('X','R','2','4'),/*!< 32 位 XRGB8888。*/ kVIDEO_PixelFormatRGBX8888 = FSL_VIDEO_FOURCC('R','X','2','4'),/*!< 32 位 RGBX8888。*/ kVIDEO_PixelFormatXBGR8888 = FSL_VIDEO_FOURCC('X','B','2','4'),/*!< 32 位 XBGR8888。*/ kVIDEO_PixelFormatBGRX8888 = FSL_VIDEO_FOURCC('B','X','2','4'),/*!< 32 位 BGRX8888。*/ kVIDEO_PixelFormatRGB888 = FSL_VIDEO_FOURCC('R','G','2','4'),/*!< 24 位 RGB888。*/ kVIDEO_PixelFormatBGR888 = FSL_VIDEO_FOURCC('B','G','2','4'),/*!< 24 位 BGR888。*/ kVIDEO_PixelFormatRGB565 = FSL_VIDEO_FOURCC('R','G','1','6'),/*!< 16 位 RGB565。*/ kVIDEO_PixelFormatBGR565 = FSL_VIDEO_FOURCC('B', 'G', '1', '6'), /*!< 16 位 BGR565。*/ kVIDEO_PixelFormatXRGB1555 = FSL_VIDEO_FOURCC('X','R','1','5'),/*!< 16 位 XRGB1555。*/ kVIDEO_PixelFormatRGBX5551 = FSL_VIDEO_FOURCC('R','X','1','5'),/*!< 16 位 RGBX5551。*/ kVIDEO_PixelFormatXBGR1555 = FSL_VIDEO_FOURCC('X','B','1','5'),/*!< 16 位 XBGR1555。*/ kVIDEO_PixelFormatBGRX5551 = FSL_VIDEO_FOURCC('B','X','1','5'),/*!< 16 位 BGRX5551。*/ kVIDEO_PixelFormatXRGB4444 = FSL_VIDEO_FOURCC('X','R','1','2'),/*!< 16 位 XRGB4444。*/ kVIDEO_PixelFormatRGBX4444 = FSL_VIDEO_FOURCC('R','X','1','2'),/*!< 16 位 RGBX4444。*/ kVIDEO_PixelFormatXBGR4444 = FSL_VIDEO_FOURCC('X','B','1','2'),/*!< 16 位 XBGR4444。*/ kVIDEO_PixelFormatBGRX4444 = FSL_VIDEO_FOURCC('B','X','1','2'),/*!< 16 位 BGRX4444。*/ /* YUV。*/ kVIDEO_PixelFormatYUYV = FSL_VIDEO_FOURCC('Y', 'U', 'Y', 'V'), /*!< YUV422, Y-U-Y-V.*/ kVIDEO_PixelFormatYVYU = FSL_VIDEO_FOURCC('Y','V','Y','U'),/*!< YUV422, Y-V-Y-U.*/ kVIDEO_PixelFormatUYVY = FSL_VIDEO_FOURCC('U','Y','V','Y'),/*!< YUV422, U-Y-V-Y.*/ kVIDEO_PixelFormatVYUY = FSL_VIDEO_FOURCC('V','Y','U','Y'),/*!< YUV422, V-Y-U-Y.*/ kVIDEO_PixelFormatXYUV = FSL_VIDEO_FOURCC('X', 'Y', 'U', 'V'), /*!< YUV444, X-YU-V.*/ kVIDEO_PixelFormatXYVU = FSL_VIDEO_FOURCC('X','Y','V','U'),/*!< YUV444, X-Y-V-U.*/ } video_pixel_format_t; 能否在应用程序代码中将 Raw10 转换为 RGB888? 我附上了一些数据表供你参考。 Re: AR1335 camera sensor driver 你好,fmabrouk、 感谢您提供的信息。 请耐心等待,我将检查您的代码的更多细节,并与我们内部的 CSI 专家核实。 在我得到任何有价值的信息后,我会尽快通知你们。 请再给我一些时间,非常感谢! 顺祝商祺! kerry Re: AR1335 camera sensor driver @kerryzhou @jingpan 我用示波器验证了相机传感器正在流式传输数据;在调试代码时我能够捕获 CSI 读取寄存器:请参阅随附的屏幕截图。但是,我无法获得全帧缓冲区 CSI 中断。这还是与我初始化 MIPI CSI 的方式有关,你或其他人能否根据我在上一封邮件中说明的图像要求,帮我正确设置一下? 干杯 Re: AR1335 camera sensor driver @kerryzhou 以下是我感兴趣的图像参数摘要:; [PLL 参数] ;目标 Vt 像素频率:220 MHz ;输入时钟频率:24 MHz;实际 Vt 像素时钟:220 MHz ;实际操作像素时钟:110 MHz ;pll_multiplier(M 值)= 55 ;pll_clk_div2(N 值)= 2 ;pll_multiplier2(M2 值)= 55;pll_clk_div2(N2 值)= 55 ;pll_clk_div2(N2 值)= 55 2 ;Fpfd = 12 MHz;Fvco = 660 MHz;Fvco2 = 660 MHz;Vt 系统分频器 = 1 ;Vt Pix 分频器 = 3 ;运算系统分频器 = 1;运算像素分频器 = 6 ;;[图像参数];每个请求的帧数 第二:30 ;输出列:640;输出行数:480 ;使用 Y 求和:未选中 ;仅限 X 的分箱:未选中 ;允许跳过:选中 ;空白计算:HB 最大,然后 VB ;;最大帧时间:33.3333 毫秒 ;最大帧时钟:7333333.3 clocks ; 读出模式:1,YSum:无,XBin: ; Horiz clks: 640 active + 1688 blank = 2328 total ; Vert rows:480 活动 + 2674 空白 = 总计 3154 ; 输出列:640 ; 输出行:480 ; FOV Cols:640 ; FOV 行:480 ; 实际帧时钟:7342512 个时钟 ; 行时间:10.582 usec / 2328 个时钟 ; 积分时间:33 毫秒。 ;帧时间:33.375055 毫秒 ;允许的最大帧速率:191.739fps ;每秒帧数:29.962 fps Re: AR1335 camera sensor driver @kerryzhou 我在 imx RT1170 上使用 mipi CSI2 演示代码从 AR1335 获取 480x640 图像。 我发现该相机传感器的输出格式为:10 位。我需要在 CSI 驱动程序中进行哪些更改才能捕获我需要的图像。 我使用制造商的工具生成了配置文件,但由于错误配置了 CSI 驱动程序,我还远远没有获得图像。 你能否建议需要在演示代码 CSI 驱动程序中修改哪些内容才能从 AR1335 捕获图像。 此致敬礼, Re: AR1335 camera sensor driver 你好,fmabrouk、 到目前为止,我们还没有关于导入其他相机传感器的直接文件。 据我所知,照相机传感器也应该有配置工具,可以进行配置并生成代码。 您的 AR1335 是否已经从自己的公司获得了相关驱动程序? 我还检查了内部,直到现在才找到 AR1335 RT 的相关驱动程序。 顺祝商祺! kerry Re: AR1335 camera sensor driver @kerryzhou 我正在使用这个摄像头传感器:imX RT1170 板上的 AR1335 而不是 OV5640。AR1335 只发送 10 位图像。我相信 OV5640 像素数据总线是 16 位。 如何修改恩智浦 SDK 随附的 mipi csi 演示代码,以便用该传感器获取图像? 我希望能有一些文档,指导如何将另一个相机传感器导入该演示代码。 非常感谢!   Re: AR1335 camera sensor driver 你好,fmabrouk、 关于你提到的时钟,你可以从 RT1170 参考手册中找到: 希望它能帮到你! 顺祝商祺! kerry Re: AR1335 camera sensor driver @kerryzhou @jingpan 除了我上面提出的问题外,如果我需要将像素时钟设置为 80MHz。在 imx RT1170 的 CSI2 mipi 演示代码中,我应该更改哪些寄存器? 谢谢! Re: AR1335 camera sensor driver @jingpan @kerryzhou 我仍在尝试将 AR1335 摄像头驱动程序移植到 ImX RT1170 CCI2 mipi 演示代码中。 在 CS2 mipi 代码中,我发现了这些时钟: CLOCK_SetRootClock(kCLOCK_Root_Csi2,&csi2CClockConfig); CLOCK_SetRootClock(kCLOCK_Root_Csi2_Esc,&csi2EscClockConfig); CLOCK_SetRootClock(kCLOCK_Root_Csi2_Ui,&csi2UiClockConfig); 谁能解释一下这些钟是用来做什么的? 谢谢! Re: AR1335 camera sensor driver 你好,fmabrouk、 到目前为止,我还没有找到有关 AR1335 的 RT 芯片驱动程序,我也在内部搜索过,但没有找到。 也许您可以从互联网上搜索,某些第三方可能有 AR1335 驱动程序。 Nxp 官方那边没有找到,直到现在,RT 主要使用 MT9M114 或 OV7725 摄像头模块。 很抱歉给您带来不便,并感谢您的理解。 顺祝商祺! kerry
View full article
S32M2xx - MOSFET switching adjustment for Motor control examples This article is applicable to all motor control application SWs as described in the following article. S32M2xx - Motor control use cases - NXP Community It has been found that on some of S32M24xEVBs an overheating of the power MOSFETs may occur. This will be addressed in the new release of the Motor control example SW and will be carried out in Motor control example SW for S32M24xEVB, S32M27xEVB and S32M276SFFRD. As a solution in the current release, the following settings are recommended. Extend deadtime: For S32M24xEVB, for FTM3, set Dead Time to 50 (corresponds to 625 nanoseconds): For S32M27xEVB and S32M276SFFRD, for LCU outputs channels 0 - 5, set LUT rise filter to 75 (corresponds to 625 nanoseconds): Set faster slew rates: Common for all EVBs:
View full article
Freescale Yocto Project main page Yoctoproject Framework Installing any Needed Package Using Yocto and i.MX Boards Testing Yocto for i.MX6 i.MX53 QSB - Quick Start Board i.MX6 Sabre Lite Board Build the image SDCard Image Yoctoproject Framework Yoctoproject is a framework for creating Linux distributions for embedded devices. Its layering mechanism makes it easy to add Linux to new target devices highly customized for a particular platform; it can include custom start-up scripts, software packages built with a high degree of optimization for a particular architecture, and different user interfaces from full Gnome desktop to a simple a serial console. Yocto has 2 basic layers: board support packages layer and core layer. In the BSP layer is where all the custom software and configuration tweaks for a particular platform are included, while the core layer provides the common software stack to provide from a simple command line interface to Sato desktop interface (Matchbox based and Gnome mobile software stack). A third layer could be added to provide additional user interfaces LXDE, XFCE, and more; YP is quite flexible&emdash;one of it major strengths. Installing any Needed Package Go to Yocto Project Quick Start and double check that you have all the necessary packages installed for your machine. For example, if building machine was an Ubuntu machine: $ sudo apt-get install gawk wget git-core diffstat unzip texinfo  build-essential chrpath libsdl1.2-dev xterm curl Using Yocto and i.MX Boards Please, go to project's README file in order to see the recommended instructions to download the source code. Testing Yocto for i.MX6 How to test Yocto for i.MX 6 i.MX53 QSB - Quick Start Board Edit conf/local.conf user config file and set imx53 Quick start board machine and enable parallel build features. MACHINE ?= "imx53qsb" BB_NUMBER_THREADS = "4" PARALLEL_MAKE = "-j 4" i.MX6 Sabre Lite Board Edit conf/local.conf user config file and set i.MX6 Sabrelite board machine and enable parallel build features MACHINE ?= "imx6qsabrelite" BB_NUMBER_THREADS = "4" PARALLEL_MAKE = "-j 4" if you've been facing problems to get yocto's images working on your i.MX Sabre Lite board, please take a look on this comment Re: The kernel sometins hang  in L3.0.35_4.0.0_130424 release Build the image some example of available image: image name description core-image-minimal A small image just capable of allowing a device to boot. core-image-base A console-only image that fully supports the target device hardware. core-image-sato Image with sato, a mobile environment and visual style for mobile devices.  The image supports X11 with a Sato theme, Pimlico applications and contains terminal, editor and file manager. fsl-image-test Builds contents core-image-base plus Freescale test applications and multimedia components. fsl-image-gui Builds contents of core-image-sato with Freescale test applications and multimedia with hardware accelerated X11 To build the image: $ bitbake Build using Dash instead can bring some problems. You can check what your system uses typing: "ls -l /bin/sh". On Ubuntu you can change it using "dpkg-reconfigure bash". Some Ubuntu releases you must use "dpkg-reconfigure dash" and choose Bash Built images are located in cd tmp/deploy/images SDCard Image sudo dd if=core-image-minimal-imx6qsabrelite.sdcard of=/dev/sdb i.MX Yocto Project: Frequently Asked Questions Yocto Project Re: Freescale Yocto Project main page All, we're closing this document for any further comments.  If you have a comment about this document or if you have an issue doing what the document describes, please start a new discussion.  Thanks. Re: Freescale Yocto Project main page Hello community, have an urgent need for input on touch screen integration. Please help! We're developing a project which requires touch screen function. The processor we use is i.MX6 dual light. Source code is Yocto 1.5. The LCD is working. We integrated the touch screen driver and can see on the computer that is connected to the board through serial port that touch screen reports coordinates for touches which indicates that touch screen does work. However, the system doesn't respond to touches. No icon displayed on the LCD is touched and the mouse arrow doesn't move with a finger touching the screen. Any advice where to look to see which part is broken? Thanks! Re: Freescale Yocto Project main page There's an error in the document, the part about dash.  You can check what your system uses typing: "ln -s /bin/sh" should probably be "ls -l /bin/sh" since "ln -s /bin/sh" would simply create a symbolic link in the current directory pointing to /bin/sh. Re: Freescale Yocto Project main page Please, LeonardoSandovalGonzalez, hkh and OtavioSalvador, create a new topic in imx.community. Please, remind to add all log available. With kernel version, MM version and branch name. It´s very difficult to us, hkh to provide support when the DOC has several comments on it. It´s much easier to start with a new and clear thread, with all the text futures it has in it (like quote, mark a answer as helpfull, as so on). Thanks in advance, Re: Freescale Yocto Project main page hkh, the issue you found regarding 'mesa' has been fixed in OE-Core and Poky yesterday. You can drop this change from meta-fsl-arm and it will work just fine. I am not a good person to help with GStreamer stuff. LeonardoSandovalGonzalez, can you take a look here? Re: Freescale Yocto Project main page Hello, I am using a Boundarydevices Nitrogen6x with a iMX6 Solo processor. I followed Daiane’s instruction to build my Yocto Dora image. I was able to build core-image-base, but had a problem with fsl-image-test. I found the following issue and applied the change manually (it must not be in the branch since sync was not retrieving the patch): https://lists.yoctoproject.org/pipermail/meta-freescale/2014-April/008057.html Also, I used menuconfig to disable ov5642 and enable ov5640. I can build the images, but can’t use gstreamer. I keep getting this error: ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0 VIDIOC_DQBUF failed. ERROR: v4l2 capture: VIDIOC_QBUF: buffer already queued VIDIOC_QBUF failed I know my hardware works because with the Timesys demo SD Card that came with the board I can use the following command to display the MIPI camera image on the LCD: $ gst-launch mfw_v4lsrc capture-mode=5 ! mfw_v4lsink disp-width=1280 disp-height=800 I have tried many gstreamer commands, and they all fail with the same error. One example is: $ gst-launch mfw_v4lsrc ! mfw_v4lsink I tried adding capture-mode=4 to the above command, and I get the same error. Are you aware of any issue with the latest Yocto Image that would cause this problem (something similar to the patch above that I had to apply)? What else can I try? Here is the complete snapshot of the error I am getting: root@nitrogen6x:~# gst-launch mfw_v4lsrc ! mfw_v4lsink MFW_GST_V4LSRC_PLUGIN 3.0.9 build on Apr 16 2014 09:57:53. pwm_config: pwm freq = 22000000, clk_select=1 clock_rate=66000000 ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xa9 MFW_GST_V4LSINK_PLUGIN 3.0.9 build on Apr 16 2014 09:57:39. Setting pipeline to PAUSED … pwm_config: pwm freq = 22000000, clk_select=1 clock_rate=66000000 ov5640_mipi_camera_powerdown: powerdown=0, power_gp=0xa9 Pipeline is live and does not need PREROLL … Setting pipeline to PLAYING … New clock: GstSystemClock ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0 ERROR: from element /GstPipeline:pipeline0/MFWGstV4LSrc:mfwgstv4lsrc0: Internal data flow error. Additional debug info: /yocto/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer/0.10.36-r2/gstreamer-0.10.36/libs/gst/base/gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:pipeline0/MFWGstV4LSrc:mfwgstv4lsrc0: streaming task paused, reason error (-5) Execution ended after 10004586509 ns. Setting pipeline to PAUSED … Setting pipeline to READY … Setting pipeline to NULL … Total rendered:0 Freeing pipeline … [—>FINALIZE v4l_sink root@nitrogen6x:~# ov5640_mipi_camera_powerdown: powerdown=1, power_gp=0xa9 root@nitrogen6x:~# Thanks, Re: Freescale Yocto Project main page look under "sources" you will see "sources/meta-fsl-arm" "sources/meta-fsl-demos" "sources/poky" Re: Freescale Yocto Project main page Hi All, I want to know where exactly the actual source code will reside after "repo sync", since I see only bitbake, patch and *.inc files under source directory. Please let me know. Thank you, Gautham Re: Freescale Yocto Project main page After: $ source setup-environment build the local.conf file will be placed inside /build/conf/local.conf Re: Freescale Yocto Project main page Thanks DaianeAngolini Please let me know where can i find local.conf file, in fsl-community-bsp Folder tree after repo and clone fsl-community-bsp -> sources--------------------------------- > base                                 README                                  meta-fsl-arm                                 setup-environment                      meta-fsl-arm-extra                                                                                  meta-fsl-demos                                                                                  meta-openembedded                                                                                  poky Thanks Ram Re: Freescale Yocto Project main page The only difference would be the machine name to place in local.conf. Re: Freescale Yocto Project main page Hi All, I want to boot my Imx6q Sabre AI board with Yocto, can I follow the same steps suggested in this post, if not please suggest a thread/link that i can follow to achieve this. Thanks Ram Re: Freescale Yocto Project main page if you got  a custom board, why are you using a mx53qsb machine? unless the board is the same, you need to create your own board layer with proper changes. Leo Re: Freescale Yocto Project main page got a fsl-image-gui to compile for mx53qsb. I have a customboard with an attached LVDS lcd, but both vga as lcd remain black on boot. I attached a serial cable but only get gibberish over this (non-ascii characters). Does anyone know 1) where to find info on how to configure LVDS lcd and 2) where to configure tty/console so i can check my settings and actually see what's happening when I try the image Re: Freescale Yocto Project main page BrianEdmond, what branch are you using? The default distribution used on yocto (and meta-fsl-arm) is poky.conf. And by default X11 is selected. If you´re using master, you can override your DISTRO_FEATURES and remove X11. Take a look on poky.conf file under source Re: Freescale Yocto Project main page I did a build of fsl-image-test and it boots but I still seem to have an OpenGL ES environment which required X11.  In other builds I had a libGAL and libgal-fb which had the fbGetDisplayByIndex calls so I could run with fbdev.  Is there a configuration option I am missing? Brian Re: Freescale Yocto Project main page Thanks Nick. I have corrected the verbatim, adding the curl package. Leo Re: Freescale Yocto Project main page Ok if both packages are prerequisites then please change the text for the Ubuntu command in the section above entitled "Installing any Needed Package" to: $ sudo apt-get install gawk wget git-core diffstat unzip texinfo \   build-essential chrpath libsdl1.2-dev xterm curl This would help new users who need to be able to follow the instructions verbatim Nick Re: Freescale Yocto Project main page You can use both for downloading the repo app. Both packages are requisites. Leo Re: Freescale Yocto Project main page In the prerequisites for an Ubuntu Machine there is sudo apt-get install wget but in the fsl-community-bsp-platform/README there is $: curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo Should this instead be $: wget https://dl-ssl.google.com/dl/googlesource/git-repo/repo -O ~/bin/repo or should curl be added as a prerequisite? Re: Freescale Yocto Project main page All ugly hacks. He might use: sed after every sync (as he did) use local_manifests.xml use gitconfig 'insteadOf' configuration all hacks! better to fix the firewall. Re: Freescale Yocto Project main page OtavioSalvador, any other workaround you know to avoid the issue that Nick found? Leo Re: Freescale Yocto Project main page It seems that to change the repo from using the git protocol to using the http prtocol can be achieved as follows: $ sed -i 's/git:/http:/g' .repo/manifest.xml $ sed -i 's|yoctoproject.org|yoctoproject.org/git|g' .repo/manifest.xml I hope this helps others who are experiencing problems when following the supported BSP installation process from behind firewalls that do not support git Re: Freescale Yocto Project main page Further investigation reveals that the url http://git.yoctoproject.org/git/meta-fsl-arm works Re: Freescale Yocto Project main page No idea Nick. You need to talk to the admin guy Re: Freescale Yocto Project main page Yes a 'git clone http://git.yoctoproject.org/meta-fsl-arm' confirms that the meta-fsl-arm committers are not running git update-server-info so http access does not work. Until this is fixed I will use a zip archive Re: Freescale Yocto Project main page Might use 'git clone' to check git command. Re: Freescale Yocto Project main page Thank you for the information on how to get started with the new Yocto based Freescale BSPs. Could you please assist me with a problem fetching the repositories? It appears that protocols/ports other than HTTP are blocked by the corporate firewall. Changing to HTTP though results in errors finding the info subdirectory. Can you please suggest a resolution to this problem? The output from repo is as follows: $ ./repo sync fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to git.yoctoproject.org: git.yoctoproject.org[0: 140.211.169.56]: errno=Connection timed out fatal: unable to connect to git.yoctoproject.org: git.yoctoproject.org[0: 140.211.169.56]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out fatal: unable to connect to github.com: github.com[0: 207.97.227.239]: errno=Connection timed out error: Cannot fetch meta-fsl-arm error: Cannot fetch meta-fsl-arm-extra error: Cannot fetch meta-fsl-demos error: Cannot fetch fsl-community-bsp-base fatal: unable to connect to git.openembedded.org: git.openembedded.org[0: 140.211.169.152]: errno=Connection timed out fatal: unable to connect to git.openembedded.org: git.openembedded.org[0: 140.211.169.152]: errno=Connection timed out error: Cannot fetch meta-openembedded error: Exited sync due to fetch errors $ sed -i 's/git:/http:/g' .repo/manifest.xml $ ./repo sync Fetching projects:  16% (1/6)  fatal: http://git.yoctoproject.org/meta-fsl-arm/info/refs not found: did you run git update-server-info on the server? Fetching projects:  66% (4/6)  fatal: http://git.yoctoproject.org/poky/info/refs not found: did you run git update-server-info on the server? fatal: http://git.yoctoproject.org/meta-fsl-arm/info/refs not found: did you run git update-server-info on the server? fatal: http://git.yoctoproject.org/poky/info/refs not found: did you run git update-server-info on the server? error: Cannot fetch meta-fsl-arm error: Cannot fetch poky error: Exited sync due to fetch errors $ Re: Freescale Yocto Project main page Hi Thomas, sorry for the confusion but this document should not be used to build Freescale Yocto layers, please refer to this document How to test yocto for imx6 Repeat the steps, and try to build the same core image. If error persists, please send the description/log to the meta-freescale distribution list. Re: Freescale Yocto Project main page Hi Leonardo Sandoval Gonzalez, Met same error as Eduardo Gorio in busybox,. So, Freescale will support repo way for our build only? Either or customize build for our own board? BR Thomas Re: Freescale Yocto Project main page Hi gorio, please post your question on the meta-freescale mailing list. Check this document for instructions. Re: Freescale Yocto Project main page What does it wrong ? I did step by step from this tutorial.. gorio@ubuntu:/opt/poky/build$ bitbake core-image-minimal Loading cache: 100% |############################################################| ETA:  00:00:00 Loaded 1600 entries from dependency cache. Build Configuration: BB_VERSION        = "1.17.1" BUILD_SYS         = "x86_64-linux" NATIVELSBSTRING   = "Ubuntu-10.04" TARGET_SYS        = "arm-poky-linux-gnueabi" MACHINE           = "imx53qsb" DISTRO            = "poky" DISTRO_VERSION    = "1.3+snapshot-20130308" TUNE_FEATURES     = "armv7a vfp neon" TARGET_FPU        = "vfp-neon" meta              meta-yocto        = "master:d823759b4594143d522eae0b2a2498436a6dcb1e" meta-oe           = "master:6c9ac38e8b998e6739383ba91e0c4e0c0ed0094b" meta-fsl-arm      = "master:a502be66bef33f2016b43f8c7129b18f92d6e337" NOTE: Resolving any missing task queue dependencies NOTE: Preparing runqueue NOTE: Executing SetScene Tasks NOTE: Executing RunQueue Tasks ERROR: Function failed: do_configure (see /opt/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/busybox/1.20.2-r6/temp/log.do_configure.23360 for further information) ERROR: Logfile of failure stored in: /opt/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/busybox/1.20.2-r6/temp/log.do_configure.23360 Log data follows: | DEBUG: Executing python function sysroot_cleansstate | DEBUG: Python function sysroot_cleansstate finished | DEBUG: Executing shell function do_configure | trap: 80: SIGHUP: bad trap | ERROR: Function failed: do_configure (see /opt/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/busybox/1.20.2-r6/temp/log.do_configure.23360 for further information) ERROR: Task 914 (/opt/poky/meta/recipes-core/busybox/busybox_1.20.2.bb, do_configure) failed with exit code '1' NOTE: Tasks Summary: Attempted 1030 tasks of which 1026 didn't need to be rerun and 1 failed. Waiting for 0 running tasks to finish: Summary: 1 task failed:   /opt/poky/meta/recipes-core/busybox/busybox_1.20.2.bb, do_configure Summary: There was 1 ERROR message shown, returning a non-zero exit code. gorio@ubuntu:/opt/poky/build$ Re: Freescale Yocto Project main page Please refer to the bellow link to check the community supported way to build Freescale Yocto layers How to test yocto for imx6 Re: Freescale Yocto Project main page I'll update the page above soon. Meanwhile, I suggest you to use the instructions located at: Freescale/fsl-community-bsp-platform · GitHub For i.MX53 platform, use the denzil branch, for i.MX6, use the master branch. Rgds Rogerio Re: Freescale Yocto Project main page Hi Thanks a lot for the information. I tried to use the instruction above to build image for iMX6q SabreLite, but I've got a error below when I try to do "bitbake core-image-minimal" ================================= Summary: There were 2 WARNING messages shown. Summary: There were 2 ERROR messages shown, returning a non-zero exit code. WARNING: Host distribution "Ubuntu 10.10" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution. Loading cache: 100% |###########################################| ETA:  00:00:00 Loaded 1160 entries from dependency cache. ERROR: No recipes available for:   /home/its/poky/meta-fsl-arm/recipes-core/udev/udev_173.bbappend ERROR: Command execution failed: Exited with 1 ===================================== Anybody can help? I am very new to Yocto/bitbake, we used to build image by using ltib, Thanks a lot.
View full article
Using the HiFi DSP for Inferencing ML Models on i.MX RT Devices This article will describe how to use the HiFi modules found on certain NXP microcontrollers as an optional method for inferencing a model.  There are several ways of running a TFLite neural network model on NXP microcontrollers: Inference a model only using the main core of the device (CM33 or M7) MCX N i.MX RT1050 i.MX RT1060 i.MX RT1170 i.MX RT1180 i.MX RT595 i.MX RT685 i.MX RT700 Inference a model directly on the HiFi4 or HiFi1 core (on supported platforms) i.MX RT595 i.MX RT685 i.MX RT700 Use the Neutron NPU to accelerate inference of a model - with the CM33 controlling the NPU and acting as a fallback for any non-NPU supported layers i.MX RT700 MCX N Use the Neutron NPU to accelerate inference of a model - with the HiFi4 controlling the NPU and acting as a fallback for any non-NPU supported layers i.MX RT700   This article will cover options #2 and #4 which make use of the HiFi DSP module. Running a model on the HiFi4 (option #2) will be much faster than running a model just on the CM33/M7 (option #1). However using the NPU (options #3 and #4) will be significantly faster than only using the DSP due to the hardware optimizations that an NPU provides for neural network calculations. The exact performance gains will be model specific, and also depend on the layer(s) that may not have been converted to use the NPU as NeutronGraph nodes. The accuracy should remain the very similar regardless of method being used. Any type of TFLite neural network model can be ran on the HiFi1/HiFi4 as those DSP modules are just being used accelerate the neural network math that the model uses. Below are the inference times of a CIFAR10 model on i.MX RT700 with different hardware modules used to inference the model (using default MCUXpresso SDK projects).  CM33: 103.653ms HiFi1*: 19.007ms HiFi4: 12.312ms NPU w/ CM33 Fallback: 0.883ms NPU w/ HiFi4 Fallback: 0.883ms *HiFi1 max frequency is 250MHz. All others are run at 325MHz.   Software requirements: Go to the Cadence i.MX RT700 or Cadence i.MX RT685 pages to download the following software. Xtensa Xplorer IDE License Key HIFI DSP Configuration File (NEWLIB) If using a HiFi4 example then download the HiFi4 license and DSP configuration files. Likewise, if using a HiFi1, then will need the HiFi1 license and DSP configuration files. Also you will need to download the Windows or Linux version of these files depending on which host OS you are using on your PC. Finally add the following global system variables which should be set based on the location that Xtensa Explorer was installed (assuming RT700 with HiFi4): XCC_DIR= \XtDevTools\install\tools\RI-2023.11-win32\XtensaTools XTENSA_CORE= rt700_hifi4_RI23_11_nlib MCUXpresso SDK HiFi ML Examples: There are several HiFi related examples in MCUXpresso SDK for i.MX RT700: tflm_cifar10 – Uses Neutron NPU to inference the CIFAR10 model and uses the CM33 as the fallback for any non-NPU operators. tflm_cifar10_hifi1 – Uses HiFi1 to inference the CIFAR10 model. Does not use the Neutron NPU tflm_cifar10_hifi4 – Uses HiFi4 to inference the CIFAR10 model. Does not use the Neutron NPU tflm_cifar10_hifi4_neutron – Uses Neutron NPU to inference the CIFAR10 model and uses the HiFi4 as the fallback for any non-NPU operators. tflm_label_image – Uses Neutron NPU to inference the CIFAR10 model and uses the CM33 as the fallback for any non-NPU operators. tflm_label_image_hifi4 - Uses HiFi4 to inference the Mobilenet model. Does not use the Neutron NPU When using the HiFi eIQ projects provided in MCUXpresso SDK, ensure that the SDK is: Located in a short filename path (ie C:\nxp\RT700), as an excessively long filename path can cause compile issues Directory path contains no spaces If using VS Code import as a Repository project instead of Free Standing. Ensure using at least MCUXPresso SDK 26.09 as there are several important fixes in the 26.09 release for HiFi4 projects HiFi4 with Neutron: If using the cifar10_hifi_neutron example and you want to change the model, then the model needs to be converted using the --target imxrt700 option for Neutron Compiler. The Neutron libraries then need to be updated using the files in the \target\imxrt700\rt700\hifi4\RJ-2025.5 folder and copied into mcuxsdk\middleware\eiq\neutron\rt700\hifi4 The Neutron libraries in the hifi\RI-2021.6 folder are provided to provide compatibility with an older version of the Xtensa tools and are not recommended for new designs. Extending Memory Area in HiFi4 Examples for Larger Models: Open:  Github SDK Layout: \mcuxsdk\examples\_boards\mimxrt700evk\eiq_examples\tflm_cifar10_hifi4_neutron\linker\hifi4\gdbio\ldscripts\elf32xtensa.x Classic SDK Layout: \boards\mimxrt700evk\eiq_examples\tflm_cifar10_hifi4_neutron\linker\hifi4\min-rt\ldscripts\elf32xtensa.x  And make modifications below to extend the memory used for models.  dsp_core_seg :  org = 0x20200000, len = 0x200000  dsp_core_ncache_seg :  org = 0x20400000, len = 0x180000    _memmap_mem_dsp_core_start = 0x20200000;  _memmap_mem_dsp_core_end   = 0x20580000;  _memmap_seg_dsp_core_start = 0x20200000;  _memmap_seg_dsp_core_max   = 0x20580000;     Ensure that the stack heap is at 0x2058_0000:    PROVIDE(__stack = 0x20580000);    _heap_sentry = 0x20580000;      Now larger models will compile successfully in Xtensa.    Then after copying in the compiled HiFi4 binary files into the MCUXpresso IDE project, modify dsp_config.h file to update the DSP_SRAM_ADDRESS:  Github SDK Layout: \mcuxsdk\examples\_boards\mimxrt700evk\eiq_examples\tflm_cifar10_hifi4_neutron\dsp_config.h  Classic SDK Layout:  \boards\mimxrt700evk\eiq_examples\tflm_cifar10_hifi4_neutron\cm33_core0\dsp_config.h (or source\dsp_config.h in MCUXpresso IDE)  Then clean and build the project.  Mlongcalls (MCUXpresso SDK 26.06 or earlier): In older MCUXpresso SDK versions there was a compiler issue where -mlongcalls needs to be used to avoid issues when adding additional operators to the operators list. This modification is no longer needed in MCUXpresso SDK 26.09 or later.  Inside \mcuxsdk\examples\_boards\mimxrt700evk\eiq_examples\tflm_cifar10_hifi4\hifi4 edit the reconfig.cmake file in the mcux_add_xtensa_configuration options: mcux_add_xtensa_configuration( CC "-DXOS_CLOCK_FREQ=237500000 -std=c99 -mlongcalls" CX "-stdlib=libc++ \ -mlongcalls \ -std=c++17" )  HiFi Lab: See the attached lab document for more details on using the HiFi DSP modules to inference models.    
View full article
System Controller Firmware 101-はじめに 評価キットを使用する際には、BSPに含まれるSystem Controller Firmware(SCFW)バイナリが提供されます。このscfwバイナリはそのボード専用に調整されており、ご使用のハードウェアに合わせてボード依存部分を変更する必要がある場合があります。 本書ではSCFWのポーティング手順の概要を説明します。詳細についてはSystem Controller Porting guide(sc_fw_port.pdf)を参照してください。 システムを設定する SCFWはLinuxホスト上でビルドされます。システムをセットアップする手順は次のとおりです: GNU ARM Embedded Toolchain: 6-2017-q2-update June 28, 2017をARM websiteからダウンロードします: ファイルを展開するディレクトリを選択します。例: mkdir ~/gcc_toolchain cp ~/Downloads/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 ~/gcc_toolchain/ cd ~/gcc_toolchain/ tar xvjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ツールチェーンを含むディレクトリ(上記例では"~/gcc_toolchain")を指すようTOOLS環境変数を設定します。.bash_profileを編集してこの環境変数をexportすることもできます: export TOOLS=~/gcc_toolchain/ srec_catもビルドに必要です。これは通常srecordパッケージに含まれており、ubuntuでは次のように実行します: sudo apt-get update sudo apt-get install srecord これでポーティングキットのディレクトリ(例:scfw_export_mx8qm)に移動し、scfwをビルドできます。 System Controller Firmwareポーティングキット SCFW 移植キットには、SCFW をお客様のボードで動作するように変更できるソースファイルとオブジェクトファイルが含まれています。 最新のSystem Controller Firmwareポーティングキットは i.MX Software and development webpageから入手できます: ポーティングキットを入手したら展開します: tar xvzf imx-scfw-porting-kit-1.1.tar.gz‍ 次のようなファイル構成が表示されます: ポーティングキットはpackages以下に含まれており、READMEに展開手順が記載されています。基本的には: cd packages/ chmod a+x imx-scfw-porting-kit-1.1.bin ./imx-scfw-porting-kit-1.1.bin‍‍‍ エンドユーザーライセンス契約の同意を求められます: 同意するとポーティングキットは新しいフォルダに展開されます。フォルダ構成は次のとおりです: SCFWに関するドキュメントはdoc/pdfにあるか、html形式で提供されています。sc_fw_port.pdfに目を通すことを推奨します。 異なるSoCバリアント(QM A0、QM B0、QXP B0)のポーティングキットはsrcにtar.gzとして格納されています。その他のファイルはLinux、QNX、FreeRTOS、U-boot、ARM Trusted Firmwareなど向けのSCFWライブラリです。 複数のSoCバリアント(QXPとQMの両方など)で作業する場合は、すべてのポーティングキットを1つのディレクトリに展開することを推奨します。これにより、そのディレクトリから任意のバリアント向けにビルドできます。実行コマンドは次のとおりです: cd imx-scfw-porting-kit-1.1/ cd src/ find scfw_export_mx8*.gz -exec tar --strip-components 1 --one-top-level=scfw_export_mx8 -xzvf {} \;‍‍‍ scfw_export_mx8フォルダが作成され、ここからサポートされている任意のバリアント向けにSCFWをビルドできます。または、目的のバリアントのパッケージだけを展開して使用することもできます。 cd scfw_export_mx8/‍ すべてのビルドフォルダーには、SCFWのビルド結果が含まれており、プラットフォームにはSCFWのソースが保存されています。 ボード固有のコードはすべて「platform/board/mx8_」にあります。ここでderivativeはQXPやQMなどのi.MX8シリコンファミリ、board_nameはSCFWパッケージの対象ボード名です。 SCFWをお使いのボードにポーティングする最初のステップは、i.MX8のderivativeとボード用のフォルダを作成することです。既存のボード例をコピーしてフォルダ名を変更すると、すぐに開始できるプロジェクトが得られます。例: cp -r platform/board/mx8qm_val/ platform/board/mx8qm_myBoard/‍‍‍‍‍‍‍‍‍‍ この例のボードは「myBoard」と呼ばれ、i.MX8QM B0 デバイス用です。このボード用の SCFW を構築するには、単に次のコマンドを呼び出してください。 make qm R=B0 B=myBoard‍‍‍‍‍‍‍‍‍‍‍‍ ターゲットがi.MX8QXPの場合は、このデバイスをベースにしたボードを選び、「make qx」を実行するだけです。 ビルドオプションや詳細なブート情報などの追加情報はSCFWポーティングガイド(sc_fw_port.pdf)に記載されています。本書の第2章はポーティングプロセスの優れた入門です。 概要と有用な情報 PMICの設定概要およびboard.c一般的な修正 変更が必要な主なファイル(場合によっては唯一)は「board.c」で、場所は「platform/board/mx8X_board/」です。board.cファイルにはSCU UARTポート、PMIC初期化ルーチン、PMIC温度アラーム設定などボード関連情報のほとんどが含まれており、LDO電圧を設定したりPMICと通信するように変更することもできます。board.c内のすべての関数はSCU自身によって実行されるため、PMICとの通信に使用されるI2Cインターフェースにアクセスできます。 外部電源(たとえばPMIC LDO)で駆動されるSoCリソース(APコアやGPUなど)はboard_set_power_modeによってオン/オフされ、リソースを特定のPMIC電源にマッピングする処理はboard_get_pmic_infoで行われます。例としてi.MX8QMバリデーションボードでは、A53サブシステムがPF100 PMICカードの3番目のPMIC(PMIC_2_ADDR、アドレスはPMIC_0から開始)のSW2とPF8100 PMICカードの1番目のPMIC(PMIC_0_ADDR)のSW5により給電されます。 case SC_SUBSYS_A53: pmic_init(); if (pmic_card == PF100) { pmic_id[0] = PMIC_2_ADDR; pmic_reg[0] = SW2; *num_regs = 1; } else {/* PF8100_dual Card */ pmic_id[0] = PMIC_0_ADDR; pmic_reg[0] = PF8100_SW5; *num_regs = 1; } break; ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 外部電源で駆動されるSoCリソース(APコア、GPUなど)の電圧はboard.c内のboard_set_voltageで管理されます。リソースと電源のマッピングは前述のとおりboard_get_pmic_infoで行われます。 8個の「ボードリソース」(SC_R_BOARD_R0〜SC_R_BOARD_R7)が利用可能で、これらを用いてSCUが管理できるボード上のコンポーネントを定義できます。たとえばPMICのLDOの1つで駆動されるセンサをボードリソースにマッピングし、board.cを変更してセンサの電源オン/オフや電圧変更を行えます。 ボードリソースの電圧変更は、board_trans_resource_powerで電圧を設定するか、実行時に電圧を変更する必要がある場合はboard_set_controlを修正して、Miscellaneous Service 101で説明されているミスレニアスコールがそのリソースに対して発行されるたびに電圧を変更します。たとえばSC_R_BOARD_R7の電圧を変更する場合、board_set_controlに以下のcaseを追加します: case SC_R_BOARD_R7: if (ctrl == SC_C_VOLTAGE) { /* Example only PMIC_X_ADDR and PMIC_SUPPLY need to match an actual device */ pmic_interface.pmic_set_voltage(PMIC_X_ADDR, PMIC_SUPPLY, val, step); } else return SC_ERR_PARM; break;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 上記のcaseはアプリケーションが次の関数を呼び出すたびにSCUによって実行されます。 sc_misc_set_control( ipc, SC_R_BOARD_R7, SC_C_VOLTAGE, voltage_val);‍‍‍‍‍‍‍‍ ボードリソースの電源オン/オフはboard.c内のboard_trans_resource_powerで行われます。例えばNXPのバリデーションボードでは、ボード上のPTN5150はボードリソース0で管理され、電源のオン/オフは次のように制御されます: case BRD_R_BOARD_R0 : /* PTN5150 (use SC_R_BOARD_R0) */ if (pmic_ver.device_id == PF100_DEV_ID) { if (to_mode > SC_PM_PW_MODE_OFF) { pmic_interface.pmic_set_voltage(PMIC_2_ADDR, VGEN6, 3300, SW_RUN_MODE); pmic_interface.pmic_set_mode(PMIC_2_ADDR, VGEN6, VGEN_MODE_ON); } else { pmic_interface.pmic_set_mode(PMIC_2_ADDR, VGEN6, VGEN_MODE_OFF); } } else {/* PF8100_dual Card */ if (to_mode > SC_PM_PW_MODE_OFF) { pmic_interface.pmic_set_voltage(PMIC_1_ADDR, PF8100_LDO1, 3300, REG_RUN_MODE); pmic_interface.pmic_set_mode(PMIC_1_ADDR, PF8100_LDO1, RUN_EN_STBY_EN); } else { pmic_interface.pmic_set_mode(PMIC_1_ADDR, PF8100_LDO1, RUN_OFF_STBY_OFF); } } break;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ アプリケーション側で以下の関数が呼び出されるたびに、SCUは上記のコードを実行します: sc_pm_set_resource_power_mode(ipc, SC_R_BOARD_R0, SC_PM_PW_MODE_ON/OFF);‍‍‍‍‍‍‍‍ board_config_scは、I2CモジュールやPMICとの通信に使用されるパッドなど、SCUが必要とするリソースをマーキングするために使用します。board.cの関数が動作するために必要なリソースは、本関数で移動不可に設定する必要があります。例えばSCUのI2Cモジュールを保持するには、次の行を追加します: rm_set_resource_movable(pt_sc, SC_R_SC_I2C, SC_R_SC_I2C, false);‍‍‍‍‍‍‍‍‍ 以下のパッドはSCUに属しており、アプリケーションからはアクセスできません: - SC_P_SCU_PMIC_MEMC_ON - SC_P_SCU_WDOG_OUT - SC_P_PMIC_EARLY_WARNING - SC_P_PMIC_INT_B - SC_P_SCU_BOOT_MODE0〜SC_P_SCU_BOOT_MODE5 board_system_configは初期リソース管理を行う関数で、イメージ内でalt_configフラグが設定されている場合にのみ呼び出され、パーティションを作成してリソースを割り当てることができます。詳細はResource Management Service 101を参照してください。 board_get_pcie_clk_srcはPCIeが使用するクロックを定義し、BOARD_PCIE_PLL_EXTERNALまたはBOARD_PCIE_PLL_INTERNALのいずれかを指定できます。 board_printは変更内容のデバッグに非常に便利で、構文は次のとおりです: board_print(3, "Debug printout %d\n", val);‍‍‍‍‍‍‍ 最初のパラメータがデバッグレベルで、それ以降は標準printfと同様に動作します。出力はSCUが対応するデバッグレベルでビルドされている場合にのみSCUのデバッグ出力で確認できます。上記の例では出力を表示するためにSCFWを次のようにビルドする必要があります: make qm B=myBoard‍‍‍‍ DL=3 or higher (debug level goes from 0 to 5)‍‍‍‍‍‍‍ 使用例 以下のユーティリティはSystem Controller Firmwareリクエストの方法を示し、QNXとLinuxの両方でコマンドラインからリクエストを行う手段を提供します。 System Controller Firmware Command Line Utility for Linux and QNX System Controller Firmware 101 i.MX 8ファミリ | i.MX 8QuadMax (8QM) | 8QuadPlus
View full article
通过 LPC 54018 中的 USB 通信在挂机中读写 如何在 LPC 54018 中通过 USB 通信写入和读取 Pendriver。 我使用的是 USB1 主机? LPC54xxx Re: read and write in pendriver through USB communication in lpc 54018 微控制器必须在 USB 主机模式下工作,因为笔式驱动器是 USB 大容量存储类 (MSC) 设备。 LPC54018 支持USB 2.0 全速主机,足以满足标准笔式驱动器的需求。 实施概述: 硬件要求 USB Type-A 接口 笔式硬盘的外部5V VBUS 电源 正确的 D+ 和 D- 连接 建议使用 VBUS 检测 USB 主机堆栈 使用恩智浦 MCUXpresso SDK 启用 USB 主机 + MSC 类驱动程序 使用FATFS处理文件系统 列举 插入时,USB 主机会枚举笔式驱动器 该设备被识别为大容量存储设备 大容量传输用于数据传输 文件系统访问 大多数笔式硬盘的格式为FAT32 挂载后,可执行标准文件操作 使用 f_open()、f_read() 和 f_write() 等应用程序接口 用例示例 这种 USB 存储访问通常用于嵌入式系统,以存储日志、媒体文件或缓存数据。 例如,嵌入式媒体播放器可从以下平台流式传输内容 HDOBOX等平台流式传输内容的嵌入式媒体播放器,就可以使用这种方法将配置文件、字幕或播放日志存储在 USB 闪存盘上。 重要说明 默认情况下不支持 exFAT 和 NTFS USB 主机 + FATFS 需要足够的内存 安装前在设备连接后添加延迟 Re: read and write in pendriver through USB communication in lpc 54018 观影应用程序 HDO Box 电影 我使用这种方法进行管理,效果很好、 Re: read and write in pendriver through USB communication in lpc 54018 Pendriver 中的 USB 通信相当难用。 Re: read and write in pendriver through USB communication in lpc 54018 你好,@Arularasan、 为了再次确认,能否请您检查一下 USB1 端口是否正常工作?你可以尝试像使用其中一个 USB 示例的设备一样使用它。 另外,能否请您检查一下您的硬盘?将磁盘驱动器输入计算机时,计算机会检测到它吗?你能不能试试用另一个 pendrive 或 USB 设备的 USB 主机示例? 最后,能否请您用挂盘测试另一个 USB 主机示例?使用以下示例进行尝试可能会有所帮助:usb_host_cdc和/或usb_host_msd_command。 致以最诚挚的问候,劳尔。 Re: read and write in pendriver through USB communication in lpc 54018 你需要一个 JTAG 调试器来上市和调试在恩智浦 LPC54018 板上运行的代码。FreeRTOS 使用 OM40006 物联网模块进行了测试。有关支持的调试器的更多信息,请参阅 《恩智浦 LPC54018 物联网模块用户手册 》,该手册可从以下网站获取 OM40007 LPC54018 物联网模块 产品页面。 如果您使用的是 OM40006 物联网模块调试器,请使用变流器电缆将调试器的 20 针连接器连接到恩智浦物联网模块上的 10 针连接器。 使用迷你 USB 转 USB 电缆将恩智浦 LPC54018 和 OM40006 物联网模块调试器连接到计算机的 USB 端口。   filmplus 应用程序 Re: read and write in pendriver through USB communication in lpc 54018 @RaRo感谢您的回复。 SDK 示例代码下的 USB HOST 演示 ("host_msd_fatfs_bm") 我已下载,但无法使用! 我 想通过 USB 通讯读写笔式驱动器,我使用的是 USB1。 请帮助我@RaRo Re: read and write in pendriver through USB communication in lpc 54018 你好,@Arularasan、 您试过 host_msd_fatfs_bm 示例吗?该示例似乎使用了 f_write() 和 f_read(),它们用于通过 FATFS 和 USB 进行写入和读取。 您能否查看以下参考手册,了解有关 USB + FATFS 应用程序的更多信息? MSDFATFSAPIRM、飞思卡尔 MSD FATFS API-参考手册和 USBHOSTAPIRM,飞思卡尔 USB 堆栈主机 API-参考手册。 致以最诚挚的问候,劳尔。 Re: read and write in pendriver through USB communication in lpc 54018 @RaRo是的,我已经在MCUXpresso IDE的帮助下完成了 lpc 54018 中的所有程序。 MCUXpresso IDE 生成的示例代码。没有创建读写功能,请帮助我通过 USB 通信在 lpc 54018(我使用的是 USB1 主机)中读写 Pendriver 的步骤。 Re: read and write in pendriver through USB communication in lpc 54018 你好,@Arularasan、 能否请您查看以下有类似问题的主题?已解决:我想使用 USB 连接从笔读取文件...- 恩智浦社区 此外,您还可以尝试使用 LPC54018 SDK 中的 USB 示例,如果使用的是 MCUXpresso IDE,请单击 "导入 SDK 示例... "并搜索 USB。您可以通过集成开发环境或以下链接下载 SDK:MCUXpresso SDK Builder。 [MCUXpresso IDE 快速启动面板和 SDK 导入向导] 可能需要定义您要使用的 USB:USB1 或 USB0。 致以最诚挚的问候,劳尔。
View full article
将 EdgeLock® SE05X 集成到 MIMXRT1180-EVK 本文档内容免责声明: NXP 提供的任何支持、信息和技术(“材料”)均按“现状”提供,不附带任何明示或暗示的保证,且 NXP 在适用法律允许的最大范围内,否认与材料相关的所有直接或间接责任和损害。NXP 对任何与应用或产品设计相关的协助不承担任何责任。材料仅可用于与 NXP 产品相关联。NXP 可以不受限制地使用您对材料提供的任何反馈。 摘要 本文档旨在指导开发人员在 NXP MIMXRT1180EVK 开发板上集成 EdgeLock® SE050 安全芯片,以实现硬件级别的安全增强。安全元件可以轻松连接到任何系统,要求极低——只需电源和两个 I2C 引脚。此外,由于主机软件支持 Plug&Trust 中间件,因此集成起来非常容易。 硬件先决条件 主机平台:MIMXRT1180EVK 扩展板: OM-SE050X 硬件设置 1. 按如下方式配置 OM-SE05xARD 跳线[1]: 2. 将 MIMXRT1180-EVK 上的跳线配置为默认[2]: 3.将 OM-SE05xARD 安装到 MIMXRT1180-EVK 上 软件集成 有两种方法将 OM-SE05xARD 集成到 MIMXRT1180-EVK:一种基于 SDK,另一种基于 Zephyr。用户可以根据自己的需求选择其中任一。 SDK集成: 平台文件生成。 nano 软件包为在任意 MCU 平台上集成 MW 提供了非常简便的方式。用户只需在 simw-nanopkg/lib/platform 文件夹中添加或修改对应平台的特定文件即可。 应用随附的补丁后,您即可轻松实现上述配置。 导入I2C演示项目作为起点 我们建议以 SDK 的 I2C 演示项目为集成起点,因为该项目已包含 SDK 所需的 I2C 驱动代码。以 RT1180 为例,我们导入:evkmimxrt1180_lpi2c_polling_b2b_master_cm33。 然后排除板级文件,并改用 nano 软件包中的对应文件。 接着导入 nano 软件包中的源文件, 并加入示例代码,这里选择:ex_se05x_crypto.c和 main.c。 添加如下定义用于 nano 软件包构建,以及包含路径。 正在构建项目: 调试: Zephyr 集成: 集成比 SDK 集成简单得多,因为平台特定文件已经存在,用户只需手动添加 MIMXRT1180-EVK 的板覆盖文件。附加的覆盖文件应放在类似于“workspace/modules/crypto/nxp-plugandtrust/examples/se05x_crypto/zephyr/boards/”的文件夹中。 请注意:Zephyr 集成指南已在 https://github.com/NXPPlugNTrust/nano-package/blob/master/zephyr/readme.rst 上发布,而测试的 Zephyr 版本仍停留在 v3.7.0,尚未支持 MIMXRT1180-EVK。为了支持 MIMXRT1180-EVK,我们必须使用最新的 Zephyr,并修改过 west.yml 文件。 以下是我们需要执行的步骤: $ rm workspace/ -rf $ mkdir -p workspace $ cd workspace/ $ git clone https://github.com/NXPPlugNTrust/nano-package.git //Edit ~/workspace/nano-package/zephyr/west.yml as below $ cd .. $ west init -m https://github.com/NXPPlugNTrust/nano-package.git --mf ~/workspace/nano-package/zephyr/west.yml ~/workspace/ $ cd workspace $ west update 版本示例: $ cd workspace/ $ west build -b mimxrt1180_evk/mimxrt1189/cm33 modules/crypto/nxp-plugandtrust/examples/se05x_crypto/zephyr/ --pristine 编程和运行:   参考资料: [1]基于树莓派的 EdgeLock SE05x 快速入门指南 [2]i.MX RT1180 EVK 快速入门指南
View full article
Clock Measuring using the Signal Frequency Analyzer (SFA) module for KW45/KW47/MCXW71/MCXW72 Using the Signal Frequency Analyzer (SFA) to Measure the FRO 6M Frequency Overview The Signal Frequency Analyzer (SFA) is a specialized hardware peripheral available in NXP’s KW45, MCXW71, KW47, and MCXW72 microcontrollers. It is designed to provide precise, real-time measurement and analysis of digital signal characteristics, including frequency, period, and timing intervals. This makes it a valuable tool for applications requiring accurate timing diagnostics, signal validation, and system debugging. By utilizing internal 32-bit counters and configurable trigger mechanisms, the SFA enables high-resolution capture of signal transitions, supporting robust system monitoring and fault detection. Functional Capabilities of the SFA The SFA module supports the following measurements: Clock signal frequency of a Clock Under Test (CUT) Clock signal period It operates using two 32-bit counters: One for the Reference Clock (REF) One for the Clock Under Test (CUT) Measurement is performed by comparing the counts of both clocks until predefined target values are reached. FRO 6M Frequency Failure Scenarios The 6 MHz Free Running Oscillator (FRO6M) may occasionally output an incorrect frequency under certain conditions: When the device exits reset When the device wakes from low-power modes To mitigate potential issues caused by incorrect FRO6M output, it is the application developer’s responsibility to verify the oscillator’s frequency and apply corrective measures as needed. Monitoring the FRO 6M Using the SFA To monitor the FRO6M signal, the following configuration is recommended: SFA Configuration Parameters Reference Clock (REF): CPU Clock (e.g., 96 MHz) Clock Under Test (CUT): FRO6M routed via CLKOUT Interrupt Mode: Enabled for asynchronous measurement completion Code Implementation The presented functions are meant to be implemented in users application, the inner functions are part of the implementations of the SFA driver from the NXP’s SDK. It can be used on MCXW71, MCXW72, KW45, kKW47, just make sure SFA Peripheral Initialization  void init_SFA_peripheral(void) { /* Enable SFA interrupt. */ EnableIRQ(SFA_IRQn); /* Set SFA interrupt priority. */ NVIC_SetPriority(SFA_IRQn, 1); SFA_Init(DEMO_SFA_BASEADDR); SFA_InstallCallback(DEMO_SFA_BASEADDR, EXAMPLE_SFA_CALLBACK); } SFA Callback Function void EXAMPLE_SFA_CALLBACK(status_t status) { if (status == kStatus_SFA_MeasurementCompleted) { SfaMeasureFinished = true; } sfa_callback_status = status; } Frequency Measurement Function This function sets up the measurement of the FRO6M signal using the CPU clock as the reference. uint8_t SFA_freq_measurement_6M_FRO(void) { uint8_t ratio = 0; uint32_t freq = 0UL; sfa_config_t config; CLOCK_SetClkOutSel(kClockClkoutSelSirc); //set clokout to SIRC SFA_GetDefaultConfig(&config); //Get SFA default config config.mode = kSFA_FrequencyMeasurement0; config.refSelect = kSFA_REFSelect1; //Set CPU clk as ref clk config.cutSelect = kSFA_CUTSelect1; //Set clkout as CUT config.refTarget = 0xFFFFFFUL; config.cutTarget = 0xFFFFUL; config.enableCUTPin = true; freq = get_ref_freq_value(CPU_CLK); SFA_SetMeasureConfig(DEMO_SFA_BASEADDR, &config); SFA_MeasureNonBlocking(DEMO_SFA_BASEADDR); while (1) { if (SfaMeasureFinished) { SfaMeasureFinished = false; if(kStatus_SFA_MeasurementCompleted == sfa_callback_status) { freq = SFA_CalculateFrequencyOrPeriod(DEMO_SFA_BASEADDR, freq);//Calculate the FRO freq if(FREQ_6MHZ + TOLERANCE <= freq ) { ratio = 1; } else { if(FREQ_3MHZ + TOLERANCE <= freq) { ratio = 2; } else { if(FREQ_2MHZ + TOLERANCE <= freq) { ratio = 3; } else { ratio = 4; } } } break; } } else { __WFI(); } } return ratio; } Result Interpretation and Usage To test the FRO 6M after adding the above functions the FRO can be tested after executing: init_SFA_peripheral(); SFA_freq_measurement_6M_FRO(); The measured FRO6M frequency ratio is returned by the function SFA_freq_measurement_6M_FRO(), with the ratio you can know the current frequency output of the 6M FRO, ration 1 means 6M are being output by the FRO, ratio 2 means the frequency output of the FRO it's being cut in half meaning the FRO is outputting 3 Mhz, ration 3 means the FRO output frequency is being cut by a third part, this results in 2MHz frequency output. With this information you can: Adapt peripheral clocking if the FRO6M frequency is incorrect (This can be achieve by modifying the peripheral dividers if dividers are being used). Trigger corrective actions such as  switching to an alternate clock source Steps to Reconfigure Peripheral Clocking When FRO6M output frequency is lower Detect the Faulty FRO6M Output Use the SFA measurement as described earlier to determine if the FRO6M is operating below its expected frequency (6 MHz). If the result is significantly lower, proceed to reconfigure. Choose an Alternative Clock Source Most NXP MCUs offer multiple internal and external clock sources. Common alternatives include: FRO 192M OSC RF 32M Sys OSC RTC OSC Choose one that is: Stable Available in your current power mode Compatible with the peripheral’s timing requirements You can add more clock divers if needed to make a higher frequency clock reach a certain lower frequency. Reconfigure the Peripheral Clock Source Use the SDK’s CLOCK_Set... APIs to change the clock source. You may also need to: Adjust dividers to match the required baud rate or timing Reinitialize the peripheral with the new clock settings Example Scenario: Measuring the FRO and Adjusting UART Based on Frequency Ratio Imagine your application relies on the 6 MHz Free Running Oscillator (FRO), and its accuracy directly affects UART communication. To ensure reliable operation, you can use the System Frequency Adjustment (SFA) feature to monitor the FRO output and dynamically adjust the UART configuration. After measuring the 6 MHz FRO using the recommended method, the system returns a frequency ratio value. This value ranges from 1 to 4, where: 1 indicates the frequency is within expected limits (no issues), 2 to 4 represent varying degrees of deviation from the expected frequency. Using this ratio, you can initialize and configure the UART peripheral and its driver to compensate for any frequency variation, ensuring stable and accurate communication. */ int main(void) { BOARD_InitHardware(); uint8_t ch = 0; uint8_t FRO_ratio = 0; init_SFA_peripheral(); /*Measure FRO6M output frequency*/ FRO_ratio = SFA_freq_measurment_6M_FRO(); /*Init debug console and compensate in case a different frequency is output */ if(0 == FRO_ratio) { assert(0);//this user defined return value means something went wrong while measuring 6Mz FRO } uint32_t uartClkSrcFreq = BOARD_DEBUG_UART_CLK_FREQ/FRO_ratio;//Compensate the src frequency set for uart module CLOCK_EnableClock(kCLOCK_Lpuart1); CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro6M); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq); ...... } SDK 25.0.00 Enhancements for FRO6M Calibration To address known reliability issues with the 6 MHz Free Running Oscillator (FRO6M), particularly during transitions from low-power modes, SDK version 25.06.00 introduces a set of software enhancements aimed at improving oscillator validation and calibration. Key Features Introduced FRO6M Calibration API Two new functions have been added to facilitate runtime verification of the FRO6M frequency: PLATFORM_StartFro6MCalibration() Initializes the calibration process by enabling the cycle counter, capturing a timestamp, and preparing the system to measure elapsed time using both the CPU and the FRO6M-based timestamp counter. PLATFORM_EndFro6MCalibration() Completes the calibration by comparing the time measured via CPU cycles and the FRO6M timestamp counter. This comparison determines whether the oscillator is operating at the expected 6 MHz or has erroneously locked to a lower frequency (e.g., 2 MHz). The result is stored in a global ratio variable (fwk_platform_FRO6MHz_ratio) for use by the system. These functions provide a lightweight and efficient mechanism to detect and respond to oscillator misbehavior, ensuring system stability and timing accuracy. Configuration Macro gPlatformEnableFro6MCalLowpower_d This macro enables automatic FRO6M frequency verification upon exiting low-power modes. When defined, the system will invoke the calibration functions to validate the oscillator before resuming normal operation. Default Integration The calibration mechanism is enabled by default in the SDK configuration file fwk_config.h, ensuring that all applications benefit from this safeguard without requiring manual setup. Use Case and Benefits These enhancements are particularly valuable in applications where: Precise timing is critical (e.g., wireless communication, sensor sampling). The system frequently enters and exits low-power states. Clock source integrity must be guaranteed to avoid peripheral misbehavior or timing faults. By integrating these calibration routines, developers can proactively detect and correct FRO6M frequency anomalies, improving overall system robustness and reducing the risk of runtime errors due to clock instability.
View full article
TCP Client & Server Implementation on MCUXrpesso SDK --- part I--using LwIP Netconn API Introduction TCP Client & Server establishes a two-way connection between a server and a client. It is the most common communication model used by applications such as HTTP, Telnet, FTP, SSH and others LwIP is a free light-weight TCP/IP stack in MCUXpresso SDK. It has three application programming interfaces (API): RAW API:  it is the native API of LwIP. It enables the development of applications using event callbacks. Netconn API:  it is a high level sequential API that requires the services of a real-time system (RTOS), The Netconn API enables multi-threaded operations BSD Socket API: it is developed on top of the Netconn API. In this article, I will introduce how to implement a TCP client & Server demo with LwIP Netconn API.  One EVK-RT1060 acts as TCP server, and others boards act as TCP clients.  They are connected through an Ethernet router.  They communicate via TCP protocol. If you press SW8 on the client board, it will toggle a LED on the Server board. This article is for beginners to understand the Netconn API on NXP MCUXpresso SDK. 2. Hardware configuration PHY settings: In this demo, we use phyksz8081, that is the default PHY in EVK-RT1060 board.  ENET port 0. /*! @brief The ENET PHY address. */ #define BOARD_ENET0_PHY_ADDRESS (0x02U) /* Phy address of enet port 0. */ /* Address of PHY interface. */ #define EXAMPLE_PHY_ADDRESS BOARD_ENET0_PHY_ADDRESS /* MDIO operations. */ #define EXAMPLE_MDIO_OPS enet_ops /* PHY operations. */ #define EXAMPLE_PHY_OPS phyksz8081_ops /* ENET clock frequency. */ #define EXAMPLE_CLOCK_FREQ CLOCK_GetFreq(kCLOCK_IpgClk) Configure the external PHY, pull up the ENET_INT before RESET.     GPIO_PinInit(GPIO1, 9, &gpio_config);     GPIO_PinInit(GPIO1, 10, &gpio_config);     /* pull up the ENET_INT before RESET. */     GPIO_WritePinOutput(GPIO1, 10, 1);     GPIO_WritePinOutput(GPIO1, 9, 0);     delay();     GPIO_WritePinOutput(GPIO1, 9, 1); MAC settings: In this demo, MAC address is defined in Macro configMAC_ADDR /* MAC address configuration. */ #define configMAC_ADDR                     \     {                                      \         0x02, 0x12, 0x13, 0x10, 0x15, 0x11 \     }  3. Starting a network interface To create a new network interface, the user allocates space for a new struct netif (but does not initialize any part of it) and calls netifapi_netif_add:     IP4_ADDR(&fsl_netif0_ipaddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3);     IP4_ADDR(&fsl_netif0_netmask, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3); IP4_ADDR(&fsl_netif0_gw, configGW_ADDR0, configGW_ADDR1, configGW_ADDR2, configGW_ADDR3);     netifapi_netif_add(&fsl_netif0, &fsl_netif0_ipaddr, &fsl_netif0_netmask, &fsl_netif0_gw, &fsl_enet_config0,                        ethernetif0_init, tcpip_input); Pass tcpip_input API to netif_add API as input callback function that is called to pass ingress packets up in the protocol layer stack next we need to bring the interface up An interface that is “up” is available to your application for input and output, and “down” is the opposite state. Therefore, before you can use the interface, you must bring it up. This can be accomplished depending on how the interface gets its IP address.  We can use static IP address  or DHCP. Set the network interface as the default network interface netifapi_netif_set_default(&fsl_netif0); Bring the interface up, available for processing     netifapi_netif_set_up(&fsl_netif0); 4. LwIP Initialization Call tcpip_init to create a tcpip_thread, this thread has exclusive access to LwIP core functions. Other threads communicate with this thread using message boxes. It also starts all the timers to make sure they are running in the right thread context. tcpip_init(NULL, NULL); 5. TCP Client & Server Implementation For TCP communications, one host listens for incoming connection requests. When a request arrives, the server accepts it and data is transferred between the server and the client. The sequence of function calls for the client and a server participating in a TCP connection is show in below picture. The steps for establishing a TCP connection on the client side are the following: Create a netconn using the netconn_new() function. Connect the connection to the address of the server using the netconn_connect() function. Send and receive data by means of the netconn_recv() and netconn_send() functions. Close the connection by means of the netconn_close() function. The steps in establishing a TCP connection on the server side are as follows Create a connection with netconn_new() function; Bind the connection to an address using the netconn_bind() function. Listen for connections with the netconn_listen() function. Accept a connection with the netconn_accept() function, this blocks until a client connects. Send and receive data by means of netconn_send() and netconn_recv(). Close the connection by means of the netconn_close() function. 5.1 TCP SERVER IMPLEMENTATION netconn_new() is used to create a new connection.   conn = netconn_new(NETCONN_TCP); netconn_bind() binds a connection to a local IP address and port.   netconn_bind(conn, IP_ADDR_ANY, TCP_CUSTOM_PORT); netconn_listen() function sets a TCP connection into a listening TCP connection.   /* Tell connection to go into listening mode. */   netconn_listen(conn); netconn_accept() function accepts an incoming connection on a listening TCP connection.    err = netconn_accept(conn, &newconn); netconn_recv() function receives a message from a netconn. netconn_send() function sends data to the currently connected remote IP/Port. In this demo, if server board receives a ‘TOGGLE’ message from the client board, it will toggle a LED. (GPIO1/3,  need to connect a LED manually)           while ((err = netconn_recv(newconn, &buf)) == ERR_OK) {         PRINTF("Received  %s\n", buf->p->payload);         do {              netbuf_data(buf, &data, &len);              tcp_rx_buf = (void *)data;              if (tcp_rx_buf[0] == 'T')              {                  PRINTF("LED was toggled from client\r\n");                 GPIO_PortToggle(EXAMPLE_LED_GPIO, 1u << EXAMPLE_LED_GPIO_PIN);                 netconn_write(newconn, TcpReply, sizeof(TcpReply) , NETCONN_COPY );              }         } while (netbuf_next(buf) >= 0);         netbuf_delete(buf);       } //end of while(( err   5.2 TCP CLIENT IMPLEMENTATION For the client side, the netconn structure is created:   conn = netconn_new(NETCONN_TCP); netconn_connect():  when a user issues a connect command, the stack creates a connection with another host. Before connect can instruct the stack to establish a connection, the user must pass a netconn and a sockaddr_in structure containing the destination IP address and port. In TCP, the handshaking packets will be exchanged.   memset(&server_addr, 0, sizeof(server_addr));   server_addr.sin_family = AF_INET;   server_addr.sin_port = PP_HTONS(TCP_CUSTOM_PORT);   server_addr.sin_addr.s_addr = server_ip_addr.addr;   err = connect(client_sock, (struct sockaddr *)&server_addr, sizeof(server_addr));   LWIP_ASSERT("connect fail, please start TCP server first !  ",  err == 0); In this demo, a GPIO is initialized and interrupt is enabled. When SW8 is pressed, the client board will send ‘Toggle’ command to the TCP server.   while (1)   {       if (g_InputSignal)       {           delay();           if (1 == GPIO_PinRead(EXAMPLE_SW_GPIO, EXAMPLE_SW_GPIO_PIN))           {               PRINTF("%s is turned on.\r\n", EXAMPLE_SW_NAME);               err = send(server_sock, Sendtext, sizeof(Sendtext) / sizeof(Sendtext[0]), 0);           }           /* Reset state of switch. */           g_InputSignal = false;       }  //end of if (g_InputSignal)   }  
View full article
Keil MDK/uVision を使用したデモの実行 CMSISデバイス・パックのインストール MDK ツールをインストールした後、デバッグの観点からデバイスを完全にサポートするには、Cortex ®マイクロコントローラ ソフトウェア インターフェイス標準 (CMSIS) デバイス パックをインストールする必要があります。これらのパックには、メモリ マップ情報、レジスタ定義、フラッシュ プログラミング アルゴリズムなどが含まれています。適切な CMSIS パックをインストールするには、次の手順に従います。MDK-Arm マイクロコントローラ開発キット (Keil) ®バージョン 5.38.1 以上を使用してください。 µVision と呼ばれる MDK IDE を開きます。IDE内で「Pack Installer」アイコンを選択します パック インストーラー ウィンドウで、「MCXW」を検索して、MCXW71 ファミリを起動します。MCXW7XX の名前をクリックすると、右側に NXP が表示されます。  MCXW71_DFP  パック。パックの横にある「インストール」ボタンをクリックします。このプロセスを正常に完了するにはインターネット接続が必要です インストールが完了したら、[Pack Installer(パック・インストーラ)]ウィンドウを閉じて、µVision IDEに戻ります サンプル・アプリケーションのビルド 以下の手順に従って、  hello_world  応用。一部のアプリケーションではパス内に追加のフォルダー層が存在する可能性があるため、他のサンプル アプリケーションではこれらの手順が若干異なる場合があります。 目的のデモ・アプリケーション・ワークスペースをまだ開いていない場合は以下で開きます。 /boards/ / / /mdk デバッグ構成を選択 プロジェクトを右クリックして、プロジェクト オプションを選択します。 次に、デバッグ オプションに移動し、CMSIS-DAP ARMv8-M デバッガーを選択します。OKボタンをクリックします デモプロジェクトをビルドするには、赤くハイライトされた「リビルド」ボタンを選択します。 ビルドが正常に完了します
View full article
i.mx93 上の m33 コアに対する OpenAMP サポート おい、 この質問は既にここで聞かれていると思います 解決済み: Re: i.mx93 上の m33 コアに対する RPMsg サポート - NXP コミュニティ しかし、私は受け入れられた答えを理解していません。NXP のリアルタイム エッジ ソフトウェア フレームワークでは、RPSMG サポートは FreeRTOS に対してのみリストされています。 ただし、i.mx95 A7 コアは最近すでに追加されていますhttps://github.com/zephyrproject-rtos/zephyr/pull/86923 私の質問は、NXP が m33 のサポートも追加する予定があるかどうかです。そうでない場合、手動でサポートを追加するには何が必要ですか? Re: OpenAMP support for m33 core on i.mx93 Linux (A コアで実行) と Zephyr (M33 コアで実行) 間のコア間通信を有効にするには、Zephyr のopenamp_rsc_tableサンプルを出発点とすることをお勧めします。 このサンプルでは以下を活用しています: - Zephyr 上の OpenAMP - Linux上のremoteprocとrpmsg 前提条件 Linuxのセットアップ Linux BSP: NXP の公式 BSP を使用しますhttps://github.com/nxp-imx/linux-imx/tree/lf-6.12.y デバイスツリー: `-rpmsg` バリアントを使用します。例:imx93-11x11-evk-rpmsg.dts U-Boot: Linux を起動する前に `prepare_mcore` を実行する Zephyr セットアップ(M33 コア) openamp_rsc_table サンプルを正常に実行するには、DTS オーバーレイの `zephyr,ipc_shm` プロパティを使用して、ホスト コアとリモート コア間の共有メモリを定義する必要があります。 次に、 nxp_imx93_m33.dtsiに MU ノードを追加します。 「」 mu1: mu1@44220000 { 互換性 = "nxp、imx-mu"; reg = <0x44220000 DT_SIZE_K(64)>; 割り込み = <21 0>; }; 「」 次に、リンカー スクリプトを更新し、`linker.ld` にリソース テーブル セクションを追加します。 「」 #定義されている場合(CONFIG_OPENAMP_RSC_TABLE) セクション { SECTION_PROLOGUE(.resource_table,,サブアライン(8)) { KEEP(*(.resource_table*)) } GROUP_LINK_IN(ROMABLE_REGION) } #endif 「」 i.MX93の設定調整 i.MX93 の RX および TX ID は他のボードとは異なります。`.conf` オーバーレイ ファイル内のデフォルト値を上書きする必要があります。 「」 CONFIG_IPM_IMX_MAX_DATA_SIZE_16=n CONFIG_IPM_IMX_MAX_DATA_SIZE_4=y CONFIG_OPENAMP_WITH_DCACHE=y CONFIG_LOG=y CONFIG_OPENAMP_RSC_TABLE_IPM_RX_ID=1 CONFIG_OPENAMP_RSC_TABLE_IPM_TX_ID=0 「」 サンプルPR https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc/openamp_rsc_table/boards https://github.com/zephyrproject-rtos/zephyr/pull/86923 https://github.com/zephyrproject-rtos/zephyr/pull/79220/commits Linuxパッチ要件 i.MX93 で適切に動作させるには、次の Linux パッチを適用してください: https://lore.kernel.org/imx/CAEnQRZDoYvK-YXLjqbXsRAWDkHrWNOoR1OCCWxs+AfNUDuPB_w@mail.gmail.com/T/ 実行前の最終ステップ アプリケーションを起動する前に: U-Boot で `prepare_mcore` を実行します。 `-rpmsg` デバイス ツリー BLOB を使用します。 アプリケーションノート AN5317の手順に従ってください。 関連リソース i.MX Linux ユーザーガイド - https://www.nxp.com/docs/en/user-guide/UG10163.pdf アプリケーションノート AN5317 - https://www.nxp.com/docs/en/application-note/AN5317.pdf remoteproc、rpmsg、mailbox、OpenAMP フレームワークの詳細。DTS および構成オーバーレイを作成する方法の例が含まれています。これはi.MX 8M PlusのHiFi4コアの例であることに注意してください。 https://www.youtube.com/watch?v=JqwPljnm2_k&t=14s DTS API、`zephyr,ipc_shm` 上 - https://github.com/zephyrproject-rtos/zephyr/blob/main/doc/build/dts/api/api.rst?plain=1#L421 Re: OpenAMP support for m33 core on i.mx93 すべての Zephyr IPC サポートはここにあります (メイン プロセッサ上の Linux カーネル OS とコプロセッサ上の Zephyr アプリケーション) https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc/openamp_rsc_table/boards 社内チームから確認したところ、現時点では MPU cm33 をサポートする予定はありません。 ただし、お客様の要件を社内チームに送信しましたので、更新があればお知らせいたします。 それは申し訳ありません。
View full article
无法在 i.MX 8M Plus EVK 上将 OV5640 路由至 ISP(仅适用于 ISI) 你好, 我正在使用 imx8M Plus EVK 和 OV5640 MIPI-CSI2 摄像头模块(MIPI-CSI 摄像头模块),正在尝试使用集成的 isp 来代替 ISI。 现在,传感器在路由到 ISI 时可以正常工作(我可以通过 /dev/VideoX 捕获 UYVY/NV12),但我想将拜耳的原始数据提供给 SoC 互联网服务提供商,然后从 ISP 视频节点获得经过处理的输出(demasic、AWB 等)。我在媒体/格式方面遇到困难,希望能得到指导,了解实际支持哪些格式,以及如何正确配置管道。 我想禁用 ISI 改用 ISP 管道: 我使用 imx8mp-lpddr4-evk 作为版本配置,使用 imx-image-full 作为 Yocto Project 映像。 Re: Unable to route OV5640 to ISP on i.MX 8M Plus EVK (works only with ISI) 你好 根据您的要求,您需要将 OV5640 的 RAW Bayer 数据通过 SoC 的 ISP 传输,而不是使用 ISI 模块。以下是你面临挑战的原因: i.MX 8M Plus 有两个不同的摄像头接口: 1. ISI(图像感知接口):对 YUV/RGB 格式执行基本处理(缩放、裁剪、翻转、色彩空间转换) 2. ISP(图像信号处理器):处理 RAW 拜耳数据处理(demosaic、AWB 等) 目前,您的 OV5640 配置为使用其内置 ISP 并将 YUV/RGB 数据直接输出到 ISI 模块,这就是为什么你可以通过 /dev/videoX 捕获 UYVY/NV12 的原因。不过,要使用 SoC 的 ISP 功能,您需要不同的配置。 要将原始拜耳数据路由到 SoC ISP,请执行以下操作: 1. 修改您的设备树以禁用 ISI 并启用 OV5640 2. 将 OV5640 配置为输出 RAW 拜耳格式,而不是经过处理的 YUV 3. 安装 ISP 管道以进行正确处理 作为实现参考,您可以查看演示 RAW 摄像机移植到 ISP 的 GitHub 存储库:https://github.com/nxp-imx-support/meta-imx8mp-isp-imx219 还有一个社区帖子涉及类似的集成挑战: https://community.nxp.com/t5/Other-NXP-Products/Integrating-OV5695-RAW10-with-ISP-on-i-MX8MP-ISP-Enablement-and/td-p/2115003 ISP 模块需要特定于传感器的校准文件(.drv、.xml、.cfg)以优化 OV5640 在 RAW 模式下的性能。 此致
View full article
从 STM32Cube IDE 到 MCUXpresso IDE 移植ST应用程序 本节概述了使用恩智浦目标MCU的兼容SDK将在STM32Cube IDE中开发的应用迁移到恩智浦MCUXpresso IDE的过程。 对于熟悉STM32Cube IDE的用户来说,保持类似的开发环境可以简化过渡并降低学习曲线。在本例中,最初为STM32设备开发的I2C应用将重新创建并适配恩智浦MCU。 要完成迁移,首先应在MCUXpresso IDE中创建包含必要I2C驱动程序的最小项目。原始ST应用使用两个I2C实例实现同一块开发板中元器件间的通信。要复制此功能,必须初始化两组I2C引脚。此外,该应用使用按钮输入和LED输出来演示行为变化,需要借助MCUXpresso引脚配置工具配置相应的GPIO。 要开始迁移,原ST项目的主源文件以及任何不属于标准ST驱动集的自定义源文件应被整合进新的NXP项目中。 以下步骤概述了MCUXpresso IDE中的初始项目设置: 选择“创建新的C/C++项目”。 选择目标MCU(例如,MCXA156)。 单击“下一步”。 展开驱动程序部分。 选择 I2C。 单击“下一步”。 单击“完成”。 项目创建时会包含一个基本的“Hello World”示例。此模板可用作起点。主源文件中的所有内容(除初始宏定义外)可以逐步替换以集成应用逻辑,从而实现模块化且受控的迁移过程。 下一步是将原始ST项目中的主源文件传输到新创建的MCUXpresso项目中。在此过程中,除非需要自定义头文件,否则将包含标准ST和驱动程序引用。此时不会使用自定义标头,因此仅迁移核心应用逻辑。 ST源文件中的许多函数调用都依赖于STM32特定的HAL API。请对这些功能进行审查,并使用恩智浦SDK中的同等功能进行替换。此方法包括分析main()例程中的每个函数以理解其目的,然后利用恩智浦环境中的相应实现进行替换。   ST项目功能快速概览: 中断优先级配置 配置微控制器的中断系统,以便在多个中断同时发生时管理优先级。 电源外设时钟实现 激活电源(PWR)外设的时钟,这是配置电源管理设置的前提条件。 电源管理设置 初始化STM32U5xx微控制器的电源管理功能,以优化内部元器件的能效和性能。 系统时钟配置 设置微控制器的定时系统,将其配置为以160MHz的频率运行。 外设初始化 确定外设的引脚配置和功能设置。在此应用中,I2C1会配置为从机,I2C3则配置为主机。 LED初始化 将LED配置为低电平有效状态,并开启LED以指示初始状态或通信反馈。 GPIO轮询按钮按下 持续监测GPIO输入引脚的状态。如果未按下按钮,LED将快速闪烁。按下按钮后,环路会退出,LED则保持点亮状态。 I2C通信启动 从主端发起I2C通信流程,触发两个I2C接口间的数据传输。 恩智浦SDK如何处理这一流程? 中断优先级配置 此功能由CMSIS核心NVIC功能支持,且可直接重复使用。它需要定义宏来确定所需的抢占优先级。 时钟与电源配置 这些功能都会整合至BOARD_InitBootClocks函数(位于开发板文件夹的clock_config.c下)。此函数可初始化恩智浦MCU的系统时钟和电源设置。 外设和引脚初始化 外设设置分为两个函数: BOARD_InitBootPins(位于pin_mux.c中)负责处理I2C和GPIO的引脚配置。 BOARD_InitBootPeripherals(位于peripherals.c中)则负责管理I2C外设初始化和GPIO中断设置。 LED 初始化 GPIO 引脚可根据所需的初始状态配置为高电平或低电平输出。可以使用 GPIO_PinWrite 来切换或设置 LED。 GPIO轮询按钮按下 此行为可以借助自定义轮询函数来复制,该函数利用GPIO_PinRead监测按钮状态。 I2C通信开始 I2C主通信通过LPI2C_MasterStart启动,开始与指定从设备的数据传输过程。 使用时钟配置工具解决时钟初始化问题 MCUXpresso IDE包含集成的配置工具,可通过项目浏览器从界面右上角的下拉菜单中选择相应选项进行访问。 要配置系统时钟,请在 MCUXpresso IDE 中打开 Clocks 工具。 时钟图显示了所选 MCU 支持的配置。在此示例中,设备的最大核心时钟频率为 96 MHz。由于这符合应用程序的要求,因此不需要修改默认时钟设置。 要启用I2C实例的外设时钟,请在MCUXpresso配置工具中导航至时钟配置图。滚动浏览图表以定位可用的外设,并选择适当的时钟源来激活I2C模块。 要配置I2C0和I2C3外设的时钟源,请双击时钟配置图中与每个实例关联的CLKSEL字段。在此设置中,请选择FRO_HF_DIV作为I2C0和I2C3的时钟源。 接下来,在时钟配置图中选择相应的字段以配置时钟分频器。详细信息将显示在界面的右上角面板中。要启用通往I2C外设的时钟路径,请确保选择 “分频器时钟正在运行” 选项。 此时,I2C外设时钟已成功启用。 要应用配置更改并将其集成到项目中,请点击“更新代码”。此操作将生成相应的源文件,并确保新设置反映在项目结构中。 使用引脚配置工具解决引脚初始化问题 MCUXpresso IDE 包含集成的配置工具,可通过项目浏览器从界面右上角的下拉菜单中选择相应选项进行访问。 要开始配置I2C引脚,请从MCUXpresso IDE的配置工具菜单中选择“打开引脚”。 利用筛选功能,搜索与I2C实例0兼容的可用引脚。在查看开发板原理图后,选择P0_16和P0_17引脚,因为这两个引脚可以通过标头访问。在配置选项中选择LPI2C0:SDA和LPI2C0:SCL,为这些引脚分配相应的I2C功能。 重复I2C实例3的配置过程。根据开发板电路图,为此实例选择引脚P3_27和P3_28。在引脚配置工具中选择LPI2C3:SDA和LPI2C3:SCL来分配相应功能。 一旦选择了引脚,就会生成一个配置表,显示每个引脚的布线和设置。根据此表中的布线详情,按需配置引脚。对于I2C引脚,启用内部上拉电阻,以确保通信过程中信号的完整性。 除了配置I2C引脚外,还需要安装两个GPIO引脚——一个用于输入,一个则用于输出。在此开发板中, SW2 (P1_7)指定为按钮输入功能,而P3_0则指定为LED输出。 在引脚配置表的路由详情中,定义输入和输出GPIO的行为。根据应用需求,输出引脚应初始化为逻辑低电平状态(选择逻辑0)以激活LED。对于输入引脚,在下降沿启用中断检测以准确记录按钮按下操作。 要完成配置并将更改集成到您的项目中,请点击“更新代码”。此操作将生成必要的源文件,并将所选设置应用于项目结构。 使用外设配置工具解决外设初始化问题 MCUXpresso IDE包含集成的配置工具,可通过项目浏览器访问。要启动这些工具,请使用位于界面右上角的下拉菜单。 要开始外设配置,请在MCUXpresso IDE的配置工具菜单中选择 “打开外设” 。 在此视图中,重点是初始化每个实例的GPIO和I2C设置。要继续操作,请选择“外设驱动程序”以访问目标设备支持的驱动程序列表 GPIO1 配置 要筛选可用的外设选项,请在外设驱动程序视图的搜索栏中输入“GPIO”。显示相关选项后,点击“确定”以继续进行GPIO配置。 要启用分配给按钮输入的P1_7 的中断功能,首先要选择一个新的外设驱动程序。使用过滤器搜索GPIO,然后选择适当的驱动程序激活GPIO1 中断处理程序。 I2C3主机/主设备配置 要配置I2C外设,请在外设驱动程序视图的搜索栏中输入“I2C”来筛选可用选项。显示相关驱动程序后,为您的应用选择合适的驱动程序,然后点击“确定”以继续操作。 将I2C3配置为主设备(主机),并启用中断驱动的数据传输。此设置允许I2C3实例发起通信并通过中断机制处理数据传输,以提高响应速度和效率。 此外,启用 I2C3 外设的中断处理程序。配置相应的优先级并激活传输数据就绪标志,以支持中断驱动的数据传输。 I2C0从机/从设备配置 要配置I2C从机外设,请在外设驱动程序视图的搜索栏中输入“I2C”来筛选可用的驱动程序。显示相关驱动程序后,选择合适的驱动程序,然后点击“确定”以继续进行配置。 将I2C0配置为从设备(从机)。启用中断驱动的传输方式,并指定用于通信的从设备地址。此设置允许I2C0实例响应主设备请求,并通过中断处理数据接收。 此外,启用I2C0外设的中断处理程序。配置适当的优先级,验证分配的从机地址,并激活接收数据就绪标志,以支持中断驱动的数据接收。 要应用配置的设置并将其集成到项目中,请点击 “更新代码”。此操作将生成必要的源文件,并确保所有外设和引脚配置都反映在项目结构中。 配置工具生成的文件 MCUXpresso配置工具会根据所选设置自动生成源代码,从而简化与主应用的集成。生成的代码包括在前几个步骤中配置的时钟、引脚和外设的初始化例程。所有生成的文件都会放入项目结构的开发板目录下。 board.c 使用恩智浦开发板创建项目时,默认配置包括调试UART引脚的初始化以实现串行终端通信。在这种情况下,无需使用UART功能以及board.c中的对应函数。 clock_config.c 此文件包含所有系统时钟配置。使用BOARD_InitBootClocks函数来初始化时钟频率和电源模式设置。对于此应用,系统会配置为以96MHz的频率运行。 peripherals.c 此文件包含通过配置工具配置的外设初始化代码。在本例中,它包含I2C实例和GPIO中断的设置例程。虽然可以使用BOARD_InitPeripherals函数,但有选择性地将生成的代码集成到应用的特定位置,以匹配所需的执行顺序,往往更为有效。 pin_mux.c 该文件可定义为应用选择的所有引脚配置,包括I2C和GPIO分配。虽然默认情况下包含UART引脚,但本项目中并未使用这些引脚。使用BOARD_InitBootPins函数应用引脚设置。 此外,原始ST应用包含缓存初始化函数(MX_ICACHE_Init)。在恩智浦SDK中,缓存配置由启动代码处理。具体信息可通过设备文件夹下system_MCU.c中的SystemInit函数查看。 替换初始化函数 时钟和引脚初始化 在恩智浦项目的主函数中,系统时钟和引脚配置使用配置工具生成的函数进行初始化: BOARD_InitBootClocks BOARD_InitBootPins 外设初始化 外设初始化代码来源于peripherals.c文件(该文件由配置工具生成)。第一段代码可设置GPIO中断处理程序,包括其优先级和NVIC配置。 随后,对I2C主设备和从设备实例及其对应的中断处理程序和优先级进行初始化。在此阶段,中断标志尚未启用;它们将在数据传输函数内部稍后激活,以确保正确的执行顺序并避免过早触发中断。 peripherals.c文件中包含一个代码片段,专门用于初始化LPI2C0外设以进行从设备操作。这段代码可以选择性地集成到主函数或应用内的其他适当位置,以匹配所需的执行流程。 虽然MCUXpresso IDE中的配置工具能够有效生成必要的初始化代码,但开发人员仍应负责确定此代码在应用中最合适的位置。这一决策应依据所实现的特定协议或外设所需的操作顺序来指导。 例如,在I2C通信中,数据传输通过中断进行管理。如果在使用LPI2C0_Init函数时不考虑时序,中断可能会过早触发,导致事务不完整或管理不善。 为确保正确执行,建议的顺序如下: 初始化外设及其相关的中断处理程序。 启动I2C事务。 启用主设备和从设备操作的中断。 在此应用中,初始化在main()函数内执行,中断标志则在稍后的Handle_I2C_Master函数中选择性启用,以保持正确的时序和控制。 替换操作函数 SYSTICK初始化 SYSTICK定时器会配置为支持应用内的延迟操作,例如控制LED闪烁率。有关初始化SYSTICK的详细说明,请参阅以下小节。 按钮轮询和LED控制 此功能是通过一个自定义函数实现的,该函数会不断轮询按钮输入。在等待用户交互时,LED会切换以显示准备就绪。按下按钮后,LED保持稳定亮起,提示进入I2C数据传输阶段。 I2C主设备处理 Handle_I2C_Master函数通过恩智浦SDK中为I2C外设提供的驱动程序API实现。此函数可启动I2C事务并管理通信序列。 主设备和从设备I2C实例的中断处理程序均来自外设初始化代码。在此阶段,相关中断标志会选择性启用,以支持应用所需的具体行为。 WaitForUserButtonPress函数 要开始自定义GPIO中断处理程序,请在MCUXpresso IDE中打开外设配置工具。然后,你可以复制GPIO自动生成的IRQ处理程序,作为可靠的起点。然后可以修改此代码以满足您应用程序的特定要求。 配置完外设后,点击位于 MCUXpresso IDE 右上角的 “开发” 按钮,返回代码编辑器。在开发环境中,将复制的 IRQ 处理程序代码粘贴到主源文件中——最好放在顶部——以便更容易访问和组织。 已进行修改,在while循环中加入控制变量,确保此应用能够暂停执行,直至检测到按钮按下。此操作可确保程序仅在用户交互后才能继续进行,以匹配应用的预期流程。 WaitForUserButtonPress 函数利用 GPIO 切换和写入操作来控制 LED 状态,并通过延迟机制管理轮询循环期间的闪烁间隔。为了实现延迟,SYSTICK 定时器被初始化并进行相应配置。 此外,引入了一个全局计数器变量,以及相应的SYSTICK中断处理程序,以支持应用程序内的基于时间的操作。 在main()函数中,SYSTICK定时器初始化应在按钮轮询逻辑之前添加。此操作可确保在进入等待用户输入的循环之前,延迟机制已完全运行。 最终版的 WaitForUserButtonPress 函数将包含: GPIO操作可切换和控制LED状态。 持续检查按钮状态的while循环,只有在检测到按键事件时才会继续执行。 GPIO_* API是恩智浦GPIO驱动程序库的一部分,用于执行初始化、引脚控制和中断处理等各种操作。代码中高亮显示的宏(通常在IDE中以粉红色显示)由配置工具生成,并在pin_mux.h头文件。 应用中使用的延迟功能通过基于SYSTICK的自定义函数实现,如前所述。 要了解所有可用的GPIO API,请参阅fsl_gpio.h头文件。此文件为GPIO操作提供全面支持,包括端口和引脚级控制、配置以及中断管理。 自定义I2C中断处理程序 要以类似 GPIO 处理程序的方式定制 I2C 中断处理程序,首先要在 MCUXpresso IDE 中打开外设配置工具。从中找到并复制自动生成的I2C0 IRQ 处理程序。这是一个基础模板,可根据应用的具体要求进行修改。 要返回代码编辑器,请点击位于MCUXpresso IDE右上角的“开发”按钮。进入开发环境后,将复制的I2C中断处理程序代码粘贴到主源文件中(最好放在顶部),以便整理和访问。 复制外设配置工具中自动生成的中断处理程序,对I2C3重复同样的过程。然后,此处理程序可用作定制基础,类似于I2C0采用的方法。 整合I2C中断处理程序 在原始ST项目中,每个I2C实例都使用两个独立的中断处理程序:一个用于执行标准操作,另一个则用于处理错误。然而,此次迁移中使用的恩智浦MCU会为每个I2C实例提供单一中断向量,用于处理标准和错误状态。 因此,必须将原始的四个处理程序功能合并为两个,每个I2C实例各分配一个功能。此操作需要仔细审查原始中断逻辑,以确保所有相关标志和行为在合并实现中得以保留。 例如,原始项目中的从设备处理程序可检查地址匹配标志,并在检测到标志后验证就绪度以接收数据。在恩智浦环境中,等效行为通过监测统一中断处理程序内的相应状态标志来实现,以确保正确处理地址识别和数据接收。 从设备处理程序 当主设备以0x7E寻址从设备时,就会触发I2C从设备中断处理程序。检测到此地址匹配后,从设备会确认请求并准备接收传入数据。 处理程序的第二部分负责管理数据接收过程。它能处理主设备传输的每个字节,监测NACK(未确认)状态以指示传输结束,并将接收的数据存储到指定的缓冲区。此操作可确保从设备正确处理通信序列,并在所有数据接收完毕后轻松终止传输。 主设备处理程序 I2C主设备中断处理程序可监测主设备传输就绪标志,此标志用于指示外设已准备就绪,可传输下一个字节的数据。检测到此条件后,处理程序会检查传输缓冲区,以确定是否还有其他数据需要发送。计数器用于跟踪传输进度。 处理程序会使用适当的主设备发送操作,发送下一个字节并推进缓冲区指针。当最后一个字节发送后,处理程序会发出终止条件,以指示数据传输序列完成。 Handle_I2C_Master 函数 Handle_I2C_Master函数负责启动和管理I2C通信过程。它首先发出MasterStart命令,以启动与指定地址从设备的通信。从设备成功确认后,数据传输将通过相应的中断例程进行处理。 此函数还会初始化主设备和从设备I2C实例的中断处理程序。如前所述,必须在主设备发起通信后启用中断,以防止过早触发中断,从而干扰事务序列。 数据传输完成且从设备接收到所有预期的字节后,此函数会将LED设为稳定状态:表示执行成功,应用流程结束。 结束语 使用MCUXpresso IDE将应用从STM32开发环境迁移到恩智浦MCX平台,需要采用条理清晰的结构化方案。借助集成的配置工具并理解STM32与恩智浦SDK元器件间的功能等效性,开发人员可以在维持性能和功能的同时有效过渡其应用。 本指南概述了复制I2C应用的关键步骤,包括项目设置、外设配置、引脚和时钟初始化以及中断处理。虽然这些工具通过自动生成代码提供了坚实的基础,但必须谨慎考虑初始化和运行时逻辑的序列和集成,以确保稳定运行。 通过清晰理解两种环境并审慎调整应用逻辑,开发人员可以简化迁移流程,同时充分利用恩智浦MCX平台所提供的功能。
View full article
[RTD600 MCAL] S32K3X4EVB-T172 RTC API Wake-up This example project will show user how to use and configure the basic functionalities of WKPU + GPT RTC API.  ------------------------------------------------------------------------------ * Test HW: S32K3X4EVB-T172 (SCH-53148 REV B2) or S32K344MINI-EVB * MCU: S32K344 * IDE: S32DS3.5 & S32DS3.6 * SDK release: RTD 6.0.0 * Debugger: PE Micro * Target: internal_FLASH  ------------------------------------------------------------------------------ This example routine configures the WKPU & RTC units for wake-up. The RTC is present in always ON domain, hence available in RUN mode as well as in STANDBY mode. The chip contains one instance of RTC (Real Time Clock) timer and API (Autonomous Periodic Interrupt) timer, where both can perform 32-bit comparisons. Both RTC and API timers can generate interrupts as well as wake-up from low power modes. The following figure highlights the path for RTC API wake-up. Please refer to Chapter 69.3.2 API functional description from the S32K3XX reference manual (Rev. 12) for further information. The routine waits for SW5 to be pressed, then: Turns off the green LED Switches CORE_CLK to Option C - Boot Standby mode (CORE_CLK @ 24 MHz). Initializes the ICU driver. Configures RTC_API channel (WKPU0) Initializes GPT module. Starts timer and sets RTC_API_TIME. Enters standby. After the period defined, RTC API generates an interruption and MCU wakes up. After wake-up, MCU resets and polls for SW5 to be pressed again. The RTC API value can be changed with RTC_API_TIME definition. This example is provided as is with no guarantees and no support.
View full article