Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
进入i.MX 8/8X系列部分场回馈生命周期的步骤 背景信息 1. 生成一个 PKI 树,并包含一个下级 SGK 密钥 2. 生成 SRK 表和 SRK 哈希 3. 获取芯片信息 4. 更新配置文件并生成消息 5. 对消息进行签名 6. 通过第一种方法将生命周期更改为PFR 6.1 使用 message_signed.bin 重新生成 flash.bin 6.2 重新生成 flash-signed.bin 7. 通过第二种方法将生命周期更改为PFR 7.1 在 uboot-imx 中添加命令 7.2 启动板并输入命令 背景信息 根据mx8_mx8x_secure_boot.txt中描述的过程,芯片熔丝已编程并关闭(启用网络安全配置) 在mx8_mx8x_secure_boot.txt\guides\ahab\imx\doc - uboot-imx - i.MX U-Boot 有两种方法可以通过签名消息的方法将生命周期更改为部分字段返回(PFR)。一种方法是使用message_signed.bin生成flash.bin,另一种方法是在uboot中编写新命令,然后手动将message_signed.bin添加到uboot中。后者可以更方便地更改消息内容。 请注意,这些细节/脚本目前仅供NXP内部参考。请不要和顾客分享。 基于上述,部分字段返回的步骤如下:   1. 生成一个PKI树,并包含一个下属SGK密钥   2. 生成 SRK 表和 SRK 哈希 $ cd ../crts/ $ ../linux64/bin/srktool -a -s sha384 -t SRK_1_2_3_4_table.bin -e SRK_1_2_3_4_fuse.bin -f 1 -c SRK1_sha384_secp384r1_v3_ca_crt.pem,SRK2_sha384_secp384r1_v3_ca_crt.pem,SRK3_sha384_secp384r1_v3_ca_crt.pem,SRK4_sha384_secp384r1_v3_ca_crt.pem     SRK_1_2_3_4_table.bin和SRK_1_2_3_4_fuse.bin文件还可用于后续步骤。   3. 获取芯片信息 在iMX8/8X设备上,启动设备并在SCU终端输入并运行命令“seco info”。下列输出将显示在SCU终端上。保存此信息,以备后用。   4. 更新配置文件并生成消息 修改 message_header.json {"container": {"message": {"permission": "0x10", "cert version": "0", "UID": "0C13380E82895B2C", "flags": "0", "monotonic counter": "0x0"}, "header": {"fuse version": "0", "SW version": "0", "version": "0"}}} 从下图中修改message_content.json,要改为部分返回,生命周期需要改为0x20 {"Id": "0xa0", "lifecycle": "0x20", "nb words": "1"}   然后通过以下命令行生成消息。   $python gen-msg-json.py message_header.json message_content.json -o message.bin   5. 对消息进行签名 如下所示,将权限修改为 Fuse1:SCU 版本。生命周期,即 0x10。     [标题] 目标 = AHAB 版本 = 1.0 [安装SRK] # srktool生成SRK表格 文件 = "../crts/SRK_1_2_3_4_table.bin" # PEM格式的公钥证书 来源 = "../crts/SRK1_sha384_secp384r1_v3_usr_crt.pem" # SRK表中公钥证书的索引(0 .. 3) 源索引 = 0 # SRK集类型(NXP或OEM) 源集 = OEM # 撤销SRK的位掩码 撤销 = 0x0   # ******* 可选命令 ***** [安装证书] # PEM格式的公钥证书 File = "../crts/SGK1_1_sha384_secp384r1_v3_usr_crt.pem" # 权限的位掩码权限 = 0x10# ******************************[验证数据]# mkimage生成的待签名二进制文件文件 = "message.bin"# 偏移量 = 容器标题 签名块(由mkimage打印) 偏移量   = 0x0             0x48   然后执行命令: ../linux64/bin/cst -i message.csf -o message_signed.bin 并且可以获取message_signed.bin   6. 通过第一种方法将生命周期更改为PFR 第一种方法是使用 message_signed.bin 重新生成已签名的 flash.bin。   6.1 使用 message_signed.bin 重新生成 flash.bin $cp message_signed.bin到imx-mkimage/iMX8QX/ 转到imx_mkimage仓库并编辑./iMX8QX/scripts/misc.mak中的flash_msg_block规则。   -./$(MKIMG) -soc QX -rev B0 -append mx8qx-ahab-container.img -c -scfw scfw_tcm.bin -msg_blk test_block.bin field 0x83000000 -out flash.bin +./$(MKIMG) -soc QX -rev B0 -append mx8qx-ahab-container.img -c -scfw scfw_tcm.bin -msg_blk message_signed.bin field 0x83000000 -out flash.bin 然后运行: $ make SOC=iMX8QX flash_msg_block 它将生成新的flash.bin,因为板处于OEM关闭状态,所以需要重新生成flash-signed.bin。   6.2 重新生成 flash-signed.bin 创建 csf_boot_image_csf.csf 文件,如下所示: [标题] 目标 = AHAB 版本 = 1.0 [安装SRK] # srktool生成SRK表格 文件 = "../crts/SRK_1_2_3_4_table.bin" # PEM格式的公钥证书 来源 = "../crts/SRK1_sha384_secp384r1_v3_usr_crt.pem" # SRK表中公钥证书的索引(0 .. 3) 源索引 = 0 # SRK集合类型(NXP或OEM) 源集合 = OEM # 已撤销SRK的位掩码 撤销 = 0x0 # ******* 可选命令 ***** #[安装证书] # PEM格式的公钥证书 # 文件 = "../crts/SGK1_1_sha384_secp384r1_v3_usr_crt.pem"# 权限的位掩码 # 权限 = 0x10 # ****************************** [认证数据] # mkimage生成的待签名二进制文件 文件 = "flash.bin" # 偏移量 = 容器标题 签名块(由mkimage打印) 偏移量   = 0x400             0x590 然后运行命令: ../linux64/bin/cst -i csf_boot_image_csf.csf -o flash_signed.bin 即可获得flash_signed.bin   最后,将生成flash-signed.bin文件,并使用dd命令将其写入SD卡。生命周期预计将变为0x100。   7. 通过第二种方法将生命周期更改为PFR 第二种方法是在uboot中写一个新命令,然后通过该命令在uboot中手动添加message-signed.bin。   7.1 在uboot-imx中添加命令。 $ git am 0002-add_ahab_return_lifecycle_disable_cache.patch $ source $ unset LDFLAGS $ make -j8 重新生成u-boot.bin。 $ cp u-boot.bin  $ cd imx-mkimage/ $ make SOC=iMX8QX flash $ cp iMX8QX/flash.bin 包含flash-signed.bin的CSF描述文件 $ cd $ ../linux64/bin/cst -i csf_boot_image.txt -o flash-signed.bin $ sudo dd if=flash-signed.bin of=/dev/sdX bs=1k seek=32 ; sync 然后使用这个新的u-boot.bin生成flash-signed.bin。将第五步生成的message-signed.bin复制到SD卡。 7.2 启动板并输入命令 给板上电,并停止uboot。 $ fatload mmc 1:1 0x80280000 message_signed.bin $ ahab_status $ ahab_return_lifecycle 0x80280000 $ ahab_status 请注意,该地址与您在第一步中输入的地址一致。 然后您可以在SCU串口输入$seco info,看看生命周期预期会变成0x100。   Re: Steps to enter Partial Field Return LifeCycle on i.MX 8/8X Family 你好@Tia_Lan 您能提供 Lauterbach 脚本将 SECO 日志转储到 Ankit 吗? 顺祝商祺! 弗兰克 Re: Steps to enter Partial Field Return LifeCycle on i.MX 8/8X Family 你好@frank_zhang 这是不可能的,因为客户从 Linux 内核 sysfs 驱动程序将 LC 返回 OEM 现场操作,然后重启设备电源。 以下是客户在执行 OEM Field Return 返回 LC 后检查 ahab_status 时观察到的日志 # dd if=signed_msg_512.bin of=/sys/kernel/seco/field_return bs=816 [ 548.708086] imx_scu_call_rpc(...) 失败,错误 -13! [ 548.708097] imx_sc_seco_return_lifecycle(...) 失败,错误 -13 0+0 中的 1+0 条记录复制了 0 字节 (0B),0.066212 秒,0B/s # cat /sys/kernel/seco/ahab_status 生命周期:0x0080,OEM 已关闭 UID_H: 0x1A10B00E UID_L: 0x8292379B 单调性计数器:0x0000 SECO event[0] = 0x00A0AB29 CMD = AHAB_FIELD_RETURN_REQ (0xA0) IND = 未知指示符 (0xAB) 发现 1 SECO 活动 发现 SECO 事件 - 真实性检查失败! -安基特 Re: Steps to enter Partial Field Return LifeCycle on i.MX 8/8X Family 嗨,安基特、 客户看到错误后,能否在 uboot 中运行 ahab_dump?我们可以查看 SECO 日志。 顺祝商祺! 弗兰克 Re: Steps to enter Partial Field Return LifeCycle on i.MX 8/8X Family 你好@frank_zhang 客户以"的方式签署了" 。 他们使用 CST 工具编写并签署了"Return Lifecycle Update" 信息。 在目标上,通过 Linux 控制台将"签名信息" 发送到其 sysfs 驱动程序。而 sysfs 驱动程序会调用 SCU API: sc_seco_return_lifecycle(具有 SECO_FUNC_RETURN_LIFECYCLE)函数。 他们没有使用签名映像方式(因此签名消息是启动映像的一部分)。 -安基特 Re: Steps to enter Partial Field Return LifeCycle on i.MX 8/8X Family 嗨,安基特、 他们使用的是签名消息方式还是签名映像方式(因此签名消息是启动映像的一部分)? 顺祝商祺! 弗兰克 Re: Steps to enter Partial Field Return LifeCycle on i.MX 8/8X Family 你好@frank_zhang 是的,我做得很好。希望你那边也一切顺利。 客户已执行以下步骤: 第 1 步:在处于 OEM 开放(恩智浦关闭)状态的 " i.mx8QXP B0 " 设备上,首先测试了使用 " 签名的退货生命周期更新消息 " 将 LC 返回 OEM 现场退货 执行状态,并收到了 SECO 事件 0x 00a0fa29(AHAB_BAD_KEY_HAS_IND)。这确认签名消息已准备就绪,可以在 " OEM Closed " 设备上使用。 第 2 步:烧毁 OEM SRK 哈希熔丝。 步骤3:使用签名镜像刷新并启动;确认启动过程中未发生 SECO 事件。此确认设备处于安全启动状态。 第 4 步:使用其 sysfs 驱动程序将 LC 高级到" OEMClosed" 。 第 5 步:重启板并尝试将 LC 返回 OEM 现场退货;收到了 SECO 事件 0x00A0AB29。此事件表示 "熔丝已被写入/读取锁定"。 第 6 步:重新启动板,它处于 OEM 现场返回状态。 您认为上述步骤有问题吗? 请注意,我们刚刚收到买家的最新消息,称他们在另一块板上完成了上述所有步骤 & 看到 " " 熔丝 被写入/读取锁定 " " 错误。而且 " 尽管如此,在板上进行电源循环后,LC 成功更改为 " OEM Field Return " -安基特 Re: Steps to enter Partial Field Return LifeCycle on i.MX 8/8X Family 嗨,安基特、 好久不见。希望你一切都好。 我不认为这是意料之中的事。但你说 LC 已经改变了。你能帮我检查一下吗? 找到所有与 LC 相关的熔丝(我记得它不只一个),看看客户之前是否对同一个单词进行了编程。 我将在下周末的电话中向 STEC 询问。请在周末提醒我。 顺祝商祺! 弗兰克 Re: Steps to enter Partial Field Return LifeCycle on i.MX 8/8X Family 你好@frank_zhang、 我们收到了客户关于从 " OEM 已 关闭 " 向 " i.mx8QXP " 设备的退货生命周期过渡到 " OEM Field Return " 的询问 。 客户在 Linux 内核中实施了一个 sysfs 驱动程序,以调用SECO API。使用该驱动程序,他们能够将生命周期从 "NXP Closed (OEM Open)"成功过渡到"OEM Closed"。 但是,当他们尝试将生命周期状态返回到"OEM Field Return" 时,他们遇到了一个问题,希望得到一些澄清。 调用 SECO API(SC_SECO_FUNC_RETURN_LIFECYCLE)后,它们会收到以下 SECO 事件:SECO event[0] =0x00A0AB29。此事件表示 "熔丝已被写入/读取锁定"。 尽管如此,在板上执行电源循环后,生命周期似乎成功更改为 " OEM Field Return "。 这种行为是预料之中的吗?
View full article
KW45/MCXW71 将时钟外设从 FRO6M 更改为其他时钟源 在现代嵌入式系统中,精确且可靠的时钟信号对于数字外设的正确运行至关重要。恩智浦的 KW45 和 MCXW71 等微控制器依赖内部振荡器为 UART、SPI、定时器和 ADC 等外设提供时序参考。其中一种振荡器是 6 MHz 自由运行振荡器(FRO6M),它通常被用作默认时钟源。 本文提供了以下内容的全面指南: 选择和配置备用时钟源 选择替代时钟源 KW45/MCXW71 微控制器提供了多种替代方案,包括 192 MHz 自由运行振荡器(FRO192)、RF_OSC 和外部晶体振荡器。每种方案都有其自身优势:FRO192 稳定且可用,而外部振荡器则能提供长期精度。时钟源的选择应基于外设的时序要求、功耗限制以及当前工作模式下时钟的可用性。 重新配置外设时钟源 使用 SDK 的时钟管理 API,在 KW45 上重新配置外设的时钟源非常简单。CLOCK_SetIpSrc() 函数允许开发人员为特定外设分配新的时钟源。 示例:将 UART 时钟源从 FRO6M 更改为其他时钟源。 UART外设连接到FRO6M uint32_t uartClkSrcFreq = BOARD_DEBUG_UART_CLK_FREQ; CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro6M); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq); 例如,要将 UART 从 FRO6M 切换到 FRO-192M,可以使用以下代码: //Replace kCLOCK_Lpuart1 for your peripheral for clicking CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro192M); 同样,在上述示例中,我们必须将 uint32_t uartClkSrcFreq 变量设置为与 FRO192M 相对应的正确频率值,因为 FRO192M 被用作时钟源,但同样的逻辑也适用于该外设的任何其他时钟源。 模块的其他时钟更改可按以下示例操作: //Change clock source for LPIT 0 module from 6M FRO to other clocksources /* Iniital source for the LPIT module */ CLOCK_SetIpSrc(kCLOCK_Lpit0, kCLOCK_IpSrcFro6M); /* Set the new source for the LPIT 0 module */ CLOCK_SetIpSrc(kCLOCK_Lpit0, kCLOCK_IpSrcFro192M); /* Set the corresponding divider for application, need to be decided by developer*/ CLOCK_SetIpSrcDiv(kCLOCK_Lpit0, 15U); /* Set the source for the TPM 0 module */ CLOCK_SetIpSrc(kCLOCK_Tpm0, kCLOCK_IpSrcFro6M); /* Set the source for the TPM 0 module */ CLOCK_SetIpSrc(kCLOCK_Tpm0, kCLOCK_IpSrcFro192M); /* Set the corresponding divider for application, need to be decided by developer*/ CLOCK_SetIpSrcDiv(kCLOCK_Tpm0, 3U); //Change clock source for Luart 1 module from 6M FRO to other clocksources CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro6M); /* Set the source for the Lpuart 1 module */ CLOCK_SetIpSrc(kCLOCK_Lpuart1, kCLOCK_IpSrcFro192M); uartClkSrcFreq = CLOCK_GetIpFreq(kCLOCK_Lpuart1); DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq); 更改时钟源后,重新初始化外设非常重要,以确保波特率、预分频器或采样间隔等时序参数被正确重新计算。这一步骤确保外设在新时钟配置下可靠运行。 以上是一些更改部分外设时钟源的示例,但同样的逻辑可应用于任何其他模块或外设,这些示例取自 SDK 2.16.00,用以说明如何将配置了时钟源的模块切换到另一个时钟源。
View full article
S32G_M7_STBYFULLBOOT_A53STR this doc and project explain how to integrate S32G M stby demo and Linux STR demo to one demo to achieve the fast boot, chinese version: 本文说明如何在S32G2 RDB2板上搭建 一个M7 MCAL Standby Fullboot GPIO resume Demo加A53 Suspend to RAM的Demo,主要的 应用场景是电动汽车的快速启动。 G3与更新版本BSP的支持情况与此类 似,不再另外说明,客户可以自行参考开发。 请注意本文为培训和辅助文档,本文不是 官方文档的替代,请一切以官方文档为准。 目录 1 参考资料说明与声明 .................................................. 2 2 STBY+STR的硬件注意点 .......................................... 3 3 修改M7 MCAL Standby Demo代码 ............................ 5 3.1 Clock相关修改 ........................................................ 5 3.2 MCU相关修改 ......................................................... 5 3.3 UART Clock相关修改 ............................................. 7 3.4 Port相关修改 .......................................................... 7 3.5 I2C相关修改 ........................................................... 7 3.6 实现M核进入STDY状态等待功能 ........................... 8 3.7 Main函数的修改 ..................................................... 8 4 修改Bootloader工程来支持同时Boot M/A核Demo ... 10 4.1 I2C Clock相关修改 ............................................... 10 4.2 Port相关修改 ........................................................ 11 4.3 其它修改 ............................................................... 12 5 修改A53 Linux代码 .................................................. 13 6 Demo 运行测试 ........................................................ 13 6.1 硬件连接 ............................................................... 13 6.2 镜像烧写 ............................................................... 13 6.3 Demo运行 ............................................................ 14 7 工程发布包............................................................... 15 8 未来开发建议 ........................................................... 17 8.1 M/A核同步机制 ..................................................... 17 8.2 功能安全与信息安全 ............................................. 17 9 遗留问题 .................................................................. 17 9.1 IPCF STR支持 ...................................................... 18 9.2 PFE Slave STR支持 ............................................. 18 注意以下说明与声明: 说明: 汽车网关有快速启动要求,而电动车因为驻车时有更大的电池提供待机电源,所以希望是使 用Linux 的suspend to ram 的功能来实现Linux 的快速启动,而在S32G 上则需要考虑将M 核的 Standby 功能 与A 核的STR 功能 结合起来,目前可用的资源包括:  从BSP32 起支持ATF,可以支持Linux 端的STR 功能,文档《S32G_Linux_STR_V1-*.pdf》 (John.Li)说明linux STR 的原理和与M7 Standby Demo 结合时所需要的修改。  NXP 的M7 内部standby demo,可以支持M 核端的standby 功能,支持full boot 和standby ram boot。文档《S32G_Standby_Demo_V4-*.pdf》(John.Li)有详细说明,本文使用MCAL full boot+GPIO resume Demo。  本Demo 与本文主要说明如何将这两个Demo 结合起来,形成一个整体的Demo。  由于需要Boot M 核加A 核,所以也需要Bootloader 工程的支持,文档 《S32G_Bootloader_V1-*.pdf》(John.Li)说明了如何创建一个MCAL sample 加Linux 的 Bootloader 工程。 声明: 请注意:  M7 standby demo 本来为NXP 内部Demo,不保证运行质量。而Linux 本身也是reference software。  Linux STR 本身会引入比较复杂的电源管理切换,也会引起系统级的不稳定性。  本文所说的方法也是实验性质,不保证运行质量。 所以客户应该谨慎决定其产品功能并自行保证其产品质量,本文及本Demo 仅为Demo 性质。 This article explains how to build a demo of M7 MCAL Standby Fullboot GPIO resume Demo plus A53 Suspend to RAM on the S32G2 RDB2 board. The main application scenario is the quick start of electric vehicles. The support situation of G3 and the newer version of BSP is similar to this, no further explanation is given, customers can refer to it for development by themselves.  Please note that this article is a training and auxiliary document. This article is not a substitute for the official document. Please refer to the official document. Contents 1    Reference materials and statement 2 2    STBY+STR hardware checkpoints. 3 3    Modified M7 MCAL Standby Demo codes. 5 3.1  Clock modification. 5 3.2  MCU related modification. 6 3.3  UART Clock related modificaiton. 7 3.4  Port related modification. 8 3.5  I2C related modification. 8 3.6  Enable the waiting function of M core entering STDY. 9 3.7  Main function modification. 9 4    Modify the Bootloader project to support simultaneous M/A core demo  11 4.1  I2C Clock related modification. 11 4.2  Port related modifcaiton. 11 4.3  Others modificaiton. 13 5    Modify A53 Linux codes. 14 6    Demo running and testing. 14 6.1  Hardware link. 14 6.2  Image burning. 14 6.3  Demo running. 15 7    Project release package. 16 8    Suggestion for the future development 17 8.1  M/A core sync mechanism.. 17 8.2  Function safety and Information security. 17 9    Remaining issues. 18 9.1  IPCF STR support 18 9.2  PFE Slave STR support 18 as need refer: S32G_Linux STR This doc explain S32G Linux STR details and modify to integrate with M stdy demo https://community.nxp.com/t5/NXP-Designs-Knowledge-Base/S32G-Linux-STR/ta-p/1652680 S32G Standby Demo the project build a new Mcal standby demo and explain its details https://community.nxp.com/t5/NXP-Designs-Knowledge-Base/S32G-M-kernel-Standby-demo-and-how-to-porting-to-Mcal/ta-p/1556313 S32G Boot customization doc how to run bootloader to run mcal&linux https://community.nxp.com/t5/NXP-Designs-Knowledge-Base/S32G-Bootloader-Customzition/ta-p/1519838 Automotive Re: S32G_M7_STBYFULLBOOT_A53STR Update my issue state: Modify as following, use EB to build can success but boot failed. No console output. - bootloader >> MCU >> MCU >> General >> Config Variant => VariantPreCompile - Bootloader >> SysDal >> SysDal >> General >> SysDalGeneral 的 Enable MCU from sysdal = unchecked Hi John, Did you meet the build error?  Thanks. Re: S32G_M7_STBYFULLBOOT_A53STR Hi John, We want to open ivt tool but met some troubles: Does it look like software version mismatch? Another trouble is build failed: May I lose some steps? Thanks. Allen
View full article
LLM Edge Studio LLM Edge Studio In this post, I want to share a quick walkthrough of LLM Edge Studio, an NXP launcher application designed to test supported Large Language Models running locally on i.MX platforms with Ara240 DNPU acceleration. LLM Edge Studio provides a simple GUI to select a model, load it, enter prompts, and interact with an LLM directly at the edge. It communicates with the Ara240 Runtime SDK through the eIQ AAF Connector, using a REST-based interface for prompt submission and streaming token responses.   Key Features Local LLM inference on supported i.MX platforms Ara240 DNPU acceleration GUI-based model selection and prompt input Streaming token output Integration with eIQ AAF Connector and Ara240 Runtime SDK   Supported Models Qwen2.5-coder-1.5B Qwen2.5-7B-Instruct These models are provided as Ara240-compatible model.dvm files and are intended for local execution on the target platform.   Running LLM Edge Studio Start the application with: run_llm_edge_studio Before launching, make sure the Ara240 runtime service is running: systemctl status rt-sdk-ara2.service --no-pager -l Once the GUI appears, click LOAD to load the selected model. After the model is ready, enter a prompt and submit it to start interacting with the LLM.   Walkthrough Video In the attached video, I show how to launch LLM Edge Studio from GoPoint, load a supported model, submit a prompt, and view the generated response running locally on the i.MX platform with Ara240 DNPU acceleration. (function() { var wrapper = document.getElementById('lia-vid-6405411704112w960h540r491'); var videoEl = wrapper ? wrapper.querySelector('video-js') : null; if (videoEl) { if (window.videojs) { window.videojs(videoEl).ready(function() { this.on('loadedmetadata', function() { this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) { bar.setAttribute('role', 'presentation'); bar.setAttribute('aria-hidden', 'true'); }); }); }); } }})(); (view in My Videos)   Summary LLM Edge Studio is a useful tool for quickly evaluating local LLM inference on NXP i.MX platforms using Ara240 DNPU acceleration. It provides a simple workflow for model loading, prompt testing, and observing token streaming directly at the edge. Link LLM Edge Studio repository: https://github.com/nxp-imx-support/llm-edge-studio ARA2-M2-16G-GT ARA240 Hands-On Training
View full article
NXP Model-Based Design Toolbox for S32K3 version 1.8.0 - Product Release Announcement Product Release Announcement Analog & Automotive Embedded Systems NXP Model-Based Design Toolbox for S32K3 – version 1.8.0 The Analog & Automotive Embedded Systems, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32K3 version 1.8.0. This release supports automatic code generation for S32K3 peripherals and applications prototyping from MATLAB/Simulink for NXP S32K3 Automotive Microprocessors. This new product adds support for S32K310, S32K311, S32K312, S32K314, S32K322, S32K324, S32K328, S32K338, S32K341, S32K342, S32K344, S32K348, S32K356, S32K358, S32K364, S32K366, S32K374, S32K376, S32K388, S32K389, S32K394 and S32K396 MCUs, and part of their peripherals, based on RTD MCAL components (ADC, CAN, DIO, FEE, GPT, I2C, ICU, LIN, MEM, MCL, PWM, SPI, UART). In this release, we have also updated the RTD, S32 Configuration Tools, AMMCLib, FreeMASTER, and MATLAB support for the latest versions. The product comes with over 130 examples, covering all the features and functionalities of the toolbox, including new demos for motor control applications. Target audience: This product is part of the Automotive SW – Model-Based Design Toolbox. FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=7690521 Technical Support: NXP Model-Based Design Toolbox for S32K3 issues will be tracked through the NXP Model-Based Design Tools Community space. Release Content: Automatic C code generation from MATLAB® for NXP S32K3 derivatives: S32K310 S32K311 S32K312 S32K314 S32K322 S32K324 S32K328 S32K338 S32K341 S32K342 S32K344 S32K348 S32K356 S32K358 S32K364 S32K366 S32K374    S32K376    S32K388 S32K389 S32K394  S32K396 Support for the following peripheral components and functions: ADC CAN DIO eTPU FEE GPT I2C ICU LIN MCL (including DMA support) MEM Memory read/write PWM Profiler Registers read/write SPI UART New RTD version supported (7.0.0) New S32 Configuration Tools version supported (2025.R1.8)😎 Integration with EB tresos v32.0.0 Provides 2 modes of operation: Basic – using pre-configured configurations for peripherals; useful for quick hardware evaluation and testing Advanced – using S32 Configuration Tools or EB tresos to configure peripherals/pins/clocks Default Configuration Project Templates targeting all the supported S32K3 derivatives The toolbox delivers default configuration projects, available in both S32 Configuration Tools and EB tresos, covering an initial enablement of the on-board peripherals, pins, and clocks, for all the supported S32K3 derivatives. The desired template, which represents the starting point for enabling the hardware configuration of the application, can be selected via a dropdown widget. Support for creating and using Custom Project Templates The toolbox provides support to use and create custom project templates. This could be very useful when having a custom board design – offering the possibility to create the configuration for it only once. After it is saved as a custom project template, it can be used for every model that is being developed.   Such custom projects, addressing specific hardware designs are offered inside the current version of the toolbox to integrate the following EVBs: S32K312MINI-EVB MCTPTX1AK324 S32K344-WB S32K3-T-BOX S32K396-BGA-DC1 MR-CANHUBK344, alongside a set of examples specifically created to target this hardware design and a series of articles (available on NXP Community) demonstrating how to use the toolbox features and functionalities for creating applications for custom boards. The toolbox has been tested and validated on the official NXP Evaluation Boards     S32K31XEVB-Q100     S32K312EVB-Q172     S32K312MINI-EVB     MCTPTX1AK324     XS32K3X2CVB-Q172     S32K3-T-BOX     MR-CANHUBK344       XS32K3X4EVB-Q257     XS32K3X4EVB-Q172           S32K3X4EVB-T172      S32K344-WB        XS32K3X8CVB-Q172     S32K388EVB-Q289      S32K389EVB-Q437            XS32K396-BGA-DC     XS32K396-BGA-DC1 Integrates the Automotive Math and Motor Control Library release 1.1.42 All functions in the Automotive Math and Motor Control Functions Library v1.1.42 are supported as blocks for simulation and embedded target code generation. FreeMASTER Integration We provide several Simulink example models and associated FreeMASTER projects to demonstrate how our toolbox interacts with the real-time data visualization tool and how it can be used for tuning embedded software applications. S32 Design Studio integration We provide the feature of importing the code generated from a Simulink model inside the S32 Design Studio IDE. This functionality can be useful if the model needs to be integrated into an already existing project or for debug purposes. Simulation modes We provide support for the following simulation modes (each of them being useful for validation and verification): Software-in-Loop (SIL) Processor-in-Loop (PIL) including AUTOSAR SW-C deployment External mode Motor Control Applications The toolbox provides examples for 1-shunt and 2-shunt PMSM and BLDC motor control applications, supporting both S32 Configuration Tools and EB  tresos. Each of the examples provides a detailed description of the hardware setup and an associated FreeMASTER project which can be used for control and data visualization. The toolbox also demonstrates the integration of the Motor Control Blockset in developing such applications. For demonstrating the S32K3 eTPU Software integration, we have included a PMSM application where the FOC algorithm runs on the main CPU of the S32K396 MCU, while the analog sensing, software resolver, and PWM signals generation are offloaded to the eTPU co-processor. The motor control applications were developed and validated on the MCSPTE1AK344 and MCSPTR2AK396 Motor Control kits.   Support for MATLAB versions We added support for the following MATLAB versions: R2023b R2024a R2024b R2025a R2025b Examples for every peripheral/function supported More than 130 examples showcasing: I/O Control Timers and scheduling Communication (CAN, I2C, LIN, SPI, UART) Memory handling Motor Control applications (BLDC and PMSM) AMMCLib FreeMASTER SIL / PIL / External mode For more details, features, and how to use the new functionalities, please refer to the Release Notes and User Manual documents attached. MATLAB® Integration: The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32K3 MCUs and evaluation board solutions out-of-the-box. NXP Model-Based Design Toolbox for S32K3 version 1.8.0 is fully integrated with MATLAB® environment. Target Audience: This release (1.8.0) is intended for technology demonstration, evaluation purposes, and prototyping S32K3 MCUs and Evaluation Boards. Useful Resources: Examples, Trainings, and Support: https://community.nxp.com/community/mbdt
View full article
AR1335 カメラセンサドライバ @kerryzhou このカメラ センサ AR1335 を NXP 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 バージョンをBSPで使用しているものに置き換えます(ここではv20を使用します) 別のセンサ用のドライバを展開する方法の例を次に示します。 https://www.nxp.com/docs/en/application-note/AN13712.pdf Re: AR1335 camera sensor driver こんにちは、ありがとうございます。私はこの分野の初心者なので、質問がおかしくなるかもしれません。Debian または Yocto を使用しましたか?標準ドライバへのリンクを教えていただけますか? Re: AR1335 camera sensor driver こんにちは、ファビオさん。 はい、標準ドライバを使用して実行できました。 これまではHD 1080pの解像度を使用していました。 数日中に4K以上も試してみる予定です。 Re: AR1335 camera sensor driver こんにちは、 カメラAR1335とMx8 plusの接続に成功したかどうかを知りたいです お願いします ファビオ Re: AR1335 camera sensor driver こんにちは、マイケル。 >>このセンサはNXP iMX8M Mini SoCを使用してすでに動作しています 私はこれにとても興味があります。ソースコードとデバイスツリーファイルを提供する事は可能でしょうか? 私はこれを非常によく似た iMX8M-plus でも動作させようとしています。 ありがとう、MC Re: AR1335 camera sensor driver こんにちは、 michael_partheiさん すでに弊社の社内専門家に確認していただき、新しい投稿で返信させていただきます。 新しい問題が発生した場合は、新しい投稿をフォローしてください。 よろしくお願いいたします。 kerry Re: AR1335 camera sensor driver ありがとう、ケリー!この問題について議論するために新しいトピックを開きました: https://community.nxp.com/t5/i-MX-RT/RT1170-Using-MIPI-CSI-with-grayscale-or-raw-image-sensors/mp/1270310#M14031 Re: AR1335 camera sensor driver こんにちは、 michael_partheiさん 内部 AE の説明によると、これは SDK の問題ではなく、チップ MIPI CSI がサポートできない問題です。 SO、リファレンス・マニュアルにはFUTUREに関連する説明が追加される予定です。 ただし、生データを使用する場合は、mipi-csi ではなくパラレル CSI インターフェースを使用する必要があります。 ご不便をおかけして申し訳ございません。 よろしくお願いいたします。 kerry Re: AR1335 camera sensor driver こんにちは、ケリーさん。 明確にするために:これは、RT1176(正確にはOV9281、データ形式はRAW8)では8ビットモノクログレースケールセンサの使用は不可能だという意味ですか?これはハードウェアの根本的な制限でしょうか、それともFUTURE修正される予定の SDKs の問題でしょうか? 同様の MIPI CSI ペリフェラルを使用していると思われる NXP iMX8M Mini SoC を使用して、このセンサをすでに実行していますが、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 応答を取得すると、本当に悲しい話になりますが、MIPI-CSI2 は VIDEO_MUX のバグのために生データをサポートできず、この情報は RT1170 リファレンス・マニュアルに追加されます。 SO、外部 AR1335 がサポートされるように構成できるかどうかを確認してください。RGBですか? 現在、生のデータは 10 ビットですが、回避策はありません。 返信が遅くなってしまい申し訳ございません。ご尽力いただきまして誠にありがとうございます。 よろしくお願いいたします。 kerry Re: AR1335 camera sensor driver フォーラムの他のメンバーまたは NXP チームからの私の問題に対するフィードバック。本当に時間がないので、これを整理する必要があります。CAN助けてください。 Re: AR1335 camera sensor driver @kerryzhou お元気でお過ごしでしょうか?あなたに連絡して、私の問題に関して何か最新情報があるかどうかを確認したいだけです。 ここでも、出力ピクセル データごとに 10 ビットの生データをキャプチャできるように CSI ドライバを構成するための支援が必要です。データをキャプチャした後、独自のソフトウェアを使用してデータを RGB 888 形式に変換できます。 よろしくお願いいたします。 Re: AR1335 camera sensor driver こんにちは、ケリーさん。 もう 1 つお知らせしたいのは、カメラ センサの出力形式は RAW10 (10 ビット) ですが、現在の nXP 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, YUYV。 */ kVIDEO_PixelFormatYVYU = FSL_VIDEO_FOURCC('Y', 'V', 'Y', 'U'), /*!< YUV422, YVYU. */ kVIDEO_PixelFormatUYVY = FSL_VIDEO_FOURCC('U', 'Y', 'V', 'Y'), /*!< YUV422, UYVY。 */ kVIDEO_PixelFormatVYUY = FSL_VIDEO_FOURCC('V', 'Y', 'U', 'Y'), /*!< YUV422, VYUY. */ kVIDEO_PixelFormatXYUV = FSL_VIDEO_FOURCC('X', 'Y', 'U', 'V'), /*!< YUV444, XYUV. */ kVIDEO_PixelFormatXYVU = FSL_VIDEO_FOURCC('X', 'Y', 'V', 'U'), /*!< YUV444, XYVU. */ } ビデオピクセルフォーマットt; アプリケーションコードでRaw10をRGB888に変換できますか? 参考までにデータシートをいくつか添付しました。 Re: AR1335 camera sensor driver こんにちは、 fmabroukさん 情報をいただきありがとうございます。 しばらくお待ちください。コードの詳細を確認し、社内の CSI エキスパートに確認します。 有益な情報が入りましたら、できるだけ早くお知らせいたします。 もう少しお時間をください、SOありがとうございます! よろしくお願いいたします。 kerry Re: AR1335 camera sensor driver @kerryzhou @ジンパン カメラ センサがデータをストリーミングしていることをスコープで確認し、コードのデバッグ中に 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 ; pre_pll_clk_div (N値) = 2 ; pll_multiplier2 (M2値) = 55 ; pre_pll_clk_div2 (N2値) = 2 ; Fpfd = 12 MHz ; Fvco = 660 MHz ; Fvco2 = 660 MHz ; Vt システム除算器 = 1 ; Vt Pix Divider = 3 ; オペレーションシステム除算器 = 1 ; Op Pix Divider = 6 ; ; [画像パラメータ] ; 要求フレーム数/秒: 30 ; 出力列数: 640 ; 出力行数: 480 ; Y合計を使用する: チェックなし ; Xのみのビニング: チェックなし ; スキップを許可する: チェックあり ; ブランキング計算: HB Max、次にVB ; ; 最大フレーム時間: 33.3333 ミリ秒 ; 最大フレームクロック: 7333333.3時計 ; 読み出しモード: 1、YSum: いいえ、XBin: いいえ ; 水平クロック: 640 アクティブ + 1688 ブランク = 合計 2328 ; 垂直行: 480 アクティブ + 2674 空白 = 合計 3154 ; 出力列数: 640 ; 出力行数: 480 ; 視野角: 640 ; 視野行数: 480 ; 実際のフレームクロック: 7342512 クロック ; 行時間: 10.582 マイクロ秒 / 2328 クロック ; 積分時間: 33 ミリ秒。 ; フレーム時間: 33.375055 ミリ秒 ; 最大フレームレート: 191.739fps ; フレームレート: 29.962 fps Re: AR1335 camera sensor driver @kerryzhou 私はimx RT1170でmipi CSI2デモ コードを使用して、AR1335から480x640の画像を取得しています。 このカメラセンサの出力形式は 10 ビットであることがわかりました。必要なイメージをキャプチャできるようにするには、CSI ドライバでどのような変更を行う必要がありますか。 メーカーのツールを使用して構成ファイルを生成しましたが、CSI ドライバが誤って構成されているため、イメージを取得できません。 AR1335 からイメージをキャプチャするためにデモ コード CSI ドライバで何を変更する必要があるかアドバイスをお願いします。 敬具 Re: AR1335 camera sensor driver こんにちは、 fmabroukさん 今のところ、別のカメラセンサをインポートすることに関する直接的なドキュメントはまだありません。 私の知る限り、カメラ センサには、構成を行ってコードを生成できる構成ツールも必要です。AR1335には、すでにNXPについての関連ドライバがありますか? 内部的にも確認しましたが、今まで AR1335 RT 関連のドライバは見つかりませんでした。 よろしくお願いいたします。 kerry Re: AR1335 camera sensor driver @kerryzhou 私は、imX RT1170 開発ボードで OV5640 の代わりにこのカメラセンサ AR1335 を使用しています。AR1335 は 10 ビットの画像のみを送信します。OV5640 ピクセル データ バスは 16 ビットだと思います。 このセンサで画像を取得できるように、NXP SDK に付属の mipi csi デモ コードを変更するにはどうすればよいですか? このデモ コードに別のカメラ センサをインポートするプロセスをガイドするドキュメントがあればいいと思います。 よろしくお願いします!   Re: AR1335 camera sensor driver こんにちは、 fmabroukさん あなたが言及した時計については、RT1170 リファレンス・マニュアルから見つけることができます。 お役に立てれば幸いです! よろしくお願いいたします。 kerry Re: AR1335 camera sensor driver @kerryzhou @ジンパン 上記に投稿した質問の他に、ピクセル クロックを 80MHz に設定する必要があります。imx RT1170 の CSI2 mipi デモ コードでどのレジスタを変更する必要がありますか? ご回答をお待ちしています。 Re: AR1335 camera sensor driver @ジンパン @kerryzhou 私はまだ AR1335 カメラ ドライバを ImX RT1170 CCI2 mipi デモ コードに移植しようとしています。 CS2 mipi コードで次のクロックを見つけました: CLOCK_SetRootClock(kCLOCK_Root_Csi2、&csi2ClockConfig); 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
基于 Layerscape 平台上 OpenCV 神经网络框架的 EIQ 软件应用程序 NXP 为 QorIQ Layerscape 应用处理器创建了 eIQ 机器学习软件,这是一套 ML 工具,允许在 QorIQ Layerscape 系列设备上开发和部署 ML 应用程序。 OpenCV 是一个开源计算机视觉库。它为神经网络推理(DNN模块)和标准机器学习算法(ML模块)提供了统一的解决方案。它包含许多计算机视觉功能,可以更轻松地在短时间内构建复杂的机器学习应用程序,而无需依赖其他库。 本文档介绍了基于 OpenCV DNN 框架开发的 YOLO 对象检测、图像分割、图像着色、图像分类、人体姿势估计和文本检测应用程序。
View full article
HDMI Audio Setting 1. Set up HDMI 2. Test raw audio 3. Make HDMI audio the default output 4. Encoded audio 1. Set up HDMI Set up your kernel to use HDMI adding the following code to bootargs on u-boot: video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24 2. Test raw audio In order to test only raw audio, use the following command: aplay -D hw:1,0 Kaleidoscope.wav 3. Make HDMI audio the default output In order to configure audio output over HDMI, please, replace content of file ~/.asoundrc to the following one pcm.dmix_48000{      type dmix      ipc_key 5678293      ipc_key_add_uid yes      slave{           pcm "hw:1,0"           period_time 0           period_size 2048           buffer_size 24576           format S16_LE           rate 48000      } } pcm.!dsnoop_44100{      type dsnoop      ipc_key 5778293      ipc_key_add_uid yes      slave{           pcm "hw:0,0"           period_time 0           period_size 2048           buffer_size 24576           format S16_LE           rate 44100      } } pcm.!dsnoop_48000{      type dsnoop      ipc_key 5778293      ipc_key_add_uid yes      slave{           pcm "hw:1,0"           period_time 0           period_size 2048           buffer_size 24576           format S16_LE           rate 48000      } } pcm.asymed{      type asym      playback.pcm "dmix_48000"      capture.pcm "dsnoop_44100" } pcm.dsp0{      type plug      slave.pcm "asymed" } pcm.!default{      type plug      route_policy "average"      slave.pcm "asymed" } ctl.mixer0{      type hw      card 0 } This will configure alsa to use sound card hw:1,0. Please, pay attention to use the proper audio card name for your device. In order to see available sound cards on board: root@imx53qsb:~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: imx3stack [imx-3stack], device 0: SGTL5000 SGTL5000-0 []   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: imx3stackspdif [imx-3stack-spdif], device 0: IMX SPDIF mxc spdif-0 []   Subdevices: 1/1   Subdevice #0: subdevice #0 For detail on how to create asound.conf, please see alsa-lib configuration introduction. 4. Encoded audio For encoded (i.e. AC3, DTS) audio, you can use, for example, ac3dec, an utility provided by alsa-tools with the following command line: ac3dec -D hw:1,0 -C test.ac3 This would work for both HDMI audio and SPDIF audio. Double check your hardware and/or schematic in order to know which one to use. i.MX53 Multimedia Re: HDMI Audio Setting Dear Daiane Angolini, I created a new ticket through SR. Please check the below case from SR. [Case:00198948] How to configure the HDMI Audio as 24bit in i.MX6Q / Linux 3.14.52 Best Regards, Eric. Re: HDMI Audio Setting Could you, please, create a new ticket? Otherwise it might get off the radar Re: HDMI Audio Setting Dear Daiane Angolini, I want to know how to configure the HDMI Audio as 24bit in i.MX6Q / Linux 3.14.52. Please let me know how to do that. It's very helpful to me if you tell me how to confirm that in i.MX6Q Evaluation board. Actually I could confirm the below contents in the some documents. - HDMI Audio 24bit is supported in the i.MX6Q Reaference Manual   . Table 33-6. Data Arrangement in System Memory for L-PCM (24 bits) in Chapter 33   . - HDMI Audio 24bit is NOT supported in the i.MX6 Linux Reference Manual for Linux 3.14.52   . Chapter 15 On-Chip High Definition Multimedia Interface (HDMI) Driver   . Best Regards, Eric. Re: HDMI Audio Setting look for some pulseaudio conf file. Create a bbappend on your meta layer in order to add this by default on your image. (sorry, i don't know pulseaudio ) Re: HDMI Audio Setting i think the pulseaduio detect the output of audio, sometime is HDMI and sometime is the other, so i need to specify the HDMI as the default output, how to do ? Re: HDMI Audio Setting it looks like bad, i also stat up the daemon like what i said in mail list, i restart again with command "pulseaudio -D", the output of audio is not from HDMI except the "card 0: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []" it's really strange, help... Re: HDMI Audio Setting Well, I think you make it work (by your comment on meta-freescale) Re: HDMI Audio Setting Hi,      There is not the command "pacmd", just "pactl". BTW, i use the YOCTO project of FSL community to build all, what is my next step about for your ask ? Re: HDMI Audio Setting ohhhhhhhhhhhh you´re right! the way to configure pulseaudio is different.... From my old emails, I got this command line: pacmd set-default-sink 1 Could you, please, give it a try and let us know the results? Re: HDMI Audio Setting good, it really works if i use the native app to play audio in IMX6QSD but there is no audio output from HDMI with the pulse audio server. the output of audio just is from the "wm8962audio" as bellow in my IMX6QSD, any advices about this ? i want to use pulse audio server to output in HDMI interface. root@imx6qsabresd:~# aplay -l **** List of PLAYBACK Hardware Devices **** card 0: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 []   Subdevices: 1/1   Subdevice #0: subdevice #0 card 1: imxhdmisoc [imx-hdmi-soc], device 0: IMX HDMI TX mxc-hdmi-soc-0 []   Subdevices: 0/1   Subdevice #0: subdevice #0 Re: HDMI Audio Setting Hello, Very beautiful guide, how to set default SPDIF audio card on Android ? Thanks
View full article
HOWTO: Create a Blinking LED application project for S32G using S32 RTD No AUTOSAR This document shows the step-by-step process to create a simple blinking LED application for the S32G family using the S32 RTD non-AUTOSAR drivers. For this example used for the S32G-VNP-RDB2 EVB, connected via ethernet connection through S32 Debugger. Preparation Setup the software tools Install S32 Design Studio for S32 Platform Install the S32G development package and the S32 RTD AUTOSAR 4.4. Both of these are required for the S32 Configuration Tools. Launch S32 Design Studio for S32 Platform Procedure New S32DS Project OR Provide a name for the project, for example 'Blinking_LED_RTD_No_AUTOSAR'. The name must be entered with no space characters. Expand Family S32G2, Select S32G274A_Rev2 Cortex-M7 Click Next Now, uncheck the selection mark for other two cores.  Click '…' button next to SDKs Check box next to PlatformSDK_S32XX_2022_07_S32G274A_Rev2_M7_0. (or whichever latest SDK for the S32G is installed). Click OK Click Finish. Wait for project generation wizard to complete, then expand the project within the Project Explorer view to show the contents. To control the LED on the board, some configuration needs to be performed within the Pins Tool. There are several ways to do this. One simple way by double-click on the MEX file. By default, the Pins tool is then presented. For the Blinking LED example, one pin must be configured as output. The S32G-VNP-RDB2 EVB has an RGB LED for which each color is connect to a separate pin on the S32G-VNP-RDB2 EVB. For the blue LED the desired pin is PA_06. From the Peripheral Signals tab left to the Pins tool perspective layout, locate Open the Siul2_0 from the peripheral signals tab. And from the drop down menu select “gpio,6 PA_06” option as per shown in the following image. We are using PA_06 for the GPIO usage, so we are routing the SIUL2_0 GPIO signal to this pin. (This pin is also available for other modules like -FR, FTM, SPI_1) . The Direction required! menu will appear. Select Output then OK. In Routing Details view, notice a new line has been added and highlighted in yellow. Add ‘LED’ to the Label and Identifier columns for the PORTD 0 pin. Code Preview Go to Peripherals tool and add Siul2_Dio to enable LED blinking, it adjacent to the Blue LED on S32G-VNP-RDB2 EVB. Click on the Peripherals Tool icon from the Eclipse Perspective navigation bar. From the Components view, click on ‘Add a new configuration component…’ button from the Drivers category. This will bring up a list of all configuration components. Locate and then select the ‘Siul2_Dio’ component from the list and click OK. Do not worry about the warning message. It is only indicating that the driver is not already part of the current project. The associated driver package will be added automatically. Note: It may be necessary to change the selection at the top from ‘Present in the tool-chain project’ to ‘All’. The DIO driver provides services for reading and writing to/from DIO Channels. Also, select the Siul2_Port_1 tab and select the check mark against ‘Siul2 IP Port Development Error Detect’ option as below. The Gpio_Dio driver requires no further configuration. Click Save to store all changes to the .MEX file. Now the device configurations are complete and the RTD configuration code can be generated. Click ‘Update Code’ from the menu bar. To control the output pin which was just configured, some application code will need to be written. Return to the ‘C/C++’ perspective. If not already open, in the project window click the ‘>’ next to the ‘src’ folder to show the contents, then double click ‘main.c’ file to open it. This is where the application code will be added. Before the pin can be controlled, it needs to be initialized using the configuration information that was generated from the S32 Configuration tools. Initialize all pins using the Port driver by adding the following line: Insert the following line into main, after the comment 'Write your code here': /* Initialize all pins using the Port driver */ Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0); Now, add logic for the LED turn and off. To turn the pin on and off with some delays in-between to cause the LED to blink. Make the delays long enough to be perceptible. Add line to initialize variable uint8 i = 0; Change the code within the provided for loop, and add the following lines: //logic for blinking LED 10 times for (i=0; i<10; i++) {       Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 1U);       level = Siul2_Dio_Ip_ReadPin(LED_PORT, LED_PIN);       TestDelay(2000000);       Siul2_Dio_Ip_WritePin(LED_PORT, LED_PIN, 0U);       level = Siul2_Dio_Ip_ReadPin(LED_PORT, LED_PIN);       TestDelay(2000000); } return (0U); And add this line above the main() function to initialize the variable volatile uint8 level; Before the 'main' function, add a delay function as follows: void TestDelay(uint32 delay); void TestDelay(uint32 delay) {    static volatile uint32 DelayTimer = 0;    while (DelayTimer    {        DelayTimer++;    }    DelayTimer=0; } Update the includes lines at the top of the main.c file to include the headers for the drivers used in the application: Remove #include "Mcal.h" Add #include "Siul2_Port_Ip.h" #include "Siul2_Dio_Ip.h" Build 'Blinking_LED_RTD_No_AUTOSAR'. Select the project name in 'C/C++ Projects' view and then press 'Build'. After the build completes, check that there are no errors. Open Debug Configurations and select 'Blinking_LED_RTD_No_AUTOSAR_Debug_RAM'. Make sure to select the configuration which matches the build type performed, otherwise it may report an error if the build output doesn’t exist. Now, you need to Select the Interface (Ethernet or USB) by which the S32 Debug Probe is connected. If connected via USB and this option is selected for interface, then the COM port will be detected automatically (in the rare event where 2 or more S32 Debug Probes are connected via USB to the host PC, then it may be necessary to select which COM port is correct for the probe which is connected to the EVB) If connected via Ethernet, enter the IP address of the probe. See the S32 Debug Probe User Manual for ways to determine the IP address. Click Debug To see the LED blink, click ‘Resume'. This code as it will blink the LED times, you can make changes in for loop condition to blink it infinitely. Re: HOWTO: Create a Blinking LED application project for S32G using S32 RTD No AUTOSAR I'm attempting to use a S32G-VNP-RDB3 to evaluate the S32G3. I follow this HOWTO and what I see with a newly installed S32 DS matches fairly well until 13. First, I don't understand the "it adjacent to the Blue LED on S32G-VNP-RDB2 EVB." This section of the HOWTO seems to be working within the S32 DS so I don't understand the reference to a LED location of the evaluation board. Second, I don't see Siul2_Port_1 or Siul2_Dio shown from step 13b and beyond. I'm attempting to attach an image that shows what I see.
View full article
IMX8MP MIPI DSI to eDP bridge board support 1. HW Environment:     IMX8mp-evk board.     ITE6151 mipi dsi to eDP bridge board. 2. SW Environment:     IMX YOCTO 5.4.24-2.1.0 release. 3. Patch operation:     a. git clone https://source.codeaurora.org/external/imx/linux-imx.git     b. git checkout -b  imx_5.4.24_2.1.0 origin/imx_5.4.24_2.1.0     c. patch -p1 < ../ite6151_mipi2edp_linux_5.4.24_20200921.patch 4. Tested on imx8mp-evk board with DP monitor on 1080p mode: 5. Attached doc list:     IT6151 demo board user guide v1.0.pdf ------  ite6151 bridge board HW guide     it6151_qfn48_v20_20190905-01_end.pdf  ------  ite6151 bridge board SCH     imx8mp_ite6151_mipi2edp_linux_5.4.24_20200921.patch ------  Linux kernel driver patch     Image + imx8mp-evk-it6151.dtb  ------  test image and dtb i.MX 8M | i.MX 8M Mini | i.MX 8M Nano
View full article
Compiling L5.4.3_1.0.0 BSP On Ubuntu 180.4 LTS We will cross compile L5.4.3_1.0.0 on ubuntu18.04 LTS platform in three steps. 1. Installing Ubuntu 18.04 to vmplayer14 & Configuring Ubuntu 18.04 LTS 2. Compiling L5.4.3_1.0.0 BSP According to Steps in i.MX_Yocto_Project_User's_Guide.pdf 3. Handling tensorflow-lite compilation errors. --BEGIN No.1 Installing Ubuntu 18.04 to vmplayer14 & Configuring Ubuntu 18.04 LTS 1. Install 18.04 on vmplayer After installation is done, root user should be set at first. # sudo passwd root Then follow these steps to configuration ubuntu 18.04 for environment of compiliation --Changing sources of ubuntu 18.04 mirror If you are Chinese users, you can do the step, which can improve your system performance. # sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak # sudo geit /etc/apt/source.list Comment I.MX customers outside China do not need to modify Ubuntu source list, or can modify it to local mirror site of Ubuntu 18.04, which can improve the speed of software upgrade. Delet all sources and copy following lines here, Then save it and exit Update ubuntu source deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse Then running these 2 commands to update sources and packages # sudo apt-get update # sudo apt-get upgrade 2. Installing packages for compiliation Packages For Compiling BSP # sudo apt-get install flex bison gperf build-essential zlib1g-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev tofrodos python-markdown libxml2-utils xsltproc # sudo apt-get install uuid-dev:i386 liblzo2-dev:i386 gcc-multilib g++-multilib subversion openssh-server openssh-client uuid uuid-dev zlib1g-dev liblz-dev lzop  liblzo2-2 liblzo2-dev git-core curl # sudo apt-get install u-boot-tools mtd-utils android-tools-fsutils openjdk-8-jdk device-tree-compiler aptitude libcurl4-openssl-dev nss-updatedb # sudo apt-get install chrpath texinfo gawk cpio diffstat No.2 Compiling L5.4.3_1.0.0 BSP According to Steps in i.MX_Yocto_Project_User's_Guide.pdf          The detailed BSP compilation steps are given in i.MX_Yocto_Project_User's_Guide.pdf. Here are just some tips and simple steps. For Chinese customers, the system may not respond when the repo init or repo sync command is executed after obtaining the repo script. Detailed description is below: (1)Getting repo script # mkdir ~/bin (this step may not be needed if the bin folder already exists) # curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo # chmod a+x ~/bin/repo # export PATH=~/bin:$PATH (2)Getting Yocto source # mkdir imx-yocto-bsp # cd imx-yocto-bsp # repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-zeus -m imx-5.4.3-1.0.0.xml # repo sync          After running repo init or repo sync, you may encounter a situation where there is no progress for a long time, and repo sync stops there without any prompt. This may be caused by googlesource site being inaccessible.          At this time, you can modify the googlesource URL to the URL of Tsinghua University. # gedit ./repo          Changing REPO_URL = 'https://gerrit.googlesource.com/git-repo'          To be:                    REPO_URL = 'https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'          Save and exit. Then run “repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-zeus -m imx-5.4.3-1.0.0.xml”. or repo sync No.3 Handling tensorflow-lite compilation errors       If you encounter a tensorflow-lite compilation error during the compilation process, the following processing methods may be helpful to you. Cause Analysis:          Compiling tensorflow-lite requires three steps: fetching packages, configuring environment, and compiling code.          During the configuring environment, the following 8 software packages need to be downloaded. If any of the 8 files are not successfully downloaded, an error will be reported and compilation will be terminated.          ①9f48e814419e.tar.gz          ②38ebac7b059e84692f53e5938f97a9943c120d98.zip          ③release-1.8.0.tar.gz          ④389ec3f906f018661a5308458d623d01f96d7b23.tar.gz          ⑤master.zip          ⑥816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz          ⑦1f5eae5d6a135ff6811724f6c57f911d1f46bb15.tar.gz          ⑧fft.tgz          If you encounter this problem, you can refer to the following methods to solve it. Open the file with editor: ~/imx-yocto-bsp/build-xwayland/tmp/work/aarch64-poky-linux/tensorflow-lite/1.13.2-r0/git/tensorflow/lite/tools/make/download_dependencies.sh URLs EIGEN_URL="https://bitbucket.org/eigen/eigen/get/9f48e814419e.tar.gz" GEMMLOWP_URL="https://github.com/google/gemmlowp/archive/38ebac7b059e84692f53e5938f97a9943c120d98.zip" GOOGLETEST_URL="https://github.com/google/googletest/archive/release-1.8.0.tar.gz" ABSL_URL="https://github.com/abseil/abseil-cpp/archive/389ec3f906f018661a5308458d623d01f96d7b23.tar.gz" NEON_2_SSE_URL="https://github.com/intel/ARM_NEON_2_x86_SSE/archive/master.zip" FARMHASH_URL="https://github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz" FLATBUFFERS_URL="https://github.com/google/flatbuffers/archive/1f5eae5d6a135ff6811724f6c57f911d1f46bb15.tar.gz" FFT2D_URL="http://www.kurims.kyoto-u.ac.jp/~ooura/fft.tgz" Save and exit. [comment]     Don’t run “bitbake tensorflow-lite -c cleanall before you modify it”, otherwise files will be deleted.  Then try to compile tensorflow-lite like below: # bitbake tensorflow-lite -c compile   At the same time, we can open this directory and check if the following directories are created. If these 8 directories are successfully created, it means that links we modified are no problem.          After tensorflow-lite is successfully built, we can continue to compile full images. # bitbake imx-image-full --END NXP TIC team Weidong Sun 2020/3/30 i.MX 8 Family | i.MX 8QuadMax (8QM) | 8QuadPlus
View full article
FAQs - BMA7118/BMA7418 Battery Cell Controllers Introduction The BMA7118 and BMA7418 belong to NXP's latest family of 18-channel Li-ion battery cell controller ICs for advanced battery management systems. These devices are designed to provide accurate cell monitoring, low current consumption, integrated balancing, functional safety support, and scalable communication, making them suitable for demanding automotive and industrial battery applications. For customers interested in electrochemical impedance spectroscopy, the BMA7418 includes dedicated EIS support, while the BMA7118 provides a strong baseline solution with a convenient upgrade path within the same family. 1) What are BMA7118 and BMA7418? The BMA7118 and BMA7418 are NXP battery cell controller ICs designed for monitoring and balancing lithium-ion cells in battery management systems. They support 8 to 18 cells per device and are intended for applications such as EVs, HEVs, and industrial energy storage systems. 2) What is the main difference between BMA7118 and BMA7418? The main difference is EIS support. The BMA7418 includes integrated Discrete Fourier Transform functionality to support electrochemical impedance spectroscopy, while the BMA7118 targets high-accuracy battery monitoring without EIS. Both devices belong to the same product family and are positioned as pin- and software-compatible. 3) How many cells can one device monitor? One device can monitor from 8 up to 18 cells. This gives designers flexibility to optimize the battery architecture and reduce the number of monitoring ICs needed in larger battery packs. 4) What applications are these devices intended for? Typical target applications include automotive battery management systems for electric and hybrid vehicles, as well as industrial battery systems such as stationary energy storage and related electrification platforms. 5) What level of cell-voltage accuracy can I expect? The family is designed for very high measurement accuracy with ultra-low long-term drift. Typical accuracy for the family is ±0.8 mV, supporting precise battery monitoring and improved system performance. 6) Why is “dedicated ADC per voltage channel” important? Using a dedicated ADC for each voltage channel helps avoid the timing limitations of multiplexed measurement approaches. This supports highly synchronized cell measurements, which can improve SOC and SOH calculations and is especially important for EIS-capable systems. 7) What communication options are available? Depending on the variant, communication with the host MCU can be implemented through SPI or through an isolated daisy-chain transport protocol link (TPL). The daisy-chain approach supports scalable high-voltage battery systems with multiple monitoring nodes. 😎 How does the family support functional safety? The family is designed to support ASIL D-oriented battery management architectures. It includes redundant measurement paths, diagnostic functions, fault reporting, and safety-related monitoring features intended to support robust system-level functional safety designs. 9) Can the device measure temperatures and auxiliary signals? Yes. In addition to cell voltages, the devices support auxiliary analog inputs (AINx) that can be used for temperature sensing through external NTC networks and for other auxiliary measurements. These pins can also be configured as GPIOs. 10) What are the power-consumption advantages of this family? A key benefit is the integrated DC-DC converter, which helps reduce overall power consumption compared to solutions that rely on less efficient supply approaches. This can be beneficial for both active operation and low-power battery system scenarios. 11) What balancing capability is integrated? The family integrates passive balancing control with internal balancing FETs and supports balancing across up to 18 cells. It includes features such as timer-based balancing, voltage-based balancing, PWM-based balancing control, and protection-oriented timeout behavior. 12) Can balancing continue in low-power modes? Yes. Balancing support in low-power operating states is one of the useful capabilities of the family. This helps enable battery maintenance functions such as parked-vehicle balancing while still keeping power consumption low. 13) Does balancing influence measurement accuracy? Balancing can influence measured voltage values because current flow through external paths may create small voltage drops. To address this, the device supports balancing pause concepts so that measurements can be taken under more stable conditions when required. 14) Which operating modes are available? Multiple operation modes, including Deep Sleep, Sleep, Active, and Cyclic mode. These allow the system designer to balance measurement performance, wake-up behavior, and current consumption according to the use case. Deep Sleep is the lowest-current startup/storage state with almost no state retention. Sleep keeps key configuration and can allow balancing. Active enables full functionality. In Cyclic mode the device runs measurements in the configured intervals, and moves back to sleep or enters active mode afterward depending on the measurement results. 15) How are overvoltage and undervoltage conditions handled? The devices support configurable threshold checking for measured channels. When configured limits are exceeded, status information can be updated and event mechanisms can be used to notify the host controller or trigger an appropriate system response. 16) What development hardware and software are available? We offer evaluation boards for the BMA7x18 family (EVBMA7118DT, EVBMA7X18DT1), together with software tools (EvalGUI, BMS GEN2 SDK) and broader battery management ecosystem support. 17) Which orderable variants are available? The family includes SPI and TPL variants for both BMA7118 and BMA7418. This allows customers to choose the communication architecture that best matches their battery management system topology. 18) What is BMI7018, and how does it relate to BMA7118/BMA7418? The BMI7018 is an 18-channel Li-ion battery cell controller IC for industrial applications, especially energy storage systems (ESS) and uninterruptible power supplies (UPS). It is not the same product family as BMA7118/BMA7418, but it is highly relevant for customers looking for an NXP battery cell controller optimized for industrial use cases rather than automotive ASIL-D battery packs. It is s tailored to industrial mission profiles, and is characterized for industrial conditions rather than automotive AEC-Q100 Grade 1 positioning. 19) Does BMI7018 support EIS like BMA7418? No. BMI7018 is not positioned as an EIS-capable device. Customers specifically looking for electrochemical impedance spectroscopy support should use BMA7418 instead.
View full article
【恩智浦微控制器简介】【电机控制】【基础知识(三)】永磁同步电机的工作原理及控制方法(日语博客) 目录   【恩智浦微控制器简介】【电机控制】【基础知识(三)】永磁同步电机的机理及控制方法 幕后英雄!克拉克变形和帕克变形是什么? 这一切都始于三相交流电的复杂波形。 第一步:克拉克变换——将三维图形简化为二维图形 第二步:公园改造——“旋转木马的魔力”——定格动态世界 为什么要经历如此繁琐的转换过程?这样做有什么巨大好处? 摘要:数学如何运用强大的力量随意操控复杂波形 【恩智浦微控制器简介】【电机控制】【基础知识(三)】永磁同步电机的机理及控制方法 幕后英雄!克拉克变形和帕克变形是什么? 你好! 当电动汽车平稳起步,高性能空调运行异常安静时,微型计算机以超高速执行复杂的计算,并巧妙地控制电机。 这一次,让我们通过下面的 GIF 动画来揭开“克拉克变换”和“帕克变换” (以两位在控制技术核心“矢量控制”领域工作的伟大专家的名字命名的变换)的奥秘吧! (function() { var wrapper = document.getElementById('lia-vid-6377224605112w540h540r855'); var videoEl = wrapper ? wrapper.querySelector('video-js') : null; if (videoEl) { if (window.videojs) { window.videojs(videoEl).ready(function() { this.on('loadedmetadata', function() { this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) { bar.setAttribute('role', 'presentation'); bar.setAttribute('aria-hidden', 'true'); }); }); }); } }})(); (查看我的视频) 这一切都始于三相交流电的复杂波形。 首先,我们来看最上面一行。这是三相交流电的世界,也是驱动电机所需的基本能量。 右图(三相正弦波) :三个波 A、B 和 C 在传播过程中,其幅值和方向都在不断变化。这三个波相互关联,但正因如此,很难凭直觉判断在任何给定时刻应该对电机施加多大的力。这就像试图指挥三个同时演奏不同乐曲的音乐家一样。 左图(旋转矢量) :然而,当这三个波的力叠加在一起时,会发生一些有趣的事情。会产生一个单一的力(旋转矢量),它平滑且持续地旋转,同时保持恒定的大小。从物理角度来看,这就是定子线圈产生的“旋转磁场”。正是这个旋转磁场吸引着转子磁铁,并成为驱动电机旋转的力的来源。 问题:如何使用微控制器轻松准确地控制这“三个不断变化的波”? 第一步:克拉克变换——将三维图形简化为二维图形 第一个魔法是“克拉克变换”,它将复杂的 3D 世界转化为更容易理解的 2D 世界。 计算公式如下: 在正常的运动控制中,假设幅值不变变换(K=2/3)和平衡三相(i_a+i_b+i_c=0),则使用以下简化公式。   ​ 右侧的图表(两相正弦波 α-β) :看!三个波形已经合并成两个波形,α(α)和 β(β)。波形(交流电)仍然存在,但少了一个变量,使其更容易观察。 左侧图表(克拉克变换 α-β) :它展示了从两个轴(α,β)观察到的世界,这两个轴与从三个轴(A,B,C)观察到的旋转矢量垂直相交。这就像将从一定角度观察到的立体物体转换成从正上方观察到的平面视图。旋转矢量本身仍然以相同的方式旋转,没有任何变化。 [克拉克转换的关键点] 在不丢失任何信息的情况下,我们将处理起来有些困难的三相坐标系转换为数学中熟悉的笛卡尔坐标系(α-β 静止坐标系),从而简化了问题。 第二步:公园改造——“旋转木马的魔力”——定格动态世界 α 和 β 的值仍然像波浪一样变化,很难跟踪它们。这就是矢量控制的精髓——“帕克变换”发挥作用的地方! 计算公式如下: ​​ 这是一个重大的思维转变:“让我们不再从静止的地面(α-β 坐标)观察旋转矢量,而是跳上一个与旋转矢量以相同速度旋转的旋转木马!”这个新的旋转坐标系被称为“ dq 旋转坐标系”。 右图(两相值 dq) :多么惊人的结果!之前变化如此剧烈的两个波现在已经变成了**几乎恒定的值(直流)**,分别称为 d 和 q! 左图(Park变换dq) :可以看到dq坐标与旋转矢量完美同步旋转。如果你站在旋转木马上的马旁边,你会看到马静止不动,对吧?原理完全相同。从旋转物体的角度来看,它看起来是静止的。 【关于公园改建的注意事项】 通过与旋转矢量以相同速度旋转的坐标系(dq 坐标)进行观察,可以将交流值视为直流值。 为什么要经历如此繁琐的转换过程?这样做有什么巨大好处? 通过这两步转变,我们获得了巨大的好处:控制的极大简化。 控制不断变化的交流电数值很困难,但直流电数值呢?如果高于目标值,就降低它;如果低于目标值,就提高它。通过这种即使是小学生也能理解的简单操作(PID控制),就可以实现对电机的完美控制。 d 和 q 的直流值各自具有重要的物理意义。 q轴值(正交轴):它直接控制电机的扭矩(旋转力)。当您踩下电动汽车的油门时,车辆会迅速加速,这是因为微电脑提高了q轴的目标值。它就像一个“动力旋钮”。 d轴值(直轴):控制电机的磁通量(磁体强度)。对于永磁电机,转子磁体的强度是恒定的,因此基本上将d轴电流控制在零是最有效的。它真可谓是一个“效率调节旋钮”。 换句话说,克拉克和帕克变换的神奇之处在于,它们将电机的“功率”和“效率”元素(通常混合在一起)分离成两个独立的直流旋钮(d 和 q) 。 摘要:数学如何运用强大的力量随意操控复杂波形 三相交流电的复杂波形会在电机内部产生旋转力(旋转矢量)。 克拉克变换通过将三维世界重新绘制成二维(α-β)来简化问题。 公园改造包括乘坐旋转木马(dq 坐标)并将交流值转换为直流值。 使用 PID 控制器可以轻松准确地控制直流转矩 (q) 和磁通量 (d) 值! 这一系列精妙的数学运算是“矢量控制”的基础,而矢量控制正是现代高性能电机的基石。正是这项神奇的技术,让我们得以尽享动力强劲、静音高效、节能环保的电机所带来的种种益处。 感谢您阅读到最后! 如果您想阅读下一章基础内容,请点击这里↓ 【基础知识 第4部分】练习!让我们用框图来了解矢量控制的工作原理! 点击这里查看具体的安装方法以及如何运行示例代码的说明。 【恩智浦微控制器简介】【电机控制】【实践篇1】永磁同步电机的机理及控制方法(日文博客) 这是一个汇总了有关恩智浦电机控制文章的网站: NXP电机控制 - 概要页面 - (日语博客) =========================​ 我们目前无法 回复 此帖子“ 评论”部分的评论。 对于由此造成的不便,我们深表歉意。如有任何疑问, 请 参考“ 如何就 技术问题 联系 NXP ( 日语 博客 ) ” 。 (如果您已经是 恩智浦的 分销商或 与 恩智浦 有业务往来 ,您可以直接联系负责人。 ) 本文将以浅显易懂的方式讲解如何使用NXP FRDM控制板“FRDM-MCXA156”进行电机控制。文章分为基础知识部分和实践部分,希望您能参考感兴趣的部分。 ・基础知识①~⑦,实践①~③ 这次,作为基础知识的第三部分,我们将使用 NXP 微控制器来解释永磁同步电机的工作原理和控制方法。 MCUXpresso MCUXpresso IDE MCUXpresso SDK MCX 电机控制 技术聚焦 日本博客
View full article
从默认项目模板 - 将 *CAN FD* 转换为 *CAN* 大家好, 我正在研究 MR-CANHUBK344-S32。 我可以运行该教程: https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Communicating-over-the-CAN-Bus/ta-p/1758456 但是,我无法使用所需的硬件观察 CAN0 和 CAN1 之间交换的 CAN 消息。我必须使用 Kvaser Leaf Light v2,并且必须以“标准 CAN”格式(限制为 1000Kbps 的“旧”版本 CAN)获取这些消息,而不是更新更快的“CAN-FD”。 我尝试了几种方法,但我不知道该怎么做: 使用 500Kbps 的“旧”CAN 协议获得相同的工作示例。 我尝试取消选中此框: 我尝试将 CAN FD 波特率设置为 500Kbps,或者干脆删除整个部分“0”,但都没有成功。 我现在有点迷茫了。我确信解决这个问题非常简单,但我对 S32CT 还不够熟悉。 提前感谢您的帮助。 阿里斯 回复:从默认项目模板 - 将 *CAN FD* 转换为 *CAN* 你好@Aris_ , 很高兴听到它有效! 问候, 罗伯特五世 回复:从默认项目模板 - 将 *CAN FD* 转换为 *CAN* 完美的!有用 回复:从默认项目模板 - 将 *CAN FD* 转换为 *CAN* 你好@Aris_ , 首先要澄清一些事情,您在配置中取消选中的选项不用于启用或禁用 CanFD,而是用于选择它使用的协议(ISO CanFD 或非 ISO CanFD): 就发送普通 Can 帧(不是 FD)而言,只需打开 Can_Write 块并取消选中“Can FD Message”选项即可实现,您可以在此处看到: 如果您觉得这有帮助并且您开始在 Kvaser Leaf Light v2 上看到 Can 框架,请告诉我。 问候, 罗伯特五世
View full article
PN7160 PN7220 Android 15 移植到 i.MX8MN-EVK 简介 我们有一份官方的PN7160/PN7220 Android 15移植指南(PN7160/PN7220 – Android 15 移植指南)。但这些补丁仅适用于Android 15 AOSP r1(android-15.0.0_r1)。如果用户想移植到较新版本的AOSP,在源代码编译过程中会出现很多错误。本文件供客户参考,以便逐一解决错误。 注意:所有修改仅供参考。它们不是 NXP 官方针对 AOSP 新版本移植提供的补丁。因此,这些修改可能并非最佳解决方案。请客户根据自身需求修改 AOSP 源代码。 硬件板: i.MX8MN EVK PN7160 EVK PN7220 EVK 为 i.MX8MN EVK 构建 Android 我使用的 i.MX Android BSP 是 Android 15.0.0_2.0.0 (L6.12.20_2.0.0 BSP),可从此处下载:用于 i.MX 应用处理器的 Android 操作系统 | NXP 半导体。 1. 下载"文档"和"安装代码包"。 2. 首先按照 Android BSP 为 i.MX8MN EVK 构建 Android BSP。 根据 android_build/.repo/manifests/aosp-android-15.0.0_2.0.0.xml,您将看到 AOSP 版本是 android-15.0.0_r32。 现在,请按照 PN7160/PN7220 – Android 15 移植指南,将 NFC 移植到 i.MX Android BSP。 1. 内核驱动程序: 为了与 PN7220 或 PN7160 建立连接,Android 协议栈使用 nxpnfc 内核驱动。您可以从下面的 GitHub 链接下载驱动程序: nfcandroid_platform_drivers/drivers at br_ar_16_comm_infra_dev · nxp-nfc-infra/nfcandroid_platform_drivers · GitHub git clone "https://github.com/nxp-nfc-infra/nfcandroid_platform_drivers.git"-b br_ar_16_comm_infra_dev 驱动程序适用于 Kernel 6.6 和 6.12。因此,请下载适合您移植的正确版本。例如,i.MX Android BSP Android 15.0.0_2.0.0 中的 Kernel 版本为 6.12。因此,我将使用针对 6.12 的驱动程序进行移植。 在移植过程中,请确保 Makefile 和 Kconfig 文件中的 PATH 设置正确。 例如在我的移植中: android_build/vendor/nxp-opensource/kernel_imx/drivers/nfc$ tree . ├── Kconfig ├── Makefile └── pn7160 ├── common.c ├── common.h        ├── i2c_drv.c        ├── i2c_drv.h        ├── Kbuild         ├── Kconfig         ├── Makefile         ├── spi_drv.c        └── spi_drv.h 1 个目录,11 个文件 android_build/vendor/nxp-opensource/kernel_imx/drivers/nfc$ cat Makefile # # 内核NFC设备驱动程序的Makefile。 # obj-y += pn7160/ android_build/vendor/nxp-opensource/kernel_imx/drivers/nfc$ cat Kconfig source "drivers/nfc/pn7160/Kconfig" 2. 将 “nxpnfc” 添加到 i.MX8MN EVK 设备树文件中。 在板上显示连接表。 显示图片 &i2c3 { clock-frequency = <100000>; pinctrl-names = "default", "gpio"; pinctrl-0 = <&pinctrl_i2c3>; pinctrl-1 = <&pinctrl_i2c3_gpio>; scl-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>; sda-gpios = <&gpio5 19 GPIO_ACTIVE_HIGH>; status = "okay"; nxpnfc@28{ compatible = "nxp,nxpnfc"; reg = <0x28>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_nfc>; nxp,nxpnfc-irq = <&gpio3 22 0>; nxp,nxpnfc-ven = <&gpio3 20 0>; nxp,nxpnfc-fw-dwnld = <&gpio3 21 0>; }; &iomuxc {         pinctrl_nfc: nfcgrp {                 fsl,pins = <                         MX8MN_IOMUX_SAI5_RXC_GPIO3_IO20                 0X19  // VEN MX8MN_IOMUX_SAI5_RXD0_GPIO3_IO21 0X19 // FW-DWNLD MX8MN_IOMUX_SAI5_RXD1_GPIO3_IO22 0X19 // IRQ                 >;         }; 显示示意图。 3. 修改 imx8mn_gki.fragment nano vendor/nxp-opensource/kernel_imx/arch/arm64/configs/imx8mn_gki.fragment 添加 CONFIG_NXP_NFC_I2C=m 4. 转到设备 device/nxp/imx8m/evk_8mn/ 修改 BoardConfig.mk。 # selinux permissive +BOARD_KERNEL_CMDLINE += androidboot.selinux=permissive BOARD_SEPOLICY_DIRS := \ $(CONFIG_REPO_PATH)/imx8m/sepolicy \        $(IMX_DEVICE_PATH)/sepolicy  \ +       vendor/nxp/nfc/sepolicy \ + vendor/nxp/nfc/sepolicy/nfc ShareBoardConfig.mk     $(KERNEL_OUT)/drivers/net/phy/realtek.ko \ $(KERNEL_OUT)/drivers/pps/pps_core.ko \     $(KERNEL_OUT)/drivers/ptp/ptp.ko \ $(KERNEL_OUT)/drivers/net/ethernet/freescale/fec.ko + $(KERNEL_OUT)/drivers/nfc/nfc/nxpnfc-i2c.ko endif     $(KERNEL_OUT)/drivers/trusty/trusty-core.ko \     $(KERNEL_OUT)/drivers/trusty/trusty-log.ko \     $(KERNEL_OUT)/drivers/trusty/trusty-ipc.ko \     $(KERNEL_OUT)/drivers/trusty/trusty-virtio.ko \ + $(KERNEL_OUT)/drivers/nfc/nfc/nxpnfc-i2c.ko else BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \     $(KERNEL_OUT)/drivers/input/touchscreen/goodix_ts.ko \     $(KERNEL_OUT)/drivers/input/touchscreen/synaptics_dsx/synaptics_dsx_i2c.ko endif Compatibility_matrix.xml         netutils-wrapper 1.0     android.hardware.emvco 1         IEmvco default     device_framework_matrix.xml nxp.hardware.secureime 1 ISecureIME default     nxp.hardware.imx_dek_extractor 1 IDek_Extractor default     vendor.nxp.nxpnfc 2.0 INxpNfc default     android.hardware.emvco 1 IEmvco default     evk_8mn.mk # -------@block_bluetooth------- # Bluetooth HAL PRODUCT_PACKAGES += \     android.hardware.bluetooth \     android.hardware.bluetooth-service.default.nxp # NXP 8987 蓝牙厂商配置 PRODUCT_PACKAGES += \ bt_vendor.conf # ------nfc------- $(call inherit-product, vendor/nxp/nfc/device-nfc.mk) $(call inherit-product, vendor/nxp/emvco/device-emvco.mk) PRODUCT_PACKAGES += \ android.hardware.nfc-service.nxp PRODUCT_PACKAGES += \         com.nxp.emvco \         com.nxp.nfc \ nfc_nci_nxp_pn72xx # -------@block_usb------- Init.rc 在 post-fs && property:vendor.skip.charger_not_need=0     # 一次只交换一页     写入 /proc/sys/vm/page-cluster 0 # 授予获取 statsd 的 available_pages 信息的权限 chown system system /proc/pagetypeinfo     chmod 0440 /proc/pagetypeinfo     exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d \ /vendor/lib/modules nxpnfc_i2c 写入 /sys/power/wake_lock nosleep 在 post-fs-data && property:vendor.skip.charger_not_need=0 setprop vold.post_fs_data_done 1 ueventd.nxp.rc /sys/devices/virtual/thermal/thermal_zone* trip_point_0_hyst 0660 系统 系统 /sys/devices/virtual/thermal/thermal_zone* trip_point_1_hyst 0660 系统 系统 /dev/dmabuf_imx           0664   系统     系统 /sys/class/backlight/* 亮度 0660 系统 系统 /dev/ttymxc1              0666   nfc   nfc /dev/ttymxc2 0666 nfc nfc /dev/nxpnfc 0666 nfc nfc # 用于 libcamera /dev/media* 0660 system camera /dev/v4l-subdev* 0660 系统摄像头 5. hardware/interfaces/compatibility_matrices/compatibility_matrix.202404.xml android.hardware.wifi.hostapd 1 IHostapd default     android.hardware.wifi.supplicant 2 ISupplicant default     nxp.hardware.imx_dek_extractor 1 IDek_Extractor default     vendor.nxp.nxpnfc 2.0 INxpNfc default     vendor.nxp.emvco 1 INxpEmvco default     6.  android_build/vendor/nxp/nfc/device-nfc.mk android_build/vendor/nxp/emvco/device-emvco.mk 两种方法。 1. 将 NXP NFC 补丁应用到 Android AOSP,然后进行构建。如果 Android 版本过新,将会出现大量错误。 2. 先将 R1 文件复制到 R30,然后应用 NXP NFC 补丁。然后构建。 我使用第二种方法。 下载 AOSP R1 源代码。 将 R1 复制并替换以下文件夹。 应用补丁。 版本代码。 以下是错误列表及参考解决方案。
View full article
用LPTMR定时器中断无法从VLPS到VLPR的唤醒问题 我在仿真调试的时候,程序进入VLPS后,LPTMR定时器设定10秒中断,定时器中断可以从VLPS到VLPR的正常唤醒。但是不仿真的时候,关电重新上电,程序从RUN进入VLPR,然后程序进入VLPS后,之后无法进入LPTMR定时器中断,也无法唤醒到VLPR模式,一直处在VLPS状态。 但是外部IO口中断从VLPS到VLPR可以正常唤醒,不管是在仿真模式还是不仿真的情况都可以从VLPS正常唤醒到VLPR。 难道不仿真的时候VLPS导致LPTMR定时器时钟关了,还是有其他的问题? VLPR用的慢速时钟源8M,分频后慢系统时钟为4M,FLASH时钟为1M,LPTMR定时器时钟源用的慢系统时钟4M分4096分频,10000计数大约10s中断一次。 主函数主函数 Run to VLPR函数Run to VLPR函数 VLPR to VLPS函数VLPR to VLPS函数 Re: 用LPTMR定时器中断无法从VLPS到VLPR的唤醒问题 问题已经解决,要提前设置使能VLPS模式下SIRC时钟,默认是关闭的,程序中增加一句宏定义就可以了 #define  SCG_ENABLE_SIRC_IN_VLPS  1 Re: 用LPTMR定时器中断无法从VLPS到VLPR的唤醒问题 这是我的源代码。不管是仿真还是断开下载器,在VLPR模式下LPTMR都正常工作。但是就是在VLPS模式下LPTMR无法唤醒到VLPR模式。用外部IO中断唤醒都正常。但是下载仿真时在VLPS模式LPTMR又可以唤醒到VLPR模式。我的初始化时钟就在Run_to_VLPR(void)函数中的scg_vlpr_configuration()函数中。 #include "include.h" /* 中断优先级组 */ #define NVIC_Group0 0x07 #define NVIC_Group1 0x06 #define NVIC_Group2 0x05 #define NVIC_Group3 0x04 #define NVIC_Group4 0x03 typedef enum _mode { eRun = 1, eStop = 2, eVLPR = 4, eVLPS = 16, eHSRun = 128 }eLowPowerMode; void delay(uint32_t cycles) { /* Delay function - do nothing for a number of cycles */ while(cycles--) { __asm("nop"); } } void error_trap (void) { while (1) { } } void disable_clock_monitors(void) { /* Disable Clock monitor for System Oscillator */ SCG->SOSCCSR &= ~(SCG_SOSCCSR_SOSCCM_MASK); /* Disable Clock monitor for System PLL */ SCG->SPLLCSR &= ~(SCG_SPLLCSR_SPLLCM_MASK); } void scg_vlps_configuration (void) { uint32_t tempSIRC = SCG->SIRCCSR; /* Disable in VLPS */ tempSIRC &= ~(SCG_SIRCCSR_SIRCLPEN_MASK | SCG_SIRCCSR_SIRCSTEN_MASK); #if SCG_ENABLE_SIRC_IN_VLPS /* Enable in VLPS */ tempSIRC |= SCG_SIRCCSR_SIRCLPEN_MASK | SCG_SIRCCSR_SIRCSTEN_MASK; #endif SCG->SIRCCSR = tempSIRC; } void scg_vlpr_configuration(void) { uint8_t tempRCM = RCM->SRIE; uint32_t temp; /* Check if core is not using SIRC */ if ((SCG->CSR & SCG_CSR_SCS_MASK) != SCG_CSR_SCS(2)) { /* Disable SIRC */ SCG->SIRCCSR &= ~SCG_SIRCCSR_SIRCEN_MASK; /* Wait until SIRC is disabled */ while (SCG->SIRCCSR & SCG_SIRCCSR_SIRCVLD_MASK) {} /* Enable SIRC in VLP modes */ SCG->SIRCCSR = SCG_SIRCCSR_SIRCSTEN_MASK #if SCG_ENABLE_SIRC_IN_VLPS | SCG_SIRCCSR_SIRCLPEN_MASK #endif ; /* Enable SIRC */ SCG->SIRCCSR |= SCG_SIRCCSR_SIRCEN_MASK; /* Wait until SIRC is enabled */ while (0 == (SCG->SIRCCSR & SCG_SIRCCSR_SIRCVLD_MASK)) {} temp = SCG_RCCR_DIVCORE(1) | /* Core clock is SIRC/8 = 4MHz */ SCG_RCCR_DIVBUS(0) | /* Bus clock is Core clock / 1 = 4MHz */ SCG_RCCR_DIVSLOW(3) | /* Flash clock is Core clock / 1 = 1MHz */ SCG_RCCR_SCS(2); /* Select SIRC as system clock */ SCG->RCCR = temp; /* Select SIRC as system clock */ /* Wait until SIRC is used as system clock */ while ((SCG->CSR & SCG_CSR_SCS_MASK) != SCG_CSR_SCS(2)) {} /* Configure SIRC as system clock in VLPR modes */ SCG->VCCR = SCG_VCCR_DIVCORE(1) | /* Core clock is SIRC/8 = 1MHz */ SCG_VCCR_DIVBUS(0) | /* Bus clock is Core clock / 1 = 1MHz */ SCG_VCCR_DIVSLOW(3) | /* Flash clock is Core clock / 1 = 1MHz */ SCG_VCCR_SCS(2); /* Select SIRC as system clock */ /* Disable FIRC and SPLL */ /* ?Configurable SIRC as system clock */ /* ?Configure all reset sources to be 'Reset' (not as Interrupt) via RCM_SRIE */ /* ?Program each reset source as interrupt via RCM_SRIE for a minimum delay time of 10 LPO */ RCM->SRIE &= 0; /* ?Disable FIRC */ SCG->FIRCCSR = SCG_FIRCCSR_FIRCREGOFF_MASK; /* ?Execute few nops to ensure an interval of 45 ns */ delay(10); while (0 != (SCG->FIRCCSR & SCG_FIRCCSR_FIRCVLD_MASK)) { }; /* ?Configure every reset source back to original intended reset configuration (Interrupt or Reset) via RCM_SRIE */ RCM->SRIE = tempRCM; /* Set SIRCDIV2 value to 1MHz (SIRC / 😎 */ SCG->SIRCDIV = SCG_SIRCDIV_SIRCDIV2(2); } } void scg_configure_freq_for_VLPR() { } void Run_to_VLPR(void) { /* Disable clock monitors on SCG module */ disable_clock_monitors(); /* Adjust SCG settings to meet maximum frequencies values */ scg_vlpr_configuration(); /* Allow very low power run mode */ SMC->PMPROT |= SMC_PMPROT_AVLP_MASK; /* Check if current mode is RUN mode */ if (eRun == SMC->PMSTAT) { /* This bit enables source and well biasing for the core logic, * this is useful to further reduce MCU power consumption */ PMC->REGSC |= PMC_REGSC_BIASEN_MASK; /* Move to VLPR mode */ SMC->PMCTRL = SMC_PMCTRL_RUNM(2); /* Wait for transition */ while (SMC->PMSTAT != eVLPR) {} } else { /* Error trap */ error_trap(); } } #define SCG_ENABLE_SIRC_IN_VLPS 1 void VLPR_to_VLPS (void) { uint32_t tempPMC_ctrl = SMC->PMCTRL; /* Disable FIRC and SPLL and configure VLPS */ scg_vlps_configuration(); /* Enable SLEEPDEEP bit in the Core * (Allow deep sleep modes) */ S32_SCB->SCR |= S32_SCB_SCR_SLEEPDEEP_MASK; /* Allow very low power run mode */ SMC->PMPROT |= SMC_PMPROT_AVLP_MASK; /* Select VLPS Mode */ tempPMC_ctrl &= ~SMC_PMCTRL_STOPM_MASK; tempPMC_ctrl |= SMC_PMCTRL_STOPM(2); SMC->PMCTRL = tempPMC_ctrl; /* Reduce power consumption */ PMC->REGSC |= PMC_REGSC_BIASEN_MASK #if (0 == SCG_ENABLE_SIRC_IN_VLPS) | PMC_REGSC_CLKBIASDIS_MASK #endif ; /* Check if current mode is VLPR mode */ if(eVLPR == SMC->PMSTAT) { STANDBY(); // Move to Stop mode // __asm("DSB"); // __asm("ISB"); /* Go to deep sleep mode */ // __asm("WFI"); } else { /* Error trap */ error_trap(); } /* Verify VLPSA bit is not set */ if (0 != (SMC->PMCTRL & SMC_PMCTRL_VLPSA_MASK)) { // error_trap(); } } #define KEY0_IO PTD5 void Key_Init(void) { /* 配置按键 内部上拉 下降沿触发中断 */ GPIO_ExtiInit(KEY0_IO, falling_up); /*优先级配置 抢占优先级1 子优先级2 越小优先级越高 抢占优先级可打断别的中断 */ NVIC_SetPriority(PORTD_IRQn,NVIC_EncodePriority(NVIC_GetPriorityGrouping(),1,2)); NVIC_EnableIRQ(PORTD_IRQn); //使能PORTD_IRQn的中断 } #define LED1_IO PTC17 //核心板LED #define LED2_IO PTC16 #define LED3_IO PTD15 //母板LED #define LED4_IO PTD16 void LED_Init(void) { GPIO_PinInit(LED1_IO,GPO,0); GPIO_PinInit(LED2_IO,GPO,0); GPIO_PinInit(LED3_IO,GPO,0); GPIO_PinInit(LED4_IO,GPO,0); } int main(void) { uint16 w1; uint16 wCnt=0; Run_to_VLPR(); NVIC_SetPriorityGrouping(NVIC_Group2); LPTMR_Init(5000); /* 优先级配置 抢占优先级1 子优先级2 越小优先级越高 抢占优先级可打断别的中断 */ NVIC_SetPriority(LPTMR0_IRQn,NVIC_EncodePriority(NVIC_GetPriorityGrouping(),1,2)); NVIC_EnableIRQ(LPTMR0_IRQn); //使能LPTMR0_IRQn的中断 Key_Init(); LED_Init(); while(1) { wCnt++; if(wCnt>=100){ wCnt=0; VLPR_to_VLPS(); } delay(0x00007fff); LED_Reverse(1); } // return 0; } Re: 用LPTMR定时器中断无法从VLPS到VLPR的唤醒问题 Hi@yankui666 MCU在进入低功耗的时候要断开调试器,否则MCU可能并不会成功进入低功耗模式 1.我没看到你初始化时钟的示例代码 2.请先初始化完成时钟,外设后再去执行RUN_TO_VLPR 3.先调通RUN模式下LPTMR再去排查
View full article
Release Announcement - GUI Guider v1.1 The latest version of GUI Guider was recently released by NXP. If you are unfamiliar with GUI Guider it is a graphical development tool for creating UIs on supported NXP microcontrollers. The tool allows you to create a UI, test the UI along with various levels of events all within a simulation environment, and then deploy the UI application directly to the NXP development board or generate the code for use in MCUXpresso IDE. GUI Guider is designed specifically for use with LVGL, an open-source graphics library, that is available within the MCUXpresso SDK.   This release of GUI Guider features: New Development Tool capabilities Menu shortcut and keyboard control New states: FOCUSED, EDITED, DISABLED Frame rate customization Screen transition configuration Parent / children widgets Callback function setting for animation image VGLite enablement Header path auto-config New or improved Widgets BMP and SVG assets 3D animation for PNG HW Acceleration capabilities Initial support for VGLite on RT1170 and RT595 New Device Target Supported i.MX RT1170 i.MX RT595 New release of GUI Guider v1.1, the user-friendly graphical user interface development tool from NXP that enables the rapid development of high quality displays with the open-source LVGL graphics library.
View full article
工信部(中国)加强了 FRDM-KW38 和 KW36 的认证 中国的认证要求(工信部 [2002]353 号)显然计划(2022 年 12 月底)进一步加强(工信部 2021 年 1 月 27 日发布: 《关于 2400MHz、5100MHz 和 5800MHz 频段无线电管理有关事项的通知》)。 需要对 KW38 和 KW36 进行修改寄存器,以便以可接受的裕度满足新的中国要求: PA_RAMP_SEL值必须设置为0x02h (2us),而不是 0x01h (1us 默认值) 修改 SW:nxp_xcvr_common_config.c 中的 XCVR_TX_DIG_PA_CTRL_PA_RAMP_SEL( 2 ) 所有详细信息均在附件中。 注意:此 SW 修改仅适用于中国国家。 BLE软件 千瓦 KW35 | 36
View full article
扩展你的 Android 应用显示 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 许多用户询问过但仍在为 Android 开发中的功能之一是扩展桌面功能。目前,Android 允许您在两个显示器上镜像您的桌面,但您仍然无法像使用 Linux 或 Windows 等任何其他操作系统那样扩展您的桌面。 本教程旨在向您展示如何使用特殊对象来控制辅助或外部显示器上显示的内容,从而取代屏幕镜像。 那么我们该怎么做呢? 演示文稿是在外部显示器上以视图层次结构的形式显示用户界面的容器。这非常类似于对话框,因为它显示与其活动分开的 UI,但不同之处在于演示文稿显示在外部显示器上,而对话框将其显示在主屏幕上。现在,由于这个原因,外部显示器上的 UI 要使用的资源与主屏幕上使用的资源不同,演示的上下文不是活动。 我们如何选择将此演示文稿发送到哪里? 最简单的方法是使用 MediaRouter API。mediarouter 的作用是跟踪系统上可用的音频和视频路由。无论何时选择或取消选择路线,MediaRouter 都会发送通知。应用程序可以简单地监视这些通知并自动在首选演示显示屏上显示或关闭演示。 首选演示显示器是媒体路由器建议应用程序在想要在辅助显示器上显示内容时使用的显示器。如果没有首选的演示显示,则应用程序应该在本地显示其内容而不使用演示。 使用 Mediarouter MediaRouter 是通过调用 getSystemService() 并请求 MEDIA_ROUTER_SERVICE 获得的系统服务。 我们应该使用 mediarouter 在首选的演示显示器上创建和显示演示文稿: MediaRouter mediaRouter = ( MediaRouter ) context . getSystemService ( Context . MEDIA_ROUTER_SERVICE ); MediaRouter.RouteInfo route = mediaRouter.getSelectedRoute ( ) ;​​ 如果(路线!= null ) { 显示presentationDisplay =路由.getPresentationDisplay () ; 如果( presentationDisplay != null ) { 演示文稿=新MyPresentation (上下文, presentationDisplay ) ; 演示.展示(); } } 为了在您的应用中使用此框架,您需要获取 MediaRouter 框架对象的一个实例并附加一个 MediaRouter.Callback 对象来监听可用媒体路由中的事件。 实现媒体路由器 API 的 Android 应用程序需要包含一个 Cast 按钮,以允许用户选择媒体路由在辅助输出设备上播放媒体。实现 Cast 按钮的推荐方法是从 ActionBarActivity() 扩展您的活动并使用 onCreateOptionMenu() 方法添加选项菜单。Cast 按钮必须使用 MediaRouteActionProvider 类作为其操作: xml 版本= "1.0"编码= "utf-8" ?> <菜单xmlns:android = " http://schemas.android.com/apk/res/android " xmlns:app = " http://schemas.android.com/apk/res-auto " > <项目机器人:ID = “@ + id / media_route_menu_item” 机器人:标题= “@string/media_route_menu_title” 应用程序:actionProviderClass = “android.support.v7.app.MediaRouteActionProvider” app:showAsAction = “总是” /> 媒体路由器框架通过附加到媒体路由器框架对象的回调对象与应用程序进行通信。有必要扩展回调对象以便在媒体路由连接时接收消息。 一旦为媒体路由器定义了回调,您就需要将其附加到媒体路由器对象。下面的示例演示了如何使用生命周期方法来适当地添加和删除应用程序的媒体路由器回调对象。您需要添加和删除它,因为无论何时关闭应用程序或将其放在后台,它都需要是空闲的,以便其他应用程序在必要时使用它。 公共类MediaRouterPlaybackActivity扩展了ActionBarActivity { 私人MediaRouter mMediaRouter ; 私人MediaRouteSelector mSelector ; 私人回调mMediaRouterCallback ; // 您的应用程序可以使用它们,以便框架可以发现它们。 @Override 受保护的void onCreate ( Bundle savedInstanceState ) { 超级. onCreate ( savedInstanceState ); 设置ContentView ( R.layout.activity_main ) ;​​ // 获取媒体路由器服务。 mMediaRouter = MediaRouter.getInstance ( this ) ;​ ... } // 在启动时添加回调来告诉媒体路由器有哪些类型的路由 // 您的应用程序可以使用它们,以便框架可以发现它们。 @Override 公共无效的onStart () { mMediaRouter.addCallback ( mSelector , mMediaRouterCallback ,​​ 媒体路由器.回调标志位 请求发现); 超级. onStart (); } // 停止时删除选择器,告诉媒体路由器它不再 // 需要发现您的应用的路线。 @Override 公共无效onStop () { mMediaRouter.removeCallback ( mMediaRouterCallback ) ;​ 超级. onStop (); } ... } 远程回放 这种方法将控制命令发送到辅助设备以启动播放并控制正在进行的播放(播放、停止、快进、倒带等)。当您的应用支持这种类型的媒体路由时,您必须使用通过应用的 MediaRouter.Callback 对象接收的远程播放 MediaRoute.RouteInfo 对象创建一个 RemotePlaybackClient 对象。 下面的示例代码演示了一个控制器方法,该方法创建一个新的远程播放客户端并向其发送视频进行播放。 私人无效更新远程播放器( RouteInfo路线) { // 改变路线:拆除之前的客户端 如果( mRoute != null && mRemotePlaybackClient != null ) { mRemotePlaybackClient .释放(); mRemotePlaybackClient =空; } // 保存新路线 mRoute =路线; // 附加新的播放客户端 mRemotePlaybackClient =新的RemotePlaybackClient ( this , mRoute ) ; // 发送文件进行播放 mRemotePlaybackClient.play ( Uri .​​解析( “ http://archive.org/download/Sintel/sintel-2048-stereo_512kb.mp4 ” ) “video/mp4” , null , 0 , null , new ItemActionCallback () { @Override public void onResult (捆绑数据,字符串sessionId , MediaSessionStatus会话状态, 字符串itemId , MediaItemStatus itemStatus ) { logStatus ( "播放:项目成功" + itemId ); } @Override public void onError (字符串错误, int代码, Bundle数据) { logStatus ( "播放:失败 - 错误:" + code + " - " + error ); } }); } } 有关如何使用媒体路由器的更多信息,请访问developer.android.com
View full article
示例 S32K144 FlexCAN TX/RX/Error ISR 测试 S32DS2.2 本演示应用程序的目的是向您展示如何使用配置为灵活数据速率的FlexCAN模块,通过S32 SDK API进行操作。 - 在第一部分,应用程序将设置板载时钟、引脚及其他系统功能,例如SBC(如果该板将此模块用作CAN收发器)。 - 然后,它将配置FlexCAN模块的功能,例如FD、比特率和消息缓冲区 - 应用程序将等待在配置的消息缓冲区中接收帧,或等待按下两个按钮中的一个以触发事件,该事件将触发向接收方发送帧。 - 按下板1的SW3按钮将触发CAN传输,导致板2上的红色LED灯闪烁。 - 按下板1的SW2按钮将触发CAN传输,导致板2上的绿色LED灯闪烁。 - 此演示应用程序需要两块板,一块配置为主板,另一块配置为从板(请参阅应用程序代码中的MASTER/SLAVE定义) ,或使用CAN工具连接单块板。 - 事件和错误回调已安装,callback_test变量指示事件进入: bit0 .. 接收完成 bit1 .. 发送完成 bit2 .. 错误中断标志设置 bit3 .. 总线关闭中断标志设置 - 要进入总线关闭状态,只需将CANH与GND短接,并使用SW1或SW2发送消息,FlexCAN进入总线关闭状态(错误事件),蓝色LED亮起。 此外,TX MB 也已中止。移除短路连接,然后正常发送消息,蓝色LED熄灭。 ------------------------------------------------------------------------------ * 测试硬件:S32K144EVB-Q100 * MCU:FS32K1441 0N57U * 编译器:S32DS.ARM.2.2 * SDK 版本:S32SDK_S32K1xx_RTM_3.0.3 * 调试器:Lauterbach、OpenSDA * 目标:internal_FLASH
View full article