Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
PID parameters significance mentioned in User guide and how to calculate them ? I am using MagniV development board for for BLDC control .... I have also took reference from NXP code for speed and current loop control with PI control ..... for PI control loop parameters calculations are done using freemaster tool....Is there any such tool for PID loop parameter calculation ? Also please define significance of PID parameters used in NXP PID function mentioned in user guide that came with code . Re: PID parameters significance mentioned in User guide and how to calculate them ? for another process: 1. motor 95W, 12V, the R is about: 1.2ohm, and L is about:2.5mH 2. it suggest the switch freq is 160Hz, which is 1000 rad/s( 1000/3.1416/2=160Hz) 3. and it suggest the Z_final is 1. so: s = 1/(R+2*pi*L*freq) = 1/(1.2+2*3.14156*2.5e-3*160) = 1/(1.2+2.5)  here is a jump: 1.Kp = 2*3.1416*2.5e-3*160-R = 5-1.2 = 3.8 2.Ki = w^2*L = 2500 3.because the Vol, curr is standlize, so :Kp = 3.8 * 8/12 = 3.8*0.667=2.5 at this stage, AI said the L maybe wrong. ---------------- let me try to calc the right motor params. if engine is cos(theta)=0.85 >>> import numpy as np >>> np.acos(0.85) np.float64(0.5548110329800715) >>> np.sin(0.555) np.float64(0.5269433002033014) then sin(theta)=0.5. so: when engine at std power out. the Curr_R and Curr_L is equal. so:R = 12*0.707/(8*0.707) = 1.5ohm, this is right. L:9000rpm is 150Hz,so, I think the error is bandwith, it should be higher than 1500Hz, and maybe 3000Hz if freq_std=1500, which means the L should be 12*0.85/(2*pi*1.5e3) = 10mH ~5mH so:Ki = 14e3*10e-3 = 140 or 70. Kp = 2*pi*1.5e3*L -R = 94-1.5 = ... still wrong.... Re: PID parameters significance mentioned in User guide and how to calculate them ? hi,there. I am a naive to pid ctrl. this is the first post I found. here are some my foundings in this forum and knowledge. S32K344 - FOC integrated with FreeRTOS this is the beginning line. After I install the EV boards, I got the PMSM_appconfig.h,  the pid params, init params is : #define CLOOP_D_KP (0.368399F) #define CLOOP_D_KI (0.0298853F) #define CLOOP_Q_KP (0.371817F) #define CLOOP_Q_KI (0.0298853F) this is FOC controler, so there are two PI params here. so the Kp is the most important one. so,here is my calc: the PID(err_of_vol) = Curr. Vol range is 12V the motor power is 95W, so the output Curr is :95/12=8A. so: Kp = 8/12 = 0.67... but  the motor can support forword and backword rolling, so the  Vol must split into 2Parts. so :   if you using +12V to support all roll on roll back, kp should be 8*2/12=1.33 if you using something like revert the DC+ DC-, it should be just 0.67. if you tune it, it always start an a more small value. for example 20% of it.  so at last, the 0.37 is more larger than 20%*1.33= 0.27 Ki is about 10percent of Kp, here is Ki = 1/12*Kp but it seems it is totally wrong. I heard sth about Qianwen(An AI-Chat) 1. NXP should Standlize the Curr & Vol, for the very first stage. 2.what the calc is based Zero,and Polor Point of Control Space.  I will try to figure it out later,  it said, the motor's PID params will first try to measure motors' L,R then calc. Re: PID parameters significance mentioned in User guide and how to calculate them ? Hello, We use PI controllers in the structures of our motor control examples on the web. As you write, Mcat helps with the calculation of parameters for the PI controllers used (for PMSM in the cascade control structure for BLDC in the structure for sixstep). At the moment we do not have an example on the web that would use a structure with a PID controller or a tool that would help to set it, but of course, our AMCLIB library also offers this function as a building block for customer control structures. I hope it helps. Best regards, Diana
View full article
The MCUXpresso Secure Provisioning Tool cannot connect to the target board via USB. Hi NXP, I have a question: Development board: MIMXRT1170-EVKB, unable to connect using MCUXpresso Secure Provisioning Tool, as shown in the image: hayden178_0-1788428456159.pnghayden178_0-1788428456159.pnghayden178_0-1788428456159.pnghayden178_0-1788428456159.pnghayden178_0-1788428456159.png The computer's Device Manager displays the following: hayden178_1-1788428566738.pnghayden178_1-1788428566738.pnghayden178_1-1788428566738.pnghayden178_1-1788428566738.pnghayden178_1-1788428566738.png The development board's DIP switches are shown in the figure: hayden178_2-1788428637373.pnghayden178_2-1788428637373.pnghayden178_2-1788428637373.pnghayden178_2-1788428637373.pnghayden178_2-1788428637373.png I've downloaded and debugged the program using an IDE without any issues. How can I troubleshoot this? Thank you. Re: MCUXpresso Secure Provisioning Tool无法通过USB连接目标板 Hi @hayden178 , Thank you for your question! I checked the DIP switch configuration and power options you provided, and there are no issues. USB OTG1 was also selected without any problems. Therefore, it's suspected that some anomaly might be preventing the flashloader from loading data into SRAM promptly via the USB port. We suggest you try using a UART interface first. If the UART interface works fine, then switch to the USB interface. At this point, the flashloader should be running, and the USB port should also be working correctly. If the UART port also has a problem, you need to check the specific output. The detailed commands are listed in gen_scripts/init_flashloader_win.bat in the working directory. Before re-running the test, delete the previous log and check the new log to see which step failed. Best regards, Gavin Re: MCUXpresso Secure Provisioning Tool无法通过USB连接目标板 Hi @Gavin_Jia , Thank you for your support! I switched to UART to connect the MIMXRT1170-EVKB, and the problem was solved. I've encountered a new problem; could you please help me figure out where the problem lies? The built-in example in the MCUXpresso Secure Provisioning Tool fails to run mcuboot_opensource&ota_mcuboot, resulting in a consistent reset, as shown in the image. hayden178_0-1789004746339.pnghayden178_0-1789004746339.pnghayden178_0-1789004746339.png The project configuration is as follows: hayden178_1-1789004822575.pnghayden178_1-1789004822575.pnghayden178_1-1789004822575.png hayden178_2-1789004848902.pnghayden178_2-1789004848902.pnghayden178_2-1789004848902.png hayden178_4-1789005368832.pnghayden178_4-1789005368832.pnghayden178_4-1789005368832.png hayden178_3-1789005332451.pnghayden178_3-1789005332451.pnghayden178_3-1789005332451.png I've successfully run both projects using the IDE, but downloading the generated bin files to the board using SPSP results in the same reset issue. hayden178_5-1789005846515.pnghayden178_5-1789005846515.pnghayden178_5-1789005846515.png Re: MCUXpresso Secure Provisioning Tool无法通过USB连接目标板 Hi @hayden178 , Thanks for sharing the good news. I'm glad the first SPT connection issue has been resolved. Regarding the mcuboot operation process, which guide did you refer to? Could you please share it? I've always used Python scripts and imgtool for signing before, and I haven't tried this SPT solution. Regarding this new question, you are welcome to create a new ticket to keep the topic consistent across all threads. Thank you for your understanding and cooperation! Best regards, Gavin
View full article
FRDM-IMX93 ASCII 板文件 你好, 我从这个链接下载了FRDM-IMX93设计文件: https://www.nxp.com/design/design-center/development-boards-and-designs/frdm-i-mx-93-development-board:FRDM-IMX93 但是我没有 Allegro 或 Extracta.exe 来将它们导入 Altium。请提供 ACII 格式的 LAY-94611_B.brd 文件,以便我将其导入 Altium 系统。 谢谢! Re: FRDM-IMX93 ASCII Board File 你好, 我也需要这份文件来更好地了解电路板并帮助进行开发。你能发给我吗? Re: FRDM-IMX93 ASCII Board File 嗨@Cwootton ! 感谢您联系恩智浦技术支持! 我稍后会通过电子邮件将所需文件发送给您。 此致, 查维拉
View full article
MCUXpresso Secure Provisioning Tool无法通过USB连接目标板 Hi NXP, 请教一下问题: 开发板:MIMXRT1170-EVKB,使用MCUXpresso Secure Provisioning Tool无法连接,如图显示: hayden178_0-1788428456159.pnghayden178_0-1788428456159.pnghayden178_0-1788428456159.pnghayden178_0-1788428456159.pnghayden178_0-1788428456159.png 电脑设备管理器显示如下: hayden178_1-1788428566738.pnghayden178_1-1788428566738.pnghayden178_1-1788428566738.pnghayden178_1-1788428566738.pnghayden178_1-1788428566738.png 开发板拨码开关如图: hayden178_2-1788428637373.pnghayden178_2-1788428637373.pnghayden178_2-1788428637373.pnghayden178_2-1788428637373.pnghayden178_2-1788428637373.png 另外使用IDE下载程序,debug都没问题。请问如何排查?谢谢 Re: MCUXpresso Secure Provisioning Tool无法通过USB连接目标板 Hi @hayden178 , 感谢提问! 我检查了您提供的拨码开关配置和供电选项,都没有问题。选择的也是USB OTG1没有问题。 因此怀疑可能是有什么异常导致flashloader没有及时通过usb端口加载到SRAM。建议您先换用UART接口试一下。如果UART接口没问题,再换到USB接口,此时flashloader已经在运行了,usb端口应当也没有问题了。 如果UART端口也有问题,那就需要检查具体的输出,在工作目录下的,gen_scripts/init_flashloader_win.bat 中详细列举了具体的命令。重新执行test之前先删除之前的log,在新的log中核对具体是哪一步失败。 Best regards, Gavin Re: MCUXpresso Secure Provisioning Tool无法通过USB连接目标板 Hi @Gavin_Jia , 感谢您的支持! 我换成UART连接MIMXRT1170-EVKB,已经解决问题。 我遇到一个新的问题,请帮忙看看问题出在哪里: 使用MCUXpresso Secure Provisioning Tool上的自带的示例,跑不通mcuboot_opensource&ota_mcuboot,现象为一致复位,如图: hayden178_0-1789004746339.pnghayden178_0-1789004746339.pnghayden178_0-1789004746339.png 工程配置如下: hayden178_1-1789004822575.pnghayden178_1-1789004822575.pnghayden178_1-1789004822575.png hayden178_2-1789004848902.pnghayden178_2-1789004848902.pnghayden178_2-1789004848902.png hayden178_4-1789005368832.pnghayden178_4-1789005368832.pnghayden178_4-1789005368832.png hayden178_3-1789005332451.pnghayden178_3-1789005332451.pnghayden178_3-1789005332451.png 另外我用IDE已经跑通这两个工程,但是把生成的bin文件使用SPSP下载到板子上同样一致复位 hayden178_5-1789005846515.pnghayden178_5-1789005846515.pnghayden178_5-1789005846515.png Re: MCUXpresso Secure Provisioning Tool无法通过USB连接目标板 Hi @hayden178 , 感谢分享你那边的好消息,很高兴第一个SPT连接的问题已经解决了。 关于mcuboot这个操作流程,你参考的guide是哪个能同步下吗?之前一直是通过python脚本和imgtool来做签名的,没尝试过这个SPT的方案。 关于这个新的问题,欢迎重新创建一个ticket以保持每个thread下的主题一致。 感谢您的理解和协作! Best regards, Gavin
View full article
NXP Matlab Simulinkとの連携 SimulinkモデルをMINI-EVBにフラッシュしようS32K312。モデルの入出力にCANインターフェースを使用しています。なぜ自分のトレースがSimulinkシミュレーションモデルで得られているものと一致しないのか理解したいです。SimulinkでのモデルとNXPハードウェアでのモデルには違いがあります。おそらくタイムステップやその他の要因が原因かもしれませんが、何が間違っているのか確認するためにサポートが必要です。
View full article
用户指南中提到的PID参数的含义以及如何计算它们? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 我正在使用MagniV开发板进行BLDC控制……我还参考了NXP关于速度和电流回路的PI控制代码……PI控制回路参数的计算是用Freemaster工具完成的……请问有没有类似的工具可以用于PID回路参数的计算?另外,请解释一下代码附带的用户指南中提到的NXP PID函数中使用的PID参数的含义。 Re: PID parameters significance mentioned in User guide and how to calculate them ? 用于另一个流程: 1. 电机功率95W,电压12V,电阻R约为1.2Ω,电感L约为2.5mH 2. 这表明开关频率为 160Hz,即 1000 rad/s(1000/3.1416/2=160Hz)。 3. 这表明 Z_final 为 1。 所以:s = 1/(R+2*pi*L*freq) = 1/(1.2+2*3.14156*2.5e-3*160)= 1/(1.2+2.5) 这里有一个跳跃: 1.Kp = 2*3.1416*2.5e-3*160-R= 5-1.2= 3.8 2. Ki = w^2*L = 2500 3. 因为 Vol,curr 是标准化的,所以:Kp = 3.8 * 8/12 = 3.8 * 0.667 = 2.5 现阶段,人工智能表示 L 可能错了。 ---------------- 让我尝试计算一下正确的电机参数。 如果引擎的 cos(theta)=0.85 >>> import numpy as np >>> np.acos(0.85) np.float64(0.5548110329800715) >>> np.sin(0.555) np.float64(0.5269433002033014) 那么 sin(θ)=0.5。 所以:当发动机处于 STD 功率输出时,Curr_R 和 Curr_L 相等。 所以:R = 12*0.707/(8*0.707)= 1.5欧姆,没错。 L:9000rpm 对应的频率是 150Hz,所以我认为误差出在带宽上,带宽应该高于 1500Hz,可能是 3000Hz。 如果 freq_std=1500,则 L 应为 12*0.85/(2*pi*1.5e3)= 10mH ~5mH 所以:Ki = 14e3*10e-3 = 140 或 70。 Kp = 2*pi*1.5e3*L-R = 94-1.5= ... 还是错了…… Re: PID parameters significance mentioned in User guide and how to calculate them ? 你好呀。 我对 pid ctrl 完全不了解。 这是我找到的第一篇帖子。 以下是我在这个论坛上的一些心得和知识。 S32K344 - FOC 与 FreeRTOS 集成 这是起始行。 安装完电动汽车电路板后,我得到了 PMSM_appconfig.h 文件。进程 ID 参数、初始化参数为: #define CLOOP_D_KP (0.368399F) #define CLOOP_D_KI (0.0298853F) #define CLOOP_Q_KP (0.371817F) #define CLOOP_Q_KI (0.0298853F) 这是 FOC 控制器,所以这里有两个 PI 参数。 所以Kp是最重要的。 这是我的计算结果: PID(err_of_vol) = Curr。 电压范围为12V 电机功率为 95W,因此输出电流为:95/12=8A。 所以:Kp = 8/12 = 0.67...但是电机可以支持向前和向后滚动,所以 Vol 必须分成 2 部分。 所以:如果您使用 +12V 来支持所有回滚操作,则 kp 值应为 8*2/12=1.33 如果你使用类似反转 DC+ DC- 的方法,它应该只是 0.67。 如果你调整它,它总是从一个较小的值开始。例如,其中20%。所以最终,0.37 比 20%*1.33 更大。0.27 Ki 大约是 Kp 的 10%,所以 Ki = 1/12 * Kp 但这似乎完全错误。 我听说过千文(一款人工智能聊天应用)的事。 1. NXP 应该在第一阶段就实现 Curr & Vol 的标准化。 2. 计算基于零点和控制空间的极点。 我稍后会想办法弄明白。 它说,电机的 PID 参数将首先尝试测量电机的 L、R,然后进行计算。 Re: PID parameters significance mentioned in User guide and how to calculate them ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 你好, 我们在网络上的电机控制示例中使用了 PI 控制器。在您编写代码时,Mcat 会帮助计算所用 PI 控制器的参数(对于级联控制结构中的 PMSM,对于六步结构中的 BLDC)。目前,网上还没有使用 PID 控制器结构的示例,也没有可以帮助设置它的工具,但当然,我们的 AMCLIB 库也提供了此功能,作为客户控制结构的构建模块。 希望对您有所帮助。 顺祝商祺! 戴安娜
View full article
FRDM-IMX93 ASCII Board File Hello, I have pulled the FRDM-IMX93 Design Files from this link: https://www.nxp.com/design/design-center/development-boards-and-designs/frdm-i-mx-93-development-board:FRDM-IMX93 However I do not have Allegro or Extracta.exe to import them to Altium. Can you please supply the LAY-94611_B.brd in ACII format so I can import that into Altium? Thanks, Re: FRDM-IMX93 ASCII Board File Hello, I´m also in need for this file to understand the board better and help development. can you send it to me? Re: FRDM-IMX93 ASCII Board File HI @Cwootton! Thank you for reaching out to NXP Support! I will be sending the required files to you via email shortly. Best regards, Chavira
View full article
i.MX 95:M7 和 A55 之间的动态 TRDC/系统管理器资源分配和 GPIO 共享 大家好, 我们正在开发i.MX 95 平台,希望最初使用 M7 内核的 MIPI DSI 外设,然后在运行时将资源移交给 A55 内核。 据我们了解,外围资源及其所有权最初是 在 通过 系统管理器工具 生成/配置的 mx95evk.cfg 文件中为每个逻辑机器/处理器定义的。 我们想澄清以下几点: 动态资源交接: 是否可以在运行时将 MIPI DSI 外设资源从 M7 动态转移到 A55?例如,M7 最初拥有并使用 MIPI DSI,然后释放该资源,之后 A55 接管并使用同一外设。 动态资源分配: 如果支持运行时交接,那么动态更改资源所有权或访问权限的推荐机制/API是什么?这是通过系统管理器、TRDC还是其他机制处理的? GPIO共享: M7 和 A55 是否可以同时访问同一个 GPIO 端口/资源?如果可以,为了安全地共享 GPIO 资源,是否需要进行任何 TRDC 配置或实施任何软件同步机制? 我们非常希望得到关于在 i.MX 95 上实现M7 和 A55 之间的动态外围设备切换和/或资源共享的推荐方法的任何指导。 Re: i.MX 95: Dynamic TRDC/System Manager Resource Allocation and GPIO Sharing Between M7 and A55 你好, 在 i.MX 95 上,MIPI DSI 资源最初可由 M7 使用,之后移交给 A55。资源访问和所有权应通过系统管理器/TRDC 配置进行配置,而实际的运行时交接应由软件处理。TRDC 控制哪些逻辑机器/功能域可以访问外围设备,但它不管理 M7 和 A55 之间的同步。因此,M7 应先完成所有 DSI 操作,停止使用外围设备,并通过 MU/IPC 等核心间机制通知 A55,然后 A55 才能接管控制权。同样,通过适当的 TRDC 配置,可以使 GPIO 资源同时供 M7 和 A55 访问,但同时访问必须通过软件进行同步。对于 DSI 用例,建议的方法是每次只让一个核心积极使用外围设备,并使用 MU/IPC 进行切换。 Re: i.MX 95: Dynamic TRDC/System Manager Resource Allocation and GPIO Sharing Between M7 and A55 我已与AE团队讨论过,请参考以下更新。 在 i.MX 95 上,资源所有权和 TRDC 权限是在构建时静态地在 SM 配置 (mx95evk.cfg) 中定义的。→ 生成的config_.h 文件,并在 MIX 设备上电时由系统管理器 (SM) 应用。*运行时,没有 SCMI/SM 消息可以将外围设备的所有权从一个逻辑机 (LM) 转移到另一个逻辑机。 然而,SM 文档将“将显示屏从一个 LM 移交给另一个 LM”列为 SM_SCMI_PERM_EXCLUSIVE 模型的确切动机用例。所以交接是可以实现的,只是不能通过“转移”所有权来实现。 Q1 & Q2 — MIPI DSI M7 → A55 交接:如何操作 LMM(逻辑机器管理)SCMI 协议仅启动/重置/关闭/挂起/唤醒 LM——它没有 RESOURCE_ASSIGN 或 OWNERSHIP_TRANSFER 消息。请改用时分交接: 在 mx95evk.cfg 中预先授予 BOTH LMs 访问权限。默认情况下,EVK 配置仅将 MIPI_DSI、MIPI_PHY、DC_DISPENG、BLK_CTRL_DISPLAYMIX、显示时钟/电源(PD_DISPLAY、CLK_DISP*)分配给 AP(LM2)的所有者——您还必须将它们添加到 M7 LM(LM1)以允许 M7 优先使用。 将 SM 管理的资源(时钟、电源、RESET)标记为 SM_SCMI_PERM_EXCLUSIVE(api=all),这样来自两个 LM 的请求就不会被静默聚合/覆盖。 在切换时, M7 使 DSI/DCIF 静默,然后通过应用层 IPC(MU 邮箱或 SCMI 通知)向 A55 发出信号。A55(Linux/DRM DSI+DPU 协议栈)随后启动相同的 IP。 交接顺序是客户软件的责任(时间划分)。SM 仅保证 HW 可以从两侧驾驶,因为两个 LM 都已预先获得访问权限。TRDC 所有权不能在运行时重写——只有 SM 可以对 TRDC 进行编程,并且只能从 MIX 上电时的静态配置进行编程。 控制此功能的 TRDC 配置(在 .cfg 文件中定义): MDAC_am=… — 主功能域分配(将总线主控映射到功能域 ID) MBC_am=s.b— 内存块检查 —这是限制外围设备访问的地方。 MRC_am=… — 内存区域检查(大型内存区域,例如 DDR) 每个LM都绑定到一个DID,例如:SM did=2,AP(LM2) did=3,M7(LM1) did=4。 Q3 — M7 和 A55 之间共享 GPIO 是的,TRDC 可以同时授予 M7 功能域和 A55 功能域对同一 GPIO 实例的并发访问(为两个 DID 启用其 MBC 块)。但需要注意一个关键问题,并且有两种支持的模式: 注意: i.MX 95 GPIO没有硬件仲裁——PDR/DR/GDIR 寄存器是物理共享的,因此来自两个核心的非协调读-修改-写操作会相互竞争。 模式 A(不相交引脚 + SW 同步):按照约定为每个内核分配特定引脚(配置已按 LM 分割引脚)。由于数据/方向寄存器组仍然是共享的,因此需要使用硬件信号量/MU来保护并发 RMW,或者确保内核永远不会同时访问同一个寄存器组。 模式 B(SM 仲裁,推荐用于真正共享的实例):通过始终开启的GPIO1进行路由,该 GPIO1 由 SM 拥有,其记录的角色是“仲裁共享访问”。IOMUXC/IOMUX_GPR 同样由 SM 仲裁。Pinmux/daisy 通过 SCMI 引脚控制协议进行设置,并具有每个代理的权限;GPIO数据操作是直接 MMIO。
View full article
LPC5514JBD64E Use for WS2812. Hi, Is LPC5514JBD64E suitable for working with WS2812 for a beginner. If yes Where Can I get The Code and other Details.  Thank you. LPC55xx Re: LPC5514JBD64E Use for WS2812. hi @Kishore02  Thank you for your post! There is not information about the implementation of WS2812 for the LPC551x, you could use the Programmable Logic Unit to do it, in another devices there are example using the FlexIO modules like in application code hub for the MCXA366: https://mcuxpresso.nxp.com/appcodehub?search=an-emulating-ws2812-bus-with-flexio-on-mcx366  Also, there is a post of a colleague that implement it for a Kinetis board: NXP FlexIO Generator for the WS2812B LED Stripe Protocol Hope this information help as a reference  Re: LPC5514JBD64E Use for WS2812. The LPC5514JBD64E (featuring an ARM Cortex-M33 core running up to 150 MHz) is a powerful microcontroller, but it is not the ideal choice for a true beginner when working with WS2812 (NeoPixel) addressable LEDs.  Re: LPC5514JBD64E Use for WS2812. Yes, the LPC5514JBD64 can be used to drive WS2812 LEDs, although it may require configuring a timer/SCT or SPI-based interface to generate the precise WS2812 timing. For a beginner, I recommend starting with NXP’s MCUXpresso SDK examples and WS2812 driver examples, then adapting them to the LPC5514; the LPC5514 SDK documentation and sample code are available through NXP’s official MCUXpresso resources.
View full article
SC16IS740 最大晶体频率 尊敬的恩智浦技术支持团队: 我们使用 SC16IS740,电源电压为 3.3V。 请问能否确认可以直接连接在 XTAL1 和 XTAL2 之间的外部晶振(晶体振荡器)的最大频率是多少? 数据手册中提到: 适用于外部时钟,晶振(晶体振荡器)最大频率为 24 MHz。 感谢您的支持。 此致, 阿比舍克 Re: SC16IS740 Maximum Crystal Frequency 你好 AbishekDevan 再会! 是的,你说得对;使用外部晶体的极限是 24 MHz。 祝你今天过得愉快,一切顺利。
View full article
FRDM-MCXW71の2つのLPSPIポートをZephyrで使うのはどうですか? こんにちは、 FRDM-MCXW71の2つのLPSPIポートをZephyrアプリケーションで使いたいと考えています。 しかし、Zephyr 4.4.0で確認すると、下 Zephyrproject/Zephyr/ボード/NXP/frdm_mcxw71 以下のファイルが見つかりました。 frdm_mcxw_71.dts ファイル。 そこには&lpspi1のエントリしかありません。(SPIフラッシュデモで使用) &lpspi0 のエントリが存在しません。 frdm_mcxw71-pinctrl.dtsi また、&lpspi1 のエントリのみ lpspi0の使い方に関する例はありますか? 通常のZephyrプロジェクトファイル(.overlayやprj.conf)以外で、どのファイルを変更する必要がありますか? ありがとうございます。 Re: Using the two LPSPI ports on the FRDM-MCXW71 with Zephyr? zephyrproject/zephyr/drivers/spi/spi_nxp_lpspiで特定のドライバーを見つけました。 ただ、両方のLPSPIポートにどう使えるのかはよくわかりません。 Re: Using the two LPSPI ports on the FRDM-MCXW71 with Zephyr? こんにちは、お元気でお過ごしでしょうか。 lpspi0とlpspi1は、すでにzephyr/dts/arm/nxp/mcx/nxp_mcxw7x_common.dtsiでSoCレベルで宣言されており、必要なハードウェアプロパティ(レジスタ、割り込み、クロック、FIFOサイズ)がすべて含まれていますが、デフォルトではstatus = "disabled"に設定されています。ボードファイルfrdm_mcxw71.dtsはlpspi1だけを有効にしますが、lpspi0もアプリケーションのオーバーレイファイルを通じて同様に有効化できます。 既存のLPPspy1構成を参考にしてください。基本的なオーバーレイはこんな感じで、カスタムデバイス実装で拡張できます: &pinctrl { pinmux_lpspi0: pinmux_lpspi0 { group0 { pinmux = , , , ; slew-rate = "fast"; drive-strength = "low"; }; }; }; &lpspi0 { status = "okay"; pinctrl-0 = <&pinmux_lpspi0>; pinctrl-names = "default"; }; よろしくお願いします、 ソフィア。 Re: Using the two LPSPI ports on the FRDM-MCXW71 with Zephyr? こんにちは、ソフィアさん。 提案通り、オーバーレイの追加を加えた最小限のアプリケーションを作成しました。 アプリケーションはコンパイルされましたが、spiデバイスのバインドは依然として失敗しました。 オーバーレイ部分にラベルが加わった場合にのみ、製本は機能します。 重ねて表示: &lpspi0 { ... label = "LPSPI_0"; } &lpspi1 { ... label = "LPSPI_1"; } main.c 内: const struct device *lpspi0_dev; lpspi0_dev = device_get_binding("LPSPI_0"); printk("%p\n,lpspi0_dev); lpspi0とlpspi1の両方でこの操作を行うと、現在は正常に動作するようです。 各アプリケーションごとにラベルを作成することが期待されているのでしょうか? よろしくお願いします。 ヘールト
View full article
CodeWarrior 5.1 debugger. "Disable maskable ISR's when stepping" I-bit permanently set on 9S12XEQ512 Environment: IDE: CodeWarrior 5.1 (HC(S)12X compiler) Target: MC9S12XEQ512 Bus clock: 49.777 MHz BDM interface: reproducible with USB Multilink Universal; not observed with Cyclone Pro Host OS: observed on both Windows 10 and Windows 11 Memory model: reproducible in Large model; not (or much less) reproducible in Banked model Setting used: "HC12MultilinkCyclonePro" → "Setup..." → "Debug otions " → "Disable maskable ISR's when stepping" — enabled. Description: After a number of step operations (single step or step over) in the debugger, the maskable interrupts (I bit in CCR) become permanently disabled. Interrupts do not resume even after continuing execution (Run/Go) — they remain masked until the I bit is manually cleared in the CCR register view. This behavior is consistently reproducible in the Large memory model using the USB Multilink Universal BDM interface, on both Windows 10 and Windows 11 hosts. The issue has not been observed with the Cyclone Pro interface under otherwise identical project settings, nor (or much less) in the Banked memory model Workaround currently in use: Manually clearing the I bit in the CCR register view after it becomes stuck. Request: Is this a known issue with the USB Multilink Universal firmware/driver in combination with CodeWarrior 5.1's stepping emulation on the S12X core? Is there a fixed Multilink Universal firmware version, or a recommended alternative workflow for debugging interrupt-driven Large-model projects on this device/interface combination? Thank you Re: CodeWarrior 5.1 debugger. "Disable maskable ISR's when stepping" I-bit permanently set Hi, The behavior you are seeing is real and the interface difference you noticed (Multilink Universal affected, Cyclone Pro not) is a useful observation. Let me give you some practical guidance based on the type of interrupts involved, because the options differ. For timer-based interrupts If your application uses timer overflow, output compare, or similar peripheral-generated interrupts, you do not actually need the "Disable maskable ISR's when stepping" feature to handle them during debugging. Most S12X timer and peripheral modules have a FRZ bit that freezes the module when the device enters BDM active mode, which happens automatically during any halt or single step. With FRZ set, the timer stops counting during stepping and cannot generate an interrupt between steps. This works at the hardware level, independent of the debugger interface, and is the cleaner solution for this class of interrupt. For external interrupts and keyboard interrupts (KBI) This is where the situation is more limited. External IRQ and KBI interrupts are asynchronous external signals and there is no hardware freeze mechanism for them. The BDM interface cannot suppress them at the hardware level. The "Disable maskable ISR's when stepping" feature exists precisely to cover this gap by masking them through the CCR I bit during each step. Since this feature is not restoring the I bit correctly with the USB Multilink Universal in your setup, the most reliable option for debugging code that uses these interrupt sources is to use the Cyclone Pro, which you have already confirmed behaves correctly. Worth trying It is also worth testing with CodeWarrior 5.2 if you have access to it. There were some debugger-side changes in that version and the I-bit restoration behavior under the Large memory model with the USB Multilink Universal may be improved, though this cannot be guaranteed. Hope this helps clarify the options. Ladislav
View full article
Using the two LPSPI ports on the FRDM-MCXW71 with Zephyr? Hello, We want to use the two LPSPI ports on the FRDM-MCXW71 in a Zephyr application. However when I check in Zephyr 4.4.0, under zephyrproject/zephyr/boards/nxp/frdm_mcxw71 I find the following files: frdm_mcxw_71.dts file. It only has an entry for &lpspi1. (used in the spi flash demo) The entry for &lpspi0 is not present? frdm_mcxw71-pinctrl.dtsi Also only an entry for &lpspi1 Is there an example on how to use lpspi0 as well? Which files outside of the regular zephyr project files (.overlay and prj.conf) need to be modified? Thanks. Re: Using the two LPSPI ports on the FRDM-MCXW71 with Zephyr? I noticed a specific driver in zephyrproject/zephyr/drivers/spi/spi_nxp_lpspi. Not sure how this can be used for addressing both lpspi ports though. Re: Using the two LPSPI ports on the FRDM-MCXW71 with Zephyr? Hello, hope you are doing well. Both lpspi0 and lpspi1 are already declared at the SoC level in zephyr/dts/arm/nxp/mcx/nxp_mcxw7x_common.dtsi with all required hardware properties (registers, interrupts, clocks, FIFO sizes), but set to status = "disabled" by default. The board file frdm_mcxw71.dts only enables lpspi1 but lpspi0 can be enabled in the same way through your application overlay file. You can take the existing lpspi1 configuration as reference. The basic overlay would look something like this, which you can then extend with your custom device implementation: &pinctrl { pinmux_lpspi0: pinmux_lpspi0 { group0 { pinmux = , , , ; slew-rate = "fast"; drive-strength = "low"; }; }; }; &lpspi0 { status = "okay"; pinctrl-0 = <&pinmux_lpspi0>; pinctrl-names = "default"; }; Best regards, Sofia. Re: Using the two LPSPI ports on the FRDM-MCXW71 with Zephyr? Hi Sofia, I have created a minimal application with the overlay additions as suggested. The application compiled, but binding the spi devices still failed. Only when a label is added in the overlay sections, the binding works. In overlay: &lpspi0 { ... label = "LPSPI_0"; } &lpspi1 { ... label = "LPSPI_1"; } In main.c: const struct device *lpspi0_dev; lpspi0_dev = device_get_binding("LPSPI_0"); printk("%p\n,lpspi0_dev); Doing this for both lpspi0 and lpspi1 seems to work now. Is it expected to create those labels with each application?  Thanks, Geert
View full article
se05x_TP_PlatformSCP03keys.cを使ってプラットフォームSCP03キーをデフォルトに戻す方法は? こんにちは、NXPコミュニティの皆さん、 SE051のセキュア要素を扱っており、Plug and Trustミドルウェアを使ってプラットフォーム SCP03キーをデフォルト値に正しく戻す方法についてお尋ねしたいです。 これまでにやったこと: demos/se05x/se05x_RotatePlatformSCP03Keys/se05x_TP_PlatformSCP03keys.c を修正し、キーのリバートセクション (doc:start:revert-scp03-keys と doc:end:revert-scp03-keys の間) をコメントアウトしました。 私は自分のセットアップでアプリケーションをビルドし実行しました。 実行は成功し、「おめでとうございます!!! キーローテーション成功!!!!」というメッセージが表示されました。 キー変更を確認するために、/tmp/SE05X/plain_scp.txtを新しいキー値(0x4041...ENC、MAC、DEK用)で更新し、SSSCLI Connectで正常に接続できました。 その後の操作(ssscli generate rsa、ssscli set aes、ssscli se05x readidlist)はすべて正常に完了し、鍵が書き込まれIDが問題なく取得されたことが確認されました。 今、プラットフォームSCP03キーをデフォルトのキー(sss/ex/inc/ex_sss_tp_scp03_keys.hで定義)に戻したいと考えています。 どなたかse05x_TP_PlatformSCP03keys.cの修正方法や、このキーリバートを行う正しい手順について教えてもらえますか? 環境: ボード:MCIMX8M-WEVK(OM-SE051ARD搭載) Plug and Trust MW バージョン: v04.07.01 OP-TEE OSバージョン:3.19.0 Linuxカーネル:6.1.151 OEF ID: A8FA アドバイスやコードに関するヒントをいただければ大変ありがたいです。 SE050 Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? こんにちは、 @Uc_S さん。 キーをデフォルトに戻すだけなら、nanoパッケージの例が 推奨されるよりシンプルな経路 です。更新すれば3つの scp03_* 配列(認証用現在のキー)と3つの NEW_scp03_* 配列(デフォルトキーをターゲットに)だけを更新し、ex_se05x_rotate_scp03_keys()内のリバートコールはコメントアウトすればよいのです。詳細については、以下をご参照ください。 変更点1 — 現在のキー(SCP03セッションを開くために使用)を設定します。 38~43行目は、 ex_set_scp03_keys() に渡される認証キーです。プレースホルダー 0xABCD... の値を現在のキー( 0x4041... に置き換えてください。😞 uint8_t scp03_enc_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; uint8_t scp03_mac_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; uint8_t scp03_dek_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; c   変更点2 — 新しいターゲットキー(デフォルトのSE051C A8FAキー)を設定します。 45~50行目は、 PutKey を介して SE051 に書き込ま れるキーです。 0x4041... のプレースホルダーをSE051C OEF A8FAのデフォルト値に置き換えてください。 uint8_t NEW_scp03_enc_key[AES_KEY_LEN_nBYTE] = { 0xbf, 0xc2, 0xdb, 0xe1, 0x82, 0x8e, 0x03, 0x5d, 0x3e, 0x7f, 0xa3, 0x6b, 0x90, 0x2a, 0x05, 0xc6 }; uint8_t NEW_scp03_mac_key[AES_KEY_LEN_nBYTE] = { 0xbe, 0xf8, 0x5b, 0xd7, 0xba, 0x04, 0x97, 0xd6, 0x28, 0x78, 0x1c, 0xe4, 0x7b, 0x18, 0x8c, 0x96 }; uint8_t NEW_scp03_dek_key[AES_KEY_LEN_nBYTE] = { 0xd8, 0x73, 0xf3, 0x16, 0xbe, 0x29, 0x7f, 0x2f, 0xc9, 0xc0, 0xe4, 0x5f, 0x54, 0x71, 0x06, 0x99 }; c   変更点3 — リバートブロックをコメントアウトする ex_se05x_rotate_scp03_keys() では、85行目から90行目までコメントアウトして、コードが1回だけ回転(→現在のデフォルト)を行い、再び回転しようとしないようにします。 /* -- Comment out the revert block below -- */ // SMLOG_I("Reverting SCP03 keys(version - %02x) to OLD KEYS \n", KEY_VERSION); // ret = ex_se05x_change_keys(&se05x_session, &scp03_enc_key[0], &scp03_mac_key[0], &scp03_dek_key[0]); // if (ret != 0) { // SMLOG_E("Error in ex_se05x_change_keys \n"); // return 1; // } c     すてきな一日を、 カン ------------------------------------------------------------------------------- 注記: この投稿があなたの質問への回答になっている場合は、「正解としてマーク」ボタンをクリックしてください。ありがとうございます! - 前回の投稿から7週間Threadをフォローしており、その後の返信は無視しています もし後で関連する質問があれば、新しいThreadを開き、閉じたThreadを参照してください。 ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li ご説明いただきありがとうございます。 私の場合、現在のキーは既知です(0x4041...ENC、MAC、DEK)で、これらのキーを使ってSSSCLIを通じてSCP03セッションを正常に確立できます。 現在の認証キーが使えるので、se05x_TP_PlatformSCP03keys.cをデフォルトに戻すためにキー回転を修正する方法について詳しく教えていただけますか? 具体的には、以下の点について知りたいです。 セッション設定時に認証のために、現在のキー(0x4041...)で更新すべき変数やマクロはどれでしょうか。 ターゲットのデフォルトキー値を保持する変数または構造体はどれですか(例:sss_tp_scp03_keys.h)PutKey操作の場合。 se05x_TP_PlatformSCP03keys.cのコードスニペットや特定の行参照などは(または関連するブート/認証ヘッダー)を提供していただけると大変ありがたいです。 Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? こんにちは、 @Uc_S さん。 プラットフォームSCP03キーをデフォルト値に戻すのは、 現在のキーが既知である場合にのみ可能であり、SE051に対してキー更新( PutKey )コマンドを出す前に、SCP03セッションが成功裏に認証されている必要があります。 現在の鍵を紛失または忘れてしまった場合、SE051への認証および鍵のローテーションを実行することはできません。バックドアやオーバーライド機構は存在せず、これはデバイスのセキュリティモデルを維持するための設計上のものです。 さらに、工場出荷時リセットは効果 がなく 、プラットフォームSCP03キーは工場出荷時リセット手順の影響を受けません。 このような状況では、 SE051を、NXPがデフォルトで提供するキーを搭載した新しいデバイスに交換する以外に選択肢はありません。   すてきな一日を、 カン ------------------------------------------------------------------------------- 注記: この投稿があなたの質問への回答になっている場合は、「正解としてマーク」ボタンをクリックしてください。ありがとうございます! - 前回の投稿から7週間Threadをフォローしており、その後の返信は無視しています もし後で関連する質問があれば、新しいThreadを開き、閉じたThreadを参照してください。 ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li 詳細なご指導をいただき、ありがとうございます。 あなたの指示に従い、キーを更新し、リバートブロックをコメントアウトし、ナノパッケージの例を無事に構築・実行しました。 しかし、実行中に、PUT KEY APDUコマンドの実行中に、SCP03キー更新操作がSWステータスコード6A80で失敗しました。実行ログの概要は以下のとおりです。 Plug and Trust nano package - version: 1.6.1 ... Establish Secure Channel to SE05x ! Sending GP Initialize Update Command !!! ... CardCryptogram verified successfully...Calculate HostCryptogram Sending GP External Authenticate Command !!! APDU Tx> :84 82 33 00 10 ... APDU Rx< :69 82 Authentication Successful!!! Created scp03 Session Changing SCP03 keys(version - 0b) to NEW KEYS APDU Tx> :84 d8 0b 81 58 ... APDU Rx< :6a 80 Error in DoAPDUTxRx Error in ex_se05x_change_keys SE05x Rotate SCP03 keys Example Failed ! 根本的な原因としては、OpenSSLバージョン(ビルドPCとターゲット評価ボードの両方でOpenSSL 3.xが使用)がPutKey時のキーの派生やフォーマットに影響を与えているか、特にDEKの値が以前に不一致または書き換えられた可能性があります。 現時点では、これらの可能性をさらに調査したり対処したりするだけの十分な時間的余裕がありません。後日、時間があれば個別に調べてみます。 ご協力いただき、改めて感謝申し上げます。 Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? こんにちは、 @Uc_S さん、 詳細な実行ログをありがとうございます。問題の特定に必要な情報がまさに揃っています。あなたが挙げた2人の容疑者は、どちらも正当で、論理的にも妥当です。以下に、最も可能性の高い状況をまとめました。 6A80エラーが教えてくれること SW 6A80 ( SW_WRONG_DATA )は、SE051がPUT KEY APDUのデータフィールドを暗号学的に無効として拒否したことを意味します。ログで認証が成功裏に完了した(CardCryptogram認証+外部認証成功)を示しているので、 ENCキーとMACキーは正しいことが確認されています。この失敗はPUT KEYステップに限定されており、これは DEKキー または 新しい鍵素材をラップするAES暗号化の問題を直接示しています。 容疑者1:DEKキーの不一致 ― 最も可能性の高い主な原因 PUT KEYコマンド内では、新しいキーはそれぞれ現在のDEKで暗号化されてからSEに送信されます。ホストコード内のDEK値がデバイスに保存されているDEK値と完全に一致しない場合、SEはガベージを復号して6A80を返します。 ほぼ同じケースで、以前のSE051C1顧客からの結論は以下の通りです。 「最小限のサンプルがPlatformSCPで動作するなら、ENCキーとMACキーは正しい。」キーの回転が依然として失敗するということは、DEKキーが間違っていることを意味します...過去にDEKキーが誤って設定された可能性があります。 これまでの経緯から考えると、これが最も可能性の高い根本原因です。以前の不完全または誤った回転により、SE051のDEKが 0x4041... と一致しない状態になっている可能性があります。 確認手順:新品の工場出荷時のSE051サンプルで同じコードをテストします。即座に成功した場合、現在のデバイスのDEKの状態が破損しているか不明であることが確認され、チップを交換する必要があります。正しいDEKがなければ復旧手段はありません。 容疑者2:OpenSSL 3.x互換性 ― 実際のリスク、二次的原因 ナノパッケージのSCP03暗号パスは、レガシーの低レベルOpenSSL APIを使用しています。 AES_set_encrypt_key((uint8_t *)key, keylen * 8, &AESKey); AES_ecb_encrypt(srcData, destData, &AESKey, AES_ENCRYPT); ナノパッケージは OpenSSL 1.1.1のみで設計・テストされました。OpenSSL 3.xではこれらのAPIは非推奨化されており、レガシープロバイダーを実行時に明示的にロードする必要があります。もし読み込まれていなければ、これらの呼び出しは静かに誤った出力を生み出し、DEKで暗号化されたペイロードが破損し、6A80もトリガーされます。 推奨される修正方法: nanoパッケージを mbedTLS をホストの暗号バックエンド( -DEX_SE05X_USE_MBEDTLS=1 )に切り替えてください。これは廃止されたOpenSSL APIに依存しず、このユースケースで完全にサポートされています。あるいは、OpenSSL 1.1.1に対して再構築してOpenSSLバージョン仮説を単独で検証する方法もあります。 推奨される手順 まずは新品のSE051でテストしてください。これが、現在使用しているデバイスのDEKが根本原因かどうかを確認する最も迅速な方法です。 今後OpenSSL 3.xのリスクを排除するために、ホストの暗号バックエンドはmbedTLSに切り替えましょう。 新しいデバイスでもmbedTLSが動作しない場合は、詳細な調査のために、ビルド環境の詳細(OS、コンパイラ、mbedTLSのバージョン)をお知らせください。 ご注意ください:現在お使いのデバイスのDEKが不明な状態であることが確認された場合、それを復旧する方法はありません。工場出荷時のキーが設定された交換用チップが必要になります。 新たなサンプル検査の結果をお知らせください。喜んでさらにサポートさせていただきます。 すてきな一日を、 カン ------------------------------------------------------------------------------- 注記: この投稿があなたの質問への回答になっている場合は、「正解としてマーク」ボタンをクリックしてください。ありがとうございます! - 前回の投稿から7週間Threadをフォローしており、その後の返信は無視しています もし後で関連する質問があれば、新しいThreadを開き、閉じたThreadを参照してください。 ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li 6A80エラーに関する詳細な説明と分析をいただき、誠にありがとうございました。 DEKキーの不一致とOpenSSL 3.xとの互換性リスクに関する詳細な説明(およびmbedTLSの使用に関する提案)は有益であり、実際に作用しているメカニズムを明確にする。 これらの提案案――新しいサンプルでのテストや暗号バックエンドのmbedTLSの検討など――は、資源や帯域幅が許す将来のトラブルシューティングのために心に留めておきます。
View full article
如何使用 se05x_TP_PlatformSCP03keys.c 将平台 SCP03 密钥恢复为默认值? NXP社区的各位朋友,大家好! 我正在使用 SE051 安全元件,想请教如何使用 Plug and Trust 中间件将平台 SCP03 密钥正确地恢复到其默认值。 我目前已完成的工作: 我修改了 demos/se05x/se05x_RotatePlatformSCP03Keys/se05x_TP_PlatformSCP03keys.c,注释掉了密钥还原部分(在 doc:start:revert-scp03-keys 和 doc:end:revert-scp03-keys 之间)。 我在自己的电脑上构建并运行了该应用程序。 执行成功,显示信息:“恭喜!!!密钥轮换成功!!!!” 为了验证密钥更改,我使用新的密钥值(ENC、MAC 和 DEK 的密钥值为 0x4041...)更新了 /tmp/SE05X/plain_scp.txt,并通过 ssscli connect 成功连接。 后续操作(ssscli generate rsa、ssscli set aes 和 ssscli se05x readidlist)均已成功完成,证实密钥已写入且 ID 已检索,没有出现任何问题。 现在,我想将平台 SCP03 密钥恢复为默认密钥(在 sss/ex/inc/ex_sss_tp_scp03_keys.h 中定义)。 请问有人可以指导我如何修改 se05x_TP_PlatformSCP03keys.c 文件,或者执行此密钥还原的正确步骤是什么吗? 环境: 板:MCIMX8M-WEVK,带OM-SE051ARD芯片 Plug and Trust MW 版本:v04.07.01 OP-TEE 操作系统版本:3.19.0 Linux 内核:6.1.151 OEF ID:A8FA 任何建议或代码方面的指导都将不胜感激。 SE050 Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? 嗨@Uc_S , 如果您只需要将密钥轮换回默认值,那么 nano 包示例是推荐的更简单的方法——只需要更新三个 scp03_* 数组(当前身份验证密钥)和三个 NEW_scp03_* 数组(目标默认密钥),并且需要注释掉 ex_se05x_rotate_scp03_keys() 中的 revert 调用。详情请见下文。 更改 1 — 设置当前密钥(用于打开 SCP03 会话) 第 38-43 行是传递给 ex_set_scp03_keys() 的身份验证密钥。请将占位符 0xABCD... 值替换为您当前的密钥( 0x4041... 😞 uint8_t scp03_enc_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; uint8_t scp03_mac_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; uint8_t scp03_dek_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; c   更改 2 — 设置新的目标密钥(默认 SE051C A8FA 密钥) 第 45-50 行是将通过 PutKey 写入 SE051 的 密钥。将 0x4041... 占位符替换为 SE051C OEF A8FA 默认值: uint8_t NEW_scp03_enc_key[AES_KEY_LEN_nBYTE] = { 0xbf, 0xc2, 0xdb, 0xe1, 0x82, 0x8e, 0x03, 0x5d, 0x3e, 0x7f, 0xa3, 0x6b, 0x90, 0x2a, 0x05, 0xc6 }; uint8_t NEW_scp03_mac_key[AES_KEY_LEN_nBYTE] = { 0xbe, 0xf8, 0x5b, 0xd7, 0xba, 0x04, 0x97, 0xd6, 0x28, 0x78, 0x1c, 0xe4, 0x7b, 0x18, 0x8c, 0x96 }; uint8_t NEW_scp03_dek_key[AES_KEY_LEN_nBYTE] = { 0xd8, 0x73, 0xf3, 0x16, 0xbe, 0x29, 0x7f, 0x2f, 0xc9, 0xc0, 0xe4, 0x5f, 0x54, 0x71, 0x06, 0x99 }; c   更改 3 — 注释掉还原块 在 ex_se05x_rotate_scp03_keys() 中,注释掉第 85-90 行,这样代码就只会进行一次旋转(当前键 → 默认值),而不会尝试再次旋转回来: /* -- Comment out the revert block below -- */ // SMLOG_I("Reverting SCP03 keys(version - %02x) to OLD KEYS \n", KEY_VERSION); // ret = ex_se05x_change_keys(&se05x_session, &scp03_enc_key[0], &scp03_mac_key[0], &scp03_dek_key[0]); // if (ret != 0) { // SMLOG_E("Error in ex_se05x_change_keys \n"); // return 1; // } c     祝你有美好的一天, 坎 ------------------------------------------------------------------------------- 笔记: - 如果此回复解答了您的问题,请点击“标记为正确答案”按钮。谢谢你! - 我们会持续关注帖子,从最后一条回复发出后持续7周,之后的回复将被忽略。 如果您之后有相关问题,请另开新帖并引用已关闭的帖子。 ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li 谢谢你的解释。 就我而言,当前密钥是已知的(ENC、MAC 和 DEK 的密钥为 0x4041...),我可以通过 ssscli 使用这些密钥成功建立 SCP03 会话。 由于我目前拥有可用于身份验证的密钥,请问您能否详细说明如何修改 se05x_TP_PlatformSCP03keys.c 文件,以将密钥轮换回默认值? 具体来说,我想知道: 在会话建立期间,哪些变量或宏应该使用当前密钥(0x4041...)进行身份验证更新? 哪些变量或结构应该保存目标默认键值(例如 ex_sss_tp_scp03_keys.h)用于 PutKey 操作。 se05x_TP_PlatformSCP03keys.c 中的任何代码片段或特定行引用(或相关的启动/认证标头)将不胜感激。 Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? 嗨@Uc_S , 只有在知道当前密钥的情况下,才能将平台 SCP03 密钥轮换回默认值,因为在向 SE051 发出任何密钥更新 ( PutKey ) 命令之前,需要成功验证 SCP03 会话。 如果当前密钥丢失或遗忘,则无法对 SE051 进行身份验证并执行密钥轮换。没有后门或绕过机制——这是为了维护设备的安全模型而设计的。 此外,恢复出厂设置也无济于事,因为平台 SCP03 密钥明确不受恢复出厂设置程序的影响。 在这种情况下,唯一的选择是用一个仍然带有 NXP 默认配置密钥的新设备替换 SE051 。   祝你有美好的一天, 坎 ------------------------------------------------------------------------------- 笔记: - 如果此回复解答了您的问题,请点击“标记为正确答案”按钮。谢谢你! - 我们会持续关注帖子,从最后一条回复发出后持续7周,之后的回复将被忽略。 如果您之后有相关问题,请另开新帖并引用已关闭的帖子。 ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li 感谢您提供详细指导。 按照您的指示,我更新了密钥,注释掉了还原块,并成功构建和执行了 nano-package 示例。 然而,在执行过程中,SCP03 密钥更新操作在 PUT KEY APDU 命令期间失败,SW 状态代码为 6A80。以下是执行日志的摘要: Plug and Trust nano package - version: 1.6.1 ... Establish Secure Channel to SE05x ! Sending GP Initialize Update Command !!! ... CardCryptogram verified successfully...Calculate HostCryptogram Sending GP External Authenticate Command !!! APDU Tx> :84 82 33 00 10 ... APDU Rx< :69 82 Authentication Successful!!! Created scp03 Session Changing SCP03 keys(version - 0b) to NEW KEYS APDU Tx> :84 d8 0b 81 58 ... APDU Rx< :6a 80 Error in DoAPDUTxRx Error in ex_se05x_change_keys SE05x Rotate SCP03 keys Example Failed ! 关于潜在的根本原因,我怀疑要么是 OpenSSL 版本(构建 PC 和目标评估板上都使用了 OpenSSL 3.x)影响了 PutKey 期间的密钥派生/格式化,要么是 DEK 值之前可能不匹配/被重写。 目前,我没有足够的精力进一步调查或探讨这些可能性。如果时间允许,我会稍后单独调查这些问题。 再次感谢您的帮助。 Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? 嗨@Uc_S , 感谢您提供的详细执行日志——它提供了准确定位问题所需的所有信息。你的两个嫌疑人都合理且有理有据。以下是对最有可能发生的情况的分析。 6A80错误告诉我们什么 SW 6A80 ( SW_WRONG_DATA )表示 SE051 拒绝了 PUT KEY APDU 的数据字段,认为其在加密上无效。由于您的日志显示身份验证已成功完成(CardCryptogram 已验证 + 外部身份验证已通过),因此确认 ENC 和 MAC 密钥正确。故障仅限于 PUT KEY 步骤,这直接指向DEK 密钥或用于封装新密钥材料的 AES 加密存在问题。 嫌疑人 1:DEK 密钥不匹配——最可能的主要原因 在 PUT KEY 命令中,每个新密钥在发送到 SE 之前都会根据当前的 DEK 进行加密。如果主机代码中的 DEK 值与设备上存储的 DEK 值不完全匹配,则 SE 解密垃圾数据并返回 6A80。 之前一位 SE051C1 客户提出的一个几乎完全相同的案例得出了以下结论: “如果最小示例能够使用 PlatformSCP,那么 ENC 和 MAC 密钥就是正确的。”由于钥匙旋转仍然失败,这意味着DEK钥匙肯定有问题……DEK钥匙可能以前设置错误过。 鉴于您的历史记录,这是最可能的根本原因——先前不完整或不正确的旋转可能导致 SE051 的 DEK 处于不再与 0x4041... 匹配的状态。 确认步骤:在全新的、出厂时就准备的 SE051 样品上测试相同的代码。如果立即成功,则确认当前设备的 DEK 状态已损坏/未知,芯片应该更换——没有正确的 DEK,就没有恢复路径。 嫌疑对象 2:OpenSSL 3.x 兼容性——真实风险,次要原因 该纳米软件包的 SCP03 加密路径使用传统的底层 OpenSSL API: AES_set_encrypt_key((uint8_t *)key, keylen * 8, &AESKey); AES_ecb_encrypt(srcData, destData, &AESKey, AES_ENCRYPT); 该纳米软件包仅使用 OpenSSL 1.1.1进行设计和测试。在 OpenSSL 3.x 中,这些 API 已被弃用,需要在运行时显式加载旧版提供程序。如果未加载,这些调用可能会静默地产生不正确的输出——这将破坏 DEK 加密的有效载荷,并触发信号 6A80。 建议的修复方法:将 nano 包切换为使用mbedTLS作为主机加密后端( -DEX_SE05X_USE_MBEDTLS=1 ),它不依赖于已弃用的 OpenSSL API,并且完全支持此用例。或者,针对 OpenSSL 1.1.1 重新构建,以单独测试 OpenSSL 版本假设。 建议的操作顺序 首先在新 SE051 上进行测试——这是确认当前设备的 DEK 是否是根本原因的最快方法。 将主机加密后端切换为 mbedTLS,以消除未来任何 OpenSSL 3.x 风险。 如果新设备使用 mbedTLS 也出现故障,请分享构建环境详情(操作系统、编译器、mbedTLS 版本)以便进一步调查。 请注意:如果确认当前设备的 DEK 处于未知状态,则无法恢复——需要更换带有出厂默认密钥的芯片。 请与我们联系新样品的检测结果,我们将很乐意提供进一步的帮助。 祝你有美好的一天, 坎 ------------------------------------------------------------------------------- 笔记: - 如果此回复解答了您的问题,请点击“标记为正确答案”按钮。谢谢你! - 我们会持续关注帖子,从最后一条回复发出后持续7周,之后的回复将被忽略。 如果您之后有相关问题,请另开新帖并引用已关闭的帖子。 ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li 非常感谢您对 6A80 错误的详细解释和分析。 对 DEK 密钥不匹配和 OpenSSL 3.x 兼容性风险的分析(以及使用 mbedTLS 的建议)很有帮助,并阐明了正在发挥作用的确切机制。 我会记住这些建议选项——例如在新样本上进行测试,以及考虑使用 mbedTLS 作为加密后端——以便在资源和带宽允许的情况下进行未来的故障排除。
View full article
How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? Hello NXP Community, I am working with the SE051 secure element and would like to ask how to properly revert the Platform SCP03 keys back to their default values using the Plug and Trust Middleware. What I have done so far: I modified demos/se05x/se05x_RotatePlatformSCP03Keys/se05x_TP_PlatformSCP03keys.c by commenting out the key reversion section (between doc:start:revert-scp03-keys and doc:end:revert-scp03-keys). I built and executed the application on my setup. The execution was successful, showing the message: "Congratulations !!! Key Rotation Successful!!!!" To verify the key change, I updated /tmp/SE05X/plain_scp.txt with the new key value (0x4041... for ENC, MAC, and DEK) and successfully connected via ssscli connect. Subsequent operations (ssscli generate rsa, ssscli set aes, and ssscli se05x readidlist) were all completed successfully, confirming that keys were written and IDs were retrieved without issues. Now, I would like to restore the Platform SCP03 keys back to the default keys (defined in sss/ex/inc/ex_sss_tp_scp03_keys.h). Could anyone guide me on how to modify se05x_TP_PlatformSCP03keys.c or what the correct process is to perform this key reversion? Environment: Board: MCIMX8M-WEVK with OM-SE051ARD Plug and Trust MW Version: v04.07.01 OP-TEE OS Version: 3.19.0 Linux Kernel: 6.1.151 OEF ID: A8FA Any advice or code pointers would be greatly appreciated. SE050 Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? Hi @Uc_S , If you just need to rotate the keys back to the default, the nano-package example is the recommended simpler path — only the three scp03_* arrays (current keys for auth) and the three NEW_scp03_* arrays (default keys as target) need to be updated, and the revert call within ex_se05x_rotate_scp03_keys() needs to be commented out. Please refer to the following for details. Change 1 — Set the current keys (used to open the SCP03 session) Lines 38–43 are the auth keys passed to ex_set_scp03_keys() . Replace the placeholder 0xABCD... values with your current keys ( 0x4041... 😞 uint8_t scp03_enc_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; uint8_t scp03_mac_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; uint8_t scp03_dek_key[AES_KEY_LEN_nBYTE] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F }; c   Change 2 — Set the NEW target keys (the default SE051C A8FA keys) Lines 45–50 are the keys that will be written into the SE051 via PutKey . Replace the 0x4041... placeholder with the SE051C OEF A8FA default values: uint8_t NEW_scp03_enc_key[AES_KEY_LEN_nBYTE] = { 0xbf, 0xc2, 0xdb, 0xe1, 0x82, 0x8e, 0x03, 0x5d, 0x3e, 0x7f, 0xa3, 0x6b, 0x90, 0x2a, 0x05, 0xc6 }; uint8_t NEW_scp03_mac_key[AES_KEY_LEN_nBYTE] = { 0xbe, 0xf8, 0x5b, 0xd7, 0xba, 0x04, 0x97, 0xd6, 0x28, 0x78, 0x1c, 0xe4, 0x7b, 0x18, 0x8c, 0x96 }; uint8_t NEW_scp03_dek_key[AES_KEY_LEN_nBYTE] = { 0xd8, 0x73, 0xf3, 0x16, 0xbe, 0x29, 0x7f, 0x2f, 0xc9, 0xc0, 0xe4, 0x5f, 0x54, 0x71, 0x06, 0x99 }; c   Change 3 — Comment out the revert block In ex_se05x_rotate_scp03_keys() , comment out lines 85–90 so the code does a single rotation only (current → default) and does not try to rotate back again: /* -- Comment out the revert block below -- */ // SMLOG_I("Reverting SCP03 keys(version - %02x) to OLD KEYS \n", KEY_VERSION); // ret = ex_se05x_change_keys(&se05x_session, &scp03_enc_key[0], &scp03_mac_key[0], &scp03_dek_key[0]); // if (ret != 0) { // SMLOG_E("Error in ex_se05x_change_keys \n"); // return 1; // } c     Have a great day, Kan ------------------------------------------------------------------------------- Note: - If this post answers your question, please click the "Mark Correct" button. Thank you! - We are following threads for 7 weeks after the last post, later replies are ignored Please open a new thread and refer to the closed one, if you have a related question at a later point in time. ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li  Thank you for the clarification. In my case, the current keys are known (0x4041... for ENC, MAC, and DEK), and I can successfully establish an SCP03 session using these keys via ssscli. Since I have the current keys available to authenticate, could you please provide details on how to modify se05x_TP_PlatformSCP03keys.c to perform the key rotation back to the default values? Specifically, I would like to know: Which variables or macros should be updated with the current keys (0x4041...) for authentication during session setup. Which variables or structures should hold the target default key values (ex_sss_tp_scp03_keys.h) for the PutKey operation. Any code snippets or specific line references in se05x_TP_PlatformSCP03keys.c (or related boot/auth headers) would be greatly appreciated. Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? Hi @Uc_S , Rotating the Platform SCP03 keys back to the default values is only possible when the current keys are known, as a successfully authenticated SCP03 session is required before any key update ( PutKey ) command can be issued to the SE051. If the current keys have been lost or forgotten, it is not possible to authenticate to the SE051 and perform the key rotation. There is no backdoor or override mechanism — this is by design to preserve the security model of the device. Additionally, a factory reset does not help, as Platform SCP03 keys are explicitly unaffected by the factory reset procedure. In this situation, the only option is to replace the SE051 with a new device that still carries the default NXP-provisioned keys.   Have a great day, Kan ------------------------------------------------------------------------------- Note: - If this post answers your question, please click the "Mark Correct" button. Thank you! - We are following threads for 7 weeks after the last post, later replies are ignored Please open a new thread and refer to the closed one, if you have a related question at a later point in time. ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li  Thank you for providing the detailed guidance. Following your instructions, I updated the keys, commented out the revert block, and successfully built and executed the nano-package example. However, during execution, the SCP03 key update operation failed with a SW status code 6A80 during the PUT KEY APDU command. Here is the summary of the execution log: Plug and Trust nano package - version: 1.6.1 ... Establish Secure Channel to SE05x ! Sending GP Initialize Update Command !!! ... CardCryptogram verified successfully...Calculate HostCryptogram Sending GP External Authenticate Command !!! APDU Tx> :84 82 33 00 10 ... APDU Rx< :69 82 Authentication Successful!!! Created scp03 Session Changing SCP03 keys(version - 0b) to NEW KEYS APDU Tx> :84 d8 0b 81 58 ... APDU Rx< :6a 80 Error in DoAPDUTxRx Error in ex_se05x_change_keys SE05x Rotate SCP03 keys Example Failed ! Regarding potential root causes, I suspect that either the OpenSSL version (OpenSSL 3.x is used on both the build PC and the target evaluation board) is affecting key derivation/formatting during PutKey, or the DEK value in particular might have been mismatched/rewritten previously. At this moment, I do not have sufficient bandwidth to investigate or address these possibilities further. I will look into them separately if time permits later. Thank you again for your assistance. Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? Hi @Uc_S , Thank you for the detailed execution log — it provides exactly what is needed to pinpoint the issue. Your two suspects are both valid and well-reasoned. Here is a breakdown of what is most likely happening. What the 6A80 Error Tells Us SW 6A80 ( SW_WRONG_DATA ) means the SE051 rejected the data field of the PUT KEY APDU as cryptographically invalid. Since your log shows that authentication completed successfully (CardCryptogram verified + External Authenticate passed), the ENC and MAC keys are confirmed correct. The failure is isolated specifically to the PUT KEY step, which points directly to an issue with the DEK key or the AES encryption used to wrap the new key material. Suspect 1: DEK Key Mismatch — Most Likely Primary Cause Inside the PUT KEY command, each new key is encrypted under the current DEK before being sent to the SE. If the DEK value in the host code does not exactly match the DEK stored on the device, the SE decrypts garbage and returns 6A80. A near-identical case from a prior SE051C1 customer concluded: "If the minimal example works with PlatformSCP, then ENC and MAC keys are correct. As key rotation still fails, this means the DEK key needs to be wrong... the DEK key may have been set wrongly in the past." This is the most probable root cause given your history — a prior incomplete or incorrect rotation may have left the SE051's DEK in a state that no longer matches 0x4041... . Confirmation step: Test the same code on a brand-new, factory-fresh SE051 sample. If it succeeds immediately, this confirms that the current device's DEK state is corrupted/unknown, and the chip should be replaced — there is no recovery path without the correct DEK. Suspect 2: OpenSSL 3.x Compatibility — Real Risk, Secondary Cause The nano-package's SCP03 crypto path uses the legacy low-level OpenSSL API: AES_set_encrypt_key((uint8_t *)key, keylen * 8, &AESKey); AES_ecb_encrypt(srcData, destData, &AESKey, AES_ENCRYPT); The nano-package was designed and tested with OpenSSL 1.1.1 only. In OpenSSL 3.x, these APIs are deprecated and require the legacy provider to be explicitly loaded at runtime. If it is not loaded, these calls can silently produce incorrect output — which would corrupt the DEK-encrypted payload and also trigger 6A80. Recommended fix: Switch the nano-package to use mbedTLS as the host crypto backend ( -DEX_SE05X_USE_MBEDTLS=1 ), which does not rely on deprecated OpenSSL APIs and is fully supported for this use case. Alternatively, rebuild against OpenSSL 1.1.1 to test the OpenSSL version hypothesis in isolation. Recommended Action Sequence Test on a fresh SE051 first — this is the fastest way to confirm whether the current device's DEK is the root cause. Switch to mbedTLS for the host crypto backend to eliminate any OpenSSL 3.x risk going forward. If the fresh device also fails with mbedTLS, please share the build environment details (OS, compiler, mbedTLS version) for further investigation. Please note: if the current device's DEK is confirmed to be in an unknown state, there is no way to recover it — a replacement chip with factory-default keys will be required. Please let us know the result of the fresh sample test and we will be happy to assist further. Have a great day, Kan ------------------------------------------------------------------------------- Note: - If this post answers your question, please click the "Mark Correct" button. Thank you! - We are following threads for 7 weeks after the last post, later replies are ignored Please open a new thread and refer to the closed one, if you have a related question at a later point in time. ------------------------------------------------------------------------------- Re: How to revert Platform SCP03 keys back to default using se05x_TP_PlatformSCP03keys.c? @Kan_Li  Thank you very much for the detailed explanation and analysis regarding the 6A80 error. The breakdown of the DEK key mismatch and the OpenSSL 3.x compatibility risks (along with the suggestion to use mbedTLS) is helpful and clarifies the exact mechanisms at play. I will keep these suggested options -- such as testing on a fresh sample and considering mbedTLS for the crypto backend -- in mind for future troubleshooting when resources and bandwidth allow.
View full article
LPC5514JBD64EはWS2812用です。 こんにちは、初心者LPC5514JBD64E WS2812の扱いに適していますか?もしそうなら、コードやその他の詳細はどこで入手できますか? よろしくお願いします。 LPC55xx Re: LPC5514JBD64E Use for WS2812. こんにちは、@Kishore02さん 投稿ありがとうございます! LPC551x向けのWS2812の実装については情報がありませんが、プログラマブルロジックユニットを使うことができます。他のデバイスでは、アプリケーションコードハブのMCXA366 https://mcuxpresso.nxp.com/appcodehub?search=an-emulating-ws2812-bus-with-flexio-on-mcx366  また、Kinetisボード向けに実装した同僚の投稿もあります:NXP FlexIO Generator for the WS2812B LED Stripe Protocol( LED Stripe Protocol) この情報が参考になれば幸いです。 Re: LPC5514JBD64E Use for WS2812. LPC5514JBD64E(最大150MHzのARM Cortex-M33コア搭載)は強力なマイクロコントローラですが、WS2812(NeoPixel)アドレッサブルLEDを扱う初心者には理想的な選択肢ではありません。 Re: LPC5514JBD64E Use for WS2812. はい、LPC5514JBD64はWS2812のLEDを駆動するために使用できますが、正確なタイミングを生成するためにタイマー/SCTまたはSPIベースのインターフェースを設定する必要がある場合があります。初心者には、まずNXPのMCUXpresso SDK例やWS2812のドライバー例から始め、それらをLPC5514に適応させることをおすすめします。LPC5514 SDKのドキュメントやサンプルコードはNXPの公式MCUXpressoリソースで入手可能です。
View full article
IMXRT1176 应用程序崩溃,之后 IMXRT 无法启动。 您好, 我正在使用 IMXRT1176 定制板,在应用程序和辅助引导加载程序开发过程中,我的应用程序崩溃了,之后我无法刷写我的应用程序。我尝试进入串口下载器模式,然后擦除FLEXSPI NOR Flash,即使这样它仍然显示: “Flash Driver V.2 启动失败 - rc Ef(55): 动态闪存驱动程序启动未能提供闪存参数。终止 (0x0, 0x0, 0x0) 状态 0x40 - 驱动程序报告初始化失败 - EXTSPIJ 驱动程序 rc 20107 (0x4E8B) 芯片初始化失败 - Ef(55): 动态闪存驱动程序启动无法提供闪存参数。初始化闪存驱动程序 MIMXRT1170_SFDP_QSPI.cfx##" 我尝试通过 USB 将 NXP 启动实用程序连接到 MCU,并看到了以下日志。 "--------MCU设备ROM信息-------- 唯一 ID[31:00] = 0x8295ad77 唯一 ID[63:32] = 0x242cc80e 当前版本 = K3.0.1 目标版本 = T3.0.0 生命周期状态 = HAB 开放 --------MCU Flashloader 信息------- 当前版本 = K2.8.0 目标版本 = T1.0.1 --------MCU 设备 eFusemap-------- (0x940) SYSBT_CFG0 = 0x0 (0x950) SYSBT_CFG1 = 0x0 (0x960) SYSBT_CFG2 = 0x8 BT_FUSE_SEL = 1'b0 当 BMOD[1:0] = 2'b00(从熔丝启动)且引导设备中没有应用程序时,MCU 直接进入串口下载器模式。 当 BMOD[1:0] = 2'b10(内部启动)时,MCU 将根据 BOOT_CFGx 引脚和熔丝 BOOT_CFGx 启动应用程序。 ----------FlexRAM 存储器----------- IOMUXC_GPR->GPR16 = -------- --------MCU设备ROM信息-------- 唯一 ID[31:00] = 0x8295ad77 唯一 ID[63:32] = 0x242cc80e 当前版本 = K3.0.1 目标版本 = T3.0.0 生命周期状态 = HAB 开放 --------MCU Flashloader 信息------- 当前版本 = K2.8.0 目标版本 = T1.0.1 --------MCU 设备 eFusemap-------- (0x940) SYSBT_CFG0 = 0x0 (0x950) SYSBT_CFG1 = 0x0 (0x960) SYSBT_CFG2 = 0x8 BT_FUSE_SEL = 1'b0 当 BMOD[1:0] = 2'b00(从熔丝启动)且引导设备中没有应用程序时,MCU 直接进入串口下载器模式。 当 BMOD[1:0] = 2'b10(内部启动)时,MCU 将根据 BOOT_CFGx 引脚和熔丝 BOOT_CFGx 启动应用程序。 ----------FlexRAM 存储器----------- IOMUXC_GPR->GPR16 = -------- --------MCU设备ROM信息-------- 唯一 ID[31:00] = 0x8295ad77 唯一 ID[63:32] = 0x242cc80e 当前版本 = K3.0.1 目标版本 = T3.0.0 生命周期状态 = HAB 开放 --------MCU Flashloader 信息------- 当前版本 = K2.8.0 目标版本 = T1.0.1 --------MCU 设备 eFusemap-------- (0x940) SYSBT_CFG0 = 0x0 (0x950) SYSBT_CFG1 = 0x0 (0x960) SYSBT_CFG2 = 0x8 BT_FUSE_SEL = 1'b0 当 BMOD[1:0] = 2'b00(从熔丝启动)且引导设备中没有应用程序时,MCU 直接进入串口下载器模式。 当 BMOD[1:0] = 2'b10(内部启动)时,MCU 将根据 BOOT_CFGx 引脚和熔丝 BOOT_CFGx 启动应用程序。 ----------FlexRAM 存储器----------- IOMUXC_GPR->GPR16 = -------- --------MCU设备ROM信息-------- 唯一 ID[31:00] = 0x8295ad77 唯一 ID[63:32] = 0x242cc80e 当前版本 = K3.0.1 目标版本 = T3.0.0 生命周期状态 = HAB 开放 --------MCU Flashloader 信息------- 当前版本 = K2.8.0 目标版本 = T1.0.1 --------MCU 设备 eFusemap-------- (0x940) SYSBT_CFG0 = 0x0 (0x950) SYSBT_CFG1 = 0x0 (0x960) SYSBT_CFG2 = 0x8 BT_FUSE_SEL = 1'b0 当 BMOD[1:0] = 2'b00(从熔丝启动)且引导设备中没有应用程序时,MCU 直接进入串口下载器模式。 当 BMOD[1:0] = 2'b10(内部启动)时,MCU 将根据 BOOT_CFGx 引脚和熔丝 BOOT_CFGx 启动应用程序。 ----------FlexRAM 存储器----------- IOMUXC_GPR->GPR16 = --------" 它显示“MCU 已进入 Flash 加载器,但配置外部存储器失败,请 RESET 板并设置正确的引导设备,然后重试”。 我的 或非 Flash 是 W25Q32JV 四通道SPI。 请您在这件事上帮帮我。 谢谢! 纳根德拉 Re: IMXRT1176 Application Crashed , Later IMXRT doesnot boot 嗨@Gavin_Jia , 感谢您的回复。 1.我从内存运行示例,得到的 ID 为 0。 2. Flash 连接到 FlexSPI A FlexSPI1 信号 RT1176 球/焊盘名称 FLEXSPI1_A_SCLK GPIO_SD_B2_07 FLEXSPI1_A_DATA0 GPIO_SD_B2_08 FLEXSPI1_A_DATA1 GPIO_SD_B2_09 FLEXSPI1_A_DATA2 GPIO_SD_B2_10 FLEXSPI1_A_DATA3 GPIO_SD_B2_11 FLEXSPI1_A_SS0_B GPIO_SD_B1_06 这块板之前可以正常用于我们的应用程序,我曾用它按照 FlexSPI 示例程序,通过擦除和重新编程闪存,为我们的应用程序实现辅助引导加载程序。但在此期间,应用程序卡住了,从那以后我就无法再刷写闪存了。 Re: IMXRT1176 Application Crashed , Later IMXRT doesnot boot 你好@Nagendra_Kumar , 日志显示 MCU、ROM 和 Flashloader 都正常(HAB 打开,串行下载器连接)。故障发生在 FlexSPI 到 W25Q32JV 的初始化过程中:工具甚至无法读取 SFDP 参数,因此这是板/配置问题,而不是烧录工具的问题。由于新刷机也失败了,请按以下顺序检查: 首先从内部 RAM 运行 flexspi_nor_polling_transfer_cm7 示例,并读取 W25Q32JV 的 JEDEC ID。如果无法读取 ID,则确认存在硬件/引脚问题——暂时不要关注刷机工具。 确认闪存位于哪个 FlexSPI 实例/引脚组上。默认的 .cfx 文件MCUBootUtility 假定 FlexSPI1 端口 A(EVK 接线)。如果您的 FlexSPI2 或 FlexSPI1 是辅助接口,请修改 option0 中的引脚组字段,并烧录 FLEXSPI_PIN_GROUP_SEL 熔丝(地址 0x9A0[10]);在 MCUBootUtility 中显式选择匹配的实例。 建议使用安全配置工具 (SPT) ,它内置了 W25Q 系列的 FCB 模板和启动内存配置功能,以便首先验证设置。 另外,请确认:这块板之前是否曾通过W25Q32JV成功编程和启动过? 此致, 加文 Re: IMXRT1176 Application Crashed , Later IMXRT doesnot boot 您好, 我忘了说,我还把 或非 闪存换成了新的。错误依然存在。 Re: IMXRT1176 Application Crashed , Later IMXRT doesnot boot 你好@Nagendra_Kumar , 谢谢你的更新! 我发现表格显示: FLEXSPI1_A_SS0_B GPIO_SD_B1_06 应该是 GPIO_SD_B2_06。这是笔误还是实际连接状态?RAM 代码返回的 JEDEC ID 为 0,表明闪存硬件完全没有响应。因此,如果您的连接正确,则应检查硬件连接和电源,并使用示波器检查波形。 此致, 加文 Re: IMXRT1176 Application Crashed , Later IMXRT doesnot boot 嗨@Gavin_Jia , FLEXSPI1_A_SS0_B GPIO_SD_B1_06 GPIO_SD_B1_06 是拼写错误。对此我深感抱歉。实际上它只连接到GPIO_SD_B2_06 。我用示波器检查了表格中的 FLEXSPI 引脚,发现这些引脚上没有任何活动。 此外,当我从 RAM 运行您提到的示例时,SS0_B 信号始终为低电平。我有多个相同类型的板,但在正常工作的板上,我得到的 ID 却是 0xEF。这个问题具体出现在我测试辅助引导加载程序实现的一块电路板上,当时电路板死机了。我不明白软件/应用程序崩溃怎么会导致这种行为,我也不知道是否应该用其他开发板来测试该软件。很遗憾,我无法提供我编写的代码。为了让您有个概念,我使用 SDK 中的 FreeRTOS 示例编写了我的应用程序,并构建了我的应用程序,然后使用 flexspi 轮询示例来实现辅助引导加载程序!我使用了 2 个 LPSPI(采用 DMA)、2 个 UART(采用 DMA)和 2 个 CAN。这是一个小型应用程序。我使用的是SDK版本2.8.1。 期待您的回复。 纳根德拉·库马尔。
View full article
PCA9450 バック電圧の許容範囲外 i.MX8 Nanoへの電源供給にはPCA9450BHNYを使用しています。 生産テスト中に、Buck 1 (V_0V95_SOC) と Buck2 (V_0V85_ARM) の電圧を測定し、0.85V +/- 2% の電圧制限を確認します。 このテスト中は、CPUは停止し、フラッシュメモリはプログラムされていない状態になります。 2026年8月から電圧が上昇し、一部の基板で上限値を超えます。 個々の基板の電圧が上昇するだけでなく、数千枚の基板の平均値も上昇する。 PCN (202502007F01 : PCA9450 / MP90 デュアルウェハ製造ソース拡張) がありました 昨年(2025年4月25日)SSMCからPSMCへ 新しいウェハーファブが問題の原因になり得るのでしょうか? i.MX 8M | i.MX 8M Mini | i.MX 8M Nano Re: PCA9450 Buck Voltage outside tolerance こんにちは! ご辛抱いただきありがとうございます。現在社内で確認中です。最新情報が入り次第、ご連絡いたします。 Re: PCA9450 Buck Voltage outside tolerance 社内調査の結果、問題の原因は、摩耗したテストプローブがプリント基板上のテストポイントに接触したことにあると判明した。テストプローブを交換したところ、電圧は許容範囲内になりました。
View full article
RT1172 LT8918 LCD 并行 LCDIFV2 小层 + 背景欠载 很遗憾,我无法直接将 mipi 输出连接到这个 LCD,所以添加了 LT8918,但似乎没有出现任何问题。测试图案可以顺利传输到该设备上,我的调试日志也显示它已同步并通过了基本设置。 但是我的输出结果有问题。我目前的代码是为一个非常简单的小型内存缓冲区(128x256)设计的,位于 800x1280 屏幕的中间。无需查看实际输出屏幕,但画面看起来非常失真。另外,在打印的诊断信息中,我遇到了很多欠载错误,就好像 DMA 获取数据的速度不够快,无法完成整行写入一样。 所以,我对液晶显示器或恩智浦寄存器并不精通。我是不是在某个地方犯了什么低级错误?存在诸多不确定因素。SRAM_OC1 真的速度很慢吗?或许可以通过调整 AXI 或 DMA 设置来获得正确的时序?我在 MPU 代码中将其重新配置为非缓存模式,但这可能也是一个错误。很遗憾,我看不出默认区域和 ncache 区域之间有什么区别。还有很多其他事情需要考虑,比如我尝试将步长更改为整个 800 像素行,而不是较小的 128 图层 0 大小。RGB 像素时钟比 MIPI 字节时钟慢,但我预计 MIPI 无论如何都会快得多,因为它只有 2 条线,而 RGB 有 24 个并行连接。 另外,我之所以只创建这么小的第 0 层区域,是因为 同步动态随机存取存储器(SDRAM) 可能会出现错误。为了摆脱这种不确定性,我把它简化成一个更小的、可控的部分,但即使在这里,我似乎也找不到到底哪里出了问题。 能走到这一步固然令人欣慰,但同时也让人很沮丧,因为我不知道该如何才能取得更大的进步。背景单色显示一切正常,测试图案也能显示形状良好的条形区域,所以我认为这不是真正的“LCD”问题,而是RAM缓冲区读取或LCDIFv2将其输出到并行输出时存在一些时序问题。 我该如何调试这个问题?谢谢。 Re: RT1172 LT8918 LCD parallel LCDIFV2 small layer + background underrun 我又尝试了一些方法,现在看来输出确实稳定了,没有出现欠载错误,至少根据我打印的诊断信息来看是这样。我认为最主要的变化是第一个变化,其他变化实际上更难一些,但为了清楚起见,我还是列出来吧。这个设置仍然是 RGB888,我还没想改成 alpha 层绘制来尝试,因为它还不是很好。 1. 将像素时钟频率降低很多,刷新率降至接近 15Hz。DMA或许有额外的工作时间?但正如你所说,OCRAM 的速度应该很快。我在 MPU 配置中也将其设置为该空间中的 NCACHE 区域。 2. 使用的颜色只有黑色和白色。尝试使用绿色背景实际上会引入一些背景问题,绿色可能会偏移到 RGB 图案中,导致每一行都发生变化(偏移 1 个字节?)。 3. 将 RAM 层 0 的宽度更改为 256,以匹配高度 256。实际上,高度为 128 也完全可以,只是这个特定的日志高度为 256,你可以看到步幅也变成了 768。 4. 前廊和后廊的视频设置要大得多。我怀疑这不是主要因素,我也尝试过用更快的速度运行这些设置,但效果并不理想。数据表允许 Hfp + Hbp + Hs 的最大值任意大,有什么理由让总和超过 200 吗?垂直设置总共限制为 250 个。 总之,这很有趣!从技术角度来说,LCD 数据手册上说它应该至少以 22Hz 的频率运行,但我没有看到白色部分出现闪烁。我希望它跑得更快。 我完全没有关注RT1172上的DMA,有什么办法可以加快它的运行速度或者提高它的优先级之类的吗?LCDIFv2还有其他相关设置吗?尤其是考虑到 OCRAM 的速度应该非常快,我很惊讶速度降低这么多竟然会产生这样的效果。 Re: RT1172 LT8918 LCD parallel LCDIFV2 small layer + background underrun 正确的。非常感谢!我们来尝试更多的事情。这是另一条日志。 我还是想坚持使用RGB888。ARGB8888 有什么理由更适合这个用途吗?我或许会找时间试试 alpha 版本。 CTRLDESCL5: 0xD8000260 我查阅了参考手册,BPP 设置位于第 27-24 位,所以“8”表示我已成功将其设置为 RGB888,至少看起来是这样。最后几个字节似乎无关紧要,alpha 设置似乎也无害地关闭了。 屏幕输出看起来不一样,但并不固定。或许有所改进?虽然仍有环绕效果,但没那么夸张了。 我还尝试过提高像素时钟的速度,但不确定这样做是好是坏。 我可以尝试更改更多视频设置吗?我原以为我设置的 25% Hsync 参数已经非常高了,但话说回来,我以前从未这样做过。什么样的场景才算特别好?垂直同步也相关吗?还有一个 LT8918 桥接器也需要获取这些设置输入,不过我也可以处理它。我只能靠猜来填入正确的数字吗? 驱动程序是 JD9365DA-H3,希望这能有所帮助。这是一个带有触摸屏的奇怪设备,但我对此没有任何意见。 Re: RT1172 LT8918 LCD parallel LCDIFV2 small layer + background underrun 嗨@davidpspeedtech , 谢谢你的更新!但是,问题在于您的某些设置不一致。 0xD9000260 → 硬件锁定的格式为 ARGB8888(32 位/像素)。 因此,当您设置步长 = 384 (=128×3, RGB888) 时,硬件仍然会读取 128×4 = 512 字节/行 → 每行未对齐,读取超出缓冲区,并发生下溢。 你每次都只更改了步长或 BPP 宏,但硬件实际上遵循 .pixelFormat ,它仍然是 ARGB8888——这四个值从来都不一致。 请一次性将它们全部统一设置为 32 位 ARGB8888 或 RGB888:   #define SMALL_LAYER_0_BPP 4U #define SMALL_LAYER_0_STRIDE (SMALL_LAYER_0_WIDTH * 4) /* = 512 */ uint8_t smallLayer0_Buffer0[256][512]; .pixelFormat = kLCDIFV2_PixelFormatARGB8888, .strideBytes = SMALL_LAYER_0_STRIDE, /* 512,而不是 3200 */   CTRLDESCL3 现在应该读取 0x200 (512)。32 位帧缓冲区和 24 针 RGB888 输出是独立的——24 针连接不需要 3 字节缓冲区。 此外,这三行代码使用了 eLCDIF 位定义;LCDIFv2 没有 RUN 位,这可能会干扰控制状态:   LCDIFV2->CTRL &= ~LCDIF_CTRL_SFTRST_MASK; LCDIFV2->CTRL &= ~LCDIF_CTRL_CLKGATE_MASK; LCDIFV2->CTRL |= LCDIF_CTRL_RUN_MASK;   Gavin_Jia_0-1788249587860.pngGavin_Jia_0-1788249587860.pngGavin_Jia_0-1788249587860.pngGavin_Jia_0-1788249587860.png 请仅使用标准 API 进行驱动。 为了证实你提出的其他几点: 步长是基于 RAM 缓冲区宽度,而不是屏幕宽度——正确。 背景颜色稳定,因为它是由寄存器生成的(无需内存读取);这证明输出路径正常,并将故障隔离到层读取路径。 颜色缓冲区在原色/辅助色之间闪烁(“就像丢失了一个字节”),这恰恰是欠载丢字节造成的;一旦格式一致,这种情况应该就会消失。 带宽不是瓶颈(OCRAM,128 宽)。如果在此之后仍然存在欠载现象,请降低像素时钟频率或增加 HBP/HFP 以确认。 Re: RT1172 LT8918 LCD parallel LCDIFV2 small layer + background underrun 但这并不能解决问题。实际上,无论是 RGB888 的步长为 128*3,还是 ARGB8888 的步长为 800*4 并尝试将整个屏幕放入 RAM 中,输出看起来都非常相似,屏幕边缘都会出现失真,而且我仍然会遇到欠载错误。我尝试了很多设置,不仅仅是那些文件中的文本! #define SMALL_LAYER_0_HEIGHT 256U #define SMALL_LAYER_0_WIDTH 128U #define SMALL_LAYER_0_BPP 3U /* RGB888 */ #define SMALL_LAYER_0_STRIDE (SMALL_LAYER_0_WIDTH*SMALL_LAYER_0_BPP) /*384*/ ~调试打印~ CTRLDESCL3: 0x 180 (引脚间距/步长 = 384 字节) 这样做也不行。 但我很高兴你能确认我的第 0 层步长设置应该基于 RAM 缓冲区宽度,而不是基于 LCD 屏幕宽度。正确的? 由于 LT8918 的接口是 24 针并联连接,所以它实际上应该是 RGB888。我有时担心 DMA 或其他什么功能跟不上,但由于缓冲区大小太小,SRAM_OC1 已经用完了。或许 RGB565 也能有类似的输出,因为其 RGB 引脚可以正确输出最高有效位。我甚至可能会尝试单色系的作品。 我可能犯了更多错误,如示例代码所示,RGB888 的 BPP 设置为 4 而不是 3。 是否必须将“背景区域”放在不同的层中,并缓冲到其他内存中?我喜欢它的背景设置似乎工作正常,无论我将其设置为哪种纯色,输出颜色都能保持稳定。对非白色 RAM 缓冲区进行一些实验,可以让屏幕在原色(RGB)或二次色之间闪烁,就像丢失了一个字节一样。 Re: RT1172 LT8918 LCD parallel LCDIFV2 small layer + background underrun 嗨@davidpspeedtech , 感谢您对 NXP MIMXRT 系列产品的关注! 我已查看您提供的附件,其中一些设置可能需要调整。 CTRLDESCL3: 0x00000C80(音高/步幅 = 3200 字节) #define SMALL_LAYER_0_BPP 3U /* RGB888 */ #define SMALL_LAYER_0_STRIDE (128 * 3) /* = 384 字节 */ uint8_t smallLayer0_Buffer0[256][384]; -->您编程到 CTRLDESCL3 中的 PITCH 值(3200 字节)与您的实际缓冲区布局不匹配。您的缓冲区在 RGB888 模式下为 128 x 256,因此每行只有 128 x 3 = 384 字节。   当 PITCH = 3200 时,LCDIFv2 每行推进 3200 字节而不是 384 字节,因此每行结束后都会远远超出有效数据。仅仅这一个不匹配就足以产生你看到的两种症状:每行错误的起始地址导致图像失真/倾斜,而每行获取大约 8 倍的(无效的)数据会使输出 FIFO 容量不足,从而引发下溢错误。   请使层描述符与缓冲区保持一致: CTRLDESCL3 (引脚间距) = 384 (0x180),即SMALL_LAYER_0_STRIDE = 128 * 3。 缓冲区基地址 64 字节对齐;保持不可缓存(您当前的设置是正确的),或者在显示之前清除 数据缓存。 此致, 加文 Re: RT1172 LT8918 LCD parallel LCDIFV2 small layer + background underrun 嗨@davidpspeedtech , 描述符现在是自洽的:CTRLDESCL5=0xD8000260(BPP=8=RGB888),CTRLDESCL3=0x300=768=256×3。你没看错。 但根本的不匹配仍然存在;只是被低时钟频率掩盖了。颜色“每行都改变,就像丢失了一个字节”就是证据:你的内存转储全是 0xFFFFFFFF ,而 Center Pixel 将一个像素读取为一个 32 位字——也就是说,内容仍然是 32 位/像素,而硬件获取了 3 个字节。白色在每个字节中都是 0xFF,因此会被隐藏;绿色会逐行漂移。 降低像素时钟“消除”欠载,但这并不是因为 OCRAM 速度慢(OCRAM 速度很快,片上内存不是瓶颈)。欠载取决于 LCDIFv2 作为 AXI 主设备的读取吞吐量。你将刷新率降低到 ~13.5 Hz (18.85 MHz ÷ (1000×1400)),使读取需求减少了 3-4 倍,因此停止了——但这低于面板的最低要求。 为了快速运行而不至于半倒,以下方法可能有所帮助: 切换到 ARGB8888 端到端: .pixelFormat=ARGB8888 ,BPP=4,步长=256×4=1024,缓冲区大小为 4 字节/像素,并确保像素写入代码写入 32 位字。两个原因:(a)它与您现有的 32 位内容匹配 → 修复绿色;(b)RM 指出打包的 RGB888 在总线上发出长度为 15 的突发信号(效率较低,更容易出现欠载),而 ARGB8888 是 32 位对齐的,具有干净的长度为 16 的突发信号。使用绿色转储进行验证:应该是一个干净的重复,而不是逐行漂移。 提高 LCDIFv2 b_clk(时钟根),将像素时钟恢复到 ≥22 Hz——这是提高速度的正确方法,而不是降低时钟频率。LCDIFv2 不使用 eDMA,因此“提高 DMA 优先级”不适用;可用的控制手段有 b_clk、突发长度、未完成的请求和 THRES 动态优先级阈值。 从 JD9365DA-H3 面板数据手册中获取时序——不要猜测——并将 LT8918 输入时序与之匹配。~200 水平消隐是可以接受的;更大的消隐可以缓解欠载,但会增加 htotal(需要更高的像素时钟),所以这是一个权衡——根本的解决方法是更高的 b_clk。垂直同步/垂直门廊必须与面板匹配,但对每行欠载影响很小。 此致, 加文 Re: RT1172 LT8918 LCD parallel LCDIFV2 small layer + background underrun 我是 NXP 的新手,所以一开始就应该正确设置,但实际上解决这个问题的简单方法是将 BUS_CLK_ROOT 增加到 200MHz,而不是默认的 24MHz。我完全忽略了这些默认设置。 之后不仅小窗口显示正常,整个屏幕也恢复正常,而且显示频率也达到了 60Hz(像素时钟频率约为 80MHz)。SDRAM 的设置当然更复杂,但 OCRAM 和 SDRAM 都受到总线时钟的限制,这很合理。 我还调整了其他一些时钟,或许这些调整是必要的。查看 EVK 示例以及时钟外设工具,也会发现他们为这些项目更改了这些内容。查看“clock_config.c”时很难注意到这一点。 总之,非常感谢!
View full article