Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
ADC Self-Test (Square Check) Support for S32K314 Hello,  In the UM Square Check documentation that an ADC self-test mechanism is mentioned. However, when reviewing the Safety Mechanisms, the ADC self-test is marked as NONE, and we are also unable to find this option in the Square Check (SCheck) configuration for the S32K314 package. Please advise how this feature can be enabled or configured? Priority: HIGH Safety_SW Re: ADC Self-Test (Square Check) Support for S32K314 Hello Team, Is there any update? Thanks Re: ADC Self-Test (Square Check) Support for S32K314 Hello Team, Is there any update? Thanks Re: ADC Self-Test (Square Check) Support for S32K314 Hello Radoslav, What is the different between S32K3E and S32Kxx? It seems both of them are the group of S32K396, S32K394, S32K376, S32K374, S32K366 and S32K364? Can you please point out where to find the S32K3E specific RM and HW Safety Manual ? Thanks Re: ADC Self-Test (Square Check) Support for S32K314 Hello @JasonTsengSG , my understanding is that these are new K3 derivatives with higher performance and some additional support for traction inverters and motor control (eTPU): S32K3E_SW_Architecture.docx You can find RM and SM via intranet e.g. here (sometimes instead K3E you can use just specific K396 derivative name to address this K3 sub-group): Zebra - Documents - S32K396 - All Documents Automotive Safety Software - Release_1.0.6 - All Documents Kind Regards, Radoslav Re: ADC Self-Test (Square Check) Support for S32K314 Thank you, Radoslav, for the clear explanation.
View full article
spi 示例代码 你好,我正在研究恩智浦提供的名为 "Spi_Transfer_S32K312 "项目中的 spi 示例代码。我想知道代码中每个函数的含义,能否告诉我头文件的位置? mingimin_0-1766466097344.png Re: spi example code 你好@mingimin 头文件位于项目目录中的 RTD → include 下。 此外,我建议您阅读 S32K3/S32M27x SPI 驱动器集成手册和 RTD 随附的用户手册。这些文件提供了有关驱动程序的详细信息,包括其限制、硬件和软件要求、使用指南和配置说明。它们有助于深入了解驾驶员的行为和能力。 例如,您可以在以下路径找到这些资源: C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32K3\RTD\Spi_TS_T40D34M50I0R0\doc 请注意,具体路径可能因 S32DS 版本和安装目录而异。 BR、VaneB
View full article
尝试运行 DMA 示例 Lpspi_Ip_Transfer_S32K344 尝试运行 DMA 示例 Lpspi_Ip_Transfer_S32K344,发现以下错误。 我们有 S32 Design Studio 版本 3.5 和 S32K3 实时驱动程序 AUTOSAR 4.4 版本 2.0.0。 在尝试编译时,我们收到了关于缺少包含文件的错误信息,例如 #include"StandardTypes.h". 请告知我们需要使用哪些版本才能通过 spi 支持 DMA。 jnaus_0-1765916948297.png Re: Trying to run DMA example Lpspi_Ip_Transfer_S32K344 你好@jnaus RTD 2.0.0 在 DMA 方面没有问题。 您只需在添加"Dma 后点击"更新代码" 即可。" Senlent_0-1765961640703.png
View full article
LPC1768+SSP0+GPDMAに問題あり SSP0 で DMACR を開いて BUF にデータを送信した後、DMACR がゼロにリセットされ、SSP0DR は変化し続けますが、BUF データは変更されないのはなぜでしょうか。割り込み中に DMACR を再度開こうとしましたが、BUF データにはまだ変化がありませんでした。 コード構成は次のとおりです。 #定義 SPI_RX_LEN 5386 外部U8 SPIRXBUF[SPI_RX_LEN]; void DMAInit_SPI_RX(U8 *destAddr, U32 len) { U32 パート1 = (長さ > 4095) ?4095 : 長さ; U32 パート2 = (長さ > 4095) ?(len - 4095) : 0;// 拆分传输(单道最大4095字节)   LPC_SC->PCONP |= (1 << 29); // 使用GPDMA時間钟 LPC_GPDMA->DMACConfig |= (1 << 0);//GPDMA を使用する LPC_GPDMA->DMACIntTCClear |= 0x01; // 清除道0传输完了标志 LPC_GPDMA->DMACIntErrClr |= 0x01; // 清除道0错误标志   // 链表项1:传输part1字节 lli[0].srcAddr= (U32)&LPC_SSP0->DR; // ソース:SPI0データ寄存器 lli[0].宛先アドレス= (U32)destAddr; // 目的:缓冲区開始 lli[0].コントロール= (part1 & 0x0FFF) // 传输大小(字节数) | (0x00 << 12) // 源突発大小 | (0x00 << 15) // 目的発行大小 | (0x00 << 18) //ソースデータ宽度 | (0x00 << 21) //目的データ宽度 | (0x00 << 26) //源地址不变(外设寄存器) | (0x01 << 27) //目的地址自增 | (1U << 31); // 使用中断   // 链表项2:传输part2字节(若必要) (パート2 > 0)の場合 { lli[0].nextLLI = (U32)&lli[1]; // 指向链表项2 lli[1].srcAddr= (U32)&LPC_SSP0->DR; lli[1].destAddr= (U32)(destAddr +part1); // 缓冲区偏移 lli[1].コントロール= (part2 & 0x0FFF) // 传输大小(字节数) | (0x00 << 12) // 源突発大小 | (0x00 << 15) // 目的発行大小 | (0x00 << 18) //ソースデータ宽度 | (0x00 << 21) //目的データ宽度 | (0x00 << 26) //源地址不变(外设寄存器) | (0x01 << 27) //目的地址自增 | (1U << 31); // 使用中断 lli[1].nextLLI= 0; // 结束链表 } そうでない場合、 { lli[0].nextLLI = 0; }   // 配置DMA通道0 LPC_GPDMACH0->DMACCConfig = 0; LPC_GPDMACH0->DMACCLLI = (U32)&lli[0]; // 链表開始地址 LPC_GPDMACH0->DMACCSrcAddr = lli[0].srcAddr;// ソース地址(SPI0 DR) LPC_GPDMACH0->DMACCDestAddr = lli[0].destAddr;// 目的地址 LPC_GPDMACH0->DMACCコントロール = lli[0].control;// 制御文字 LPC_GPDMACH0->DMACCConfig = (0x01 << 15) //中断错误 | (0x01 << 14) //終端计数中断 | (0x02 << 11) // 传输種類:外设到内存 | (0x00 << 6) //目的外设:保存器 | (0x01 << 1) // ソース外设:SSP0 RX(参考手册) | (0x01 << 0); // 道使い能   GPDMAEnabe(); }     void DMA_IRQHandler(void) { if(LPC_GPDMA->DMACIntTCStat & 0x01) // 通道0転送完了 { LPC_GPDMA->DMACIntTCClear = 0x01; // 清除标志 //SSPSlave_Init(); // RUN_LAMP_GLITTER; // LPC_SSP0->DMACR |= (1 << 0); // LPC_GPDMACH0->DMACCConfig |= (0x01 << 0); LPC_GPDMA->DMACConfig |= (1 << 0);//GPDMA を使用する 時間++; } if(LPC_GPDMA->DMACIntErrStat & 0x01) // 通道0错误 { LPC_GPDMA->DMACIntErrClr = 0x01; // 清除标志 } } void SSPSlave_Init(void) { LPC_SC->PCONP |= (1 << 21); /* 打开SSP電源 */ /************************************************************************ * 初期化SSPの通信方式、データ長は8bit、フレーム形式はSPI、SCKは低能率に設定されています。 * データは SCK の 2 番目の時間にサンプリングされ、ビットレートが設定されます。 **********************************************************************/ LPC_SSP0->CR0 = (0x00 << 😎 | /* SCR 設定 SPI ビット速度 */ (0x01 << 7) | /* CPHA 時間钟输出相位 */ (0x00 << 6) | /* CPOL 時間钟出力性 */ (0x00 << 4) | /* FRF 帧格式 00=SPI,01=SSI, */ /* 10=マイクロワイヤー,11=保留 */ (0x07 << 0); /* DSS データ長度,0000-0010= 保持 */ /* 0011=4 位、0111=8 位、1111=16 位*/ LPC_SSP0->CPSR = 2; /* 時間钟分周波数寄存器*/   LPC_SSP0->CR1 = (0x00 << 3) | /* SOD 从机输出禁能,0=允许 */ (0x01 << 2) | /* MS 主从选择,1=从机 */ (0x01 << 1) | /* SSE SSP 使用能,1=使用能 */ (0x00 << 0); /* LBM 回写モード */   sysTimeDlay(5); LPC_SSP0->DMACR |= (1 << 0);   } LPC17xx Re: LPC1768+SSP0+GPDMA some problem こんにちは@Lee_Lee DMA は「空の SSP FIFO を読み取っている」と思いますが、アクセス幅が正しくないため、データがメモリに正しく書き込まれていません。 現在何を設定していますか (0x00<<18)//ソースデータ宽度 (0x00<<21)//目的データ宽度 しかし、LPC では次のようになります。 SSPのDRレジスタは16ビットのレジスタである。 Harry_Zhang_0-1765963833177.png 8 ビット SPI モードを使用している場合でも、SSP0->DR への DMA アクセスは 16 ビット アクセスである必要があります。 DMAは実際にはメモリにデータを正しく書き込んでいない その結果、BUF は変更されません。 SO、ソースと des の幅を 16 に変更してみると CAN と思います。 BR ハリー
View full article
Rules - 2015 Registration requirements Minimum skills Previous experience with C or Java is needed. Previous experience with Linux systems is needed. Experience with embedded programming is a PLUS but not a MUST. Team one to three members from either Politechnica University of Bucharest or Military Technical Academy. Linux Embedded Challenge 2015
View full article
eIQ Toolkit for MCU - 入门实验室 eIQ Toolkit 使用直观的GUI(名为eIQ Portal)和开发工作流工具以及命令行主机工具选项(作为eIQ ML软件开发环境一部分)支持机器学习开发。 开发人员可以创建、优化、调试和导出ML模型,以及导入数据集和模型,快速训练并部署神经网络模型和ML工作负载。 eIQ Portal提供可直接集成到eIQ推理引擎(如TensorFlow Lite和TensorFlow Lite for Microcontrollers)的输出TensorFlow Lite模型。使用名为Model Runner的工具,eIQ Toolkit还可以生成运行时洞察,帮助优化i.MX RT和i.MX设备上的神经网络架构。 这些实验将介绍如何使用eIQ Portal。建议按照以下顺序进行: 数据导入实验室 Model Runner实验室 这些实验室为使用FRDM-MCXN947和i.MX RT1170-EVK而编写,但也可以使用其他支持eIQ的设备。 MCX N i.MX RT1050 i.MX RT1060 i.MX RT1064 i.MX RT1160 i.MX RT1170 i.MX RT1180 i.MX RT500 i.MX RT600 有关eIQ Toolkit中包含的Time Series Studio工具的详细信息,请参阅Time Series Studio实验指南。 为了 i.MX RT
View full article
LPC54018 クラッシュ問題 お客様は LPC54018J2M で問題を経験しています。 状況は次のように説明されます。 お客様が I2C 経由で Ether Back Up CODE ブロックに新しいバージョンをプログラムしてファームウェアを更新した後、再起動時に、BOOT CODE はまず Ether Back Up CODE に新しいファームウェアがあるかどうかを確認します。存在する場合、Ether CODE を上書きしてから実行します。 フラッシュメモリの配置 |-------------------------------------| 0x10000000 - 0x1000FFFF | ブートコード(64k) 10000| |-------------------------------------| 0x10010000 - 0x100fffff | イーサコード(960k) f0000| |-------------------------------------| 0x10100000 - 0x101effff | イーサバックアップコード(960k) f0000| |-------------------------------------| 0x101f0000 - 0x10200000 |予約済み(64k) 10000| |-------------------------------------| 少数のユニットでは、ファームウェアのアップデートが完了すると、一定期間ソフトウェアは正常に動作します。しかし、しばらくすると、コードが突然動かなくなってしまいました。このような場合、再プログラムや消去を試みてもシステムを回復することはできず、IC を交換する必要があります。 異常のある IC については、JTAG を使用してさらにテストを実行しました。最初は、サンプル コードをプログラムしても正常に実行されず、フラッシュ直後に IC が停止してしまいます。 upload_44c1df325efcbfd1bf742fc095949c9e.png お客様ソフトウェアの場合、ブート コードはフラッシュ メモリをチェックし、SPIFI 初期化中に停止します。 ただし、SDK_2.x_LPC54018J2M (バージョン 24.12) のサンプル コードを JTAG 経由でプログラムすると、IC は正常に動作し、その後のプログラミングも期待どおりに動作します。 異常な IC の場合、お客様コードを直接再プログラムしても正常な動作は回復しません。異常状態から回復するためには、まずサンプルコードをプログラムする必要があります。 お客様コードは現在、SDK 2.11 に基づいて開発されています。 正常な動作を復元するサンプルコードは SDK 24.12 からのものです。 可能であれば新しいバージョンにアップデートすることをお客様に提案しましたが、これには時間がかかる可能性があります。 したがって、ここでは、この問題の原因が SDK のバージョンに関連しているのか、メモリ構成を調整する必要があるのかについて説明します。 現在、JTAG 経由でデバイスを回復することは可能ですが、この問題の発生を完全に防ぐ方法を見つけたいと考えています。 LPC54xxx Re: LPC54018 Crash Issue こんにちは@ZRay ご投稿ありがとうございます! これはLPC54XXデバイスのエラッタに関連している可能性があり、エラッタシートLPC540xx_LPC54S0xxの機能的問題の説明3.8 ROM.1に記載されています。ブート失敗時にペリフェラルピンが構成または駆動されたままになります。 また、 MCUXpresso SDK リリース ノートを確認することをお勧めします。また、常に利用可能な最新バージョンの SDK を使用することをお勧めします。 あなたが言及したサンプル コードではピン構成が実行されましたか?
View full article
FS32K142 的电源问题 尊敬的恩智浦专家 本设计中使用的 MCU 是 FS32K142HFT0MLF。 我的问题是:这个设备可以用 3.3 V 电源供电吗,即 VDD = +3.3V? 期待您的回复。 顺颂商祺。 远 Re: Power supply issue with FS32K142 你好@Julián_AragónM 很高兴收到您的回复。 你的回答回答了我的问题。非常感谢。 顺祝商祺! 远 Re: Power supply issue with FS32K142 你好,@FAR1234、 S32K1 可以在 3.3V 电压下工作。它支持 2.7 V 至 5.5 V 的工作电压范围。这意味着它可以在 3.3 V 或 5 V 电压下运行,具体取决于您的设计要求。 有关 3.3 V 时的 5.3 直流电电气规格,请参阅 S32K1xx 数据表中的第 5.3 章。 致以最诚挚的问候, Julián
View full article
S32K5 SAFリリーススケジュール こんにちは、チーム お客様である PATAC が当社の S32K5 SAF を評価しています。彼らは、現在の S32K5 SAF では実際の CASE の要件を満たさない非常に限られた機能しか提供されていないことを知っています。SO彼らはS32K5 SAFの詳細なスケジュールを提供するよう求めています。 おおよそのリリース時間。 次のリリースではどの機能とモジュールがサポートされますか? ありがとう、そしてよろしく。 リチャード 優先度: 中 SAFETY_SW 出典: 直接お客様 Re: S32K5 SAF release schedule こんにちは@RaduBraga 、 これのアップデートはありますか? BR リチャード Re: S32K5 SAF release schedule こんにちは@RichardLiさん、 計画では、2026 年 7 月に K5 PRC をリリースし、すべての SAF モジュールの完全な機能をカバーすることを目指しています。 敬具、 ラドスラフ Re: S32K5 SAF release schedule こんにちは@RadoslavB 、 フィードバックありがとうございます。今年の1月末にリリース予定のSAF EARバージョンについて何か予定はありますか?ほとんどの機能がカバーされますか? BR リチャード Re: S32K5 SAF release schedule こんにちは@RichardLiさん、 今年の 1 月には EAR リリースはありません。 EAR 0.8.0 は、非常に限定された機能で 2025 年 12 月にリリースされましたが、7 月 26 日の PRC までは他に何も計画されていません。 敬具、 ラドスラフ
View full article
Example MPC5748G FlexCAN RXFIFO SDK PA RTM200 S32DS.Power.2017.R1 ******************************************************************************** Detailed Description: Configures the FlexCAN 0 to transmit and receive a CAN message  Baudrate to is set to 500kbps. In this config, RXFIFO is used to receive a messages. 16 filter elements are defined in the RXFIFO table. Both standard and extended IDs are used. MB10 is moreover used to receive a message with given standard ID. MB11 is used to transmit a message upon button press. The callback function is installed as well and is it called each time message is received in MB10, RXFIFO or message is transmitted. NOTE! Termination resistor (120Ohm) have to be placed on transceivers output             12V power supply must be connected. ------------------------------------------------------------------------------ Test HW: DEVKIT-MPC5748G Maskset: 0N78S Target : FLASH Fsys: 160 MHz PLL ******************************************************************************** General
View full article
Clarification needed for MK70 DDR control register 21 specification Hello all,  I am running into an issue with a MK70FX512VMJ12 controlling the DDR on a legacy board. We are using MQX. The issue comes from the following line in the bootloader: ddr->CR21 = 0x00060232; I assume that line sets the DDR_CR21 register (as described on the section 34.4.22 of the K70 reference manual) to 0x00060236. The reference manual states that the register field is split into 2 fields. 31–16 MR1DAT0 Data to program into memory mode register 1 for chip select . 15–0 MR0DAT0 Data to program into memory mode register 0 for chip select . Most DDR manufacturers call those registers Mode Register (MR or MRS) and Extended Mode Register (EMR1, EMR2, EMR3). Should I assume that data from field 15-0 will be written by the state machine to the DDR's MR (Mode Register) and data from field 31-16 to EMR? I suspect, and need confirmation from support engineers, that the state machine issues the necessary control signals irrespective of the values set in the DDR_CR21. That is because considering the data I write on bits 31-16 of the DDR_CR21 (0x0006) which assigns 000 to the 3 MSB bits, for proper operation those should be set to 001 as required by DDR specifications. Note from DDR specs: "The extended mode register is written by asserting LOW on CS#, RAS#, CAS#, WE#, BA1 and HIGH on BA0, while controlling the states of address pins A0 ~ A12."   dodocolby_0-1765462377582.png The settings needed for BA2, BA1, and BA0 are '001', while the values I write to DDR_CR21 is '000'. Does the DDR SDRAM controller overwrites those values set in DDR_CR21 to the correct ones? Thank you, dodocolby Re: Clarification needed for MK70 DDR control register 21 specification Hello @dodocolby , Thanks for using our community. I have noticed your question. I need some time to research before getting back to you. If there are any updates during this period, please feel free to share them anytime. BR Celeste Re: Clarification needed for MK70 DDR control register 21 specification Hello @dodocolby , Could you please let me know the mask set of your chip?  As far as I know, mask set 3N96B part has Errata e10521.   Also, what version of MQX are you using? I understand that MQX 4.x has an issue concerning the SIM_MCR DDRDQSDIS reset state, this bit needs to be cleared.   Although MQX is no longer supported, I noticed that in previous cases they all used  ddr->CR21 = 0x00040232;  instead of the value you mentioned: 0x00060232.   For example, K70 DDR2 read failure with increasing temperature - NXP Community  K70 DDR2 temperature affect read data - NXP Community   That’s why I’m asking the questions above.   BR Celeste Re: Clarification needed for MK70 DDR control register 21 specification Hello, I am using MQX 4.2 and 5N96B. dodocolby_0-1765990752157.jpeg We implemented "K70 DDR2 read failure with increasing temperature - NXP Community K70 DDR2 temperature affect read data - NXP Community", and it seems the device is not sensitive to temperature anymore. Thank you   Re: Clarification needed for MK70 DDR control register 21 specification Hello @dodocolby , Yes, the reason I referenced those two links is because I noticed the code they mentioned uses ddr->CR21 = 0x00040232 instead of 60232 . I just wanted to confirm that point, as I don’t have access to the MQX code on my side, it’s no longer supported. In addition, I’ve already reached out to the internal team to help address your question further. I’ll let you know as soon as I hear back from them. Thanks for your understanding. BR Celeste Re: Clarification needed for MK70 DDR control register 21 specification Hello @dodocolby , Sorry for the long wait. I haven’t received any updates from our internal team yet, likely due to the Christmas holidays. Please note that our response time may be longer than usual because of the holiday periods across the EMEA and AMEC time zones. I will also be on leave starting tomorrow until January 5th. If this matter is urgent, you may consider creating a new case and mentioning this link. Other colleagues will be able to locate my internal contact through this case, and there’s a chance you might receive an update before January 5th. If it’s not urgent, I will continue to follow up once I return. We truly appreciate your understanding and patience. Have a pleasant day! BR Celeste Re: Clarification needed for MK70 DDR control register 21 specification Hello @dodocolby , Hope you are great. I am sorry for the late reply. Please see the reply from our internal team: " Because the DDR controller can support many different memory sizes and configurations with different total numbers of address pins, the mode register data loaded into the MRnDATA fields should not include the bank address values. The controller will automatically drive the correct bank address value (along with the other control signals for the mode register write command). The register value only needs to include the address line portion. " Hope it helps. Please let me know if you have other questions. BR Celeste Re: Clarification needed for MK70 DDR control register 21 specification Thank you for the confirmation.
View full article
The RT speech recognition system based on VIT to obtain weather information 1.  Abstract NXP EdgeReady solution can use RT106/5 S/L/A/F to achieve speech recognition, but the relevant support software libraries for the RT4-bit series are limited to the S/L/A/F series, if you want to use normal RT chips, how to achieve speech recognition functions? NXP officially launched the VIT software package in the SDK, which can support RT1060, RT1160, RT1170, RT600, RT500 to achieve SDK-based speech recognition functions. For the acquisition of weather information, usually customer can connect with a third-party platform or the cloud weather API, using http client method to access directly, the current weather API platforms, you can register it, then call the API directly, so you can use the RT SDK lwip socket client method to call the corresponding weather API, to achieve real-time specific geographical location weather forecast data.     This article will use MIMXRT1060-EVK to implement customer-defined wake-up word(WW) and voice recognition word recognition(VC) based on SDK VIT lib, and LWIP socket client to achieve real-time weather information acquisition in Shanghai, then print it to the terminal, this article mainly use the print to share the weather information, for the sound broadcasts, it also add the simple method to broadcast the fixed sound with mp3 audio data, but for the freely sound broadcast, it may need to use real-time TTS function, which is not added now.     The system block diagram of this document is as follows:   1.jpg Fig 1 System Block diagram The VIT custom wake-up word of this system is "小恩小恩", and after waking up, one of the following recognition words can be recognized: ”开灯”("Turn on the lights"),“关灯”("Turn off the lights"),”今天天气”("Today's weather"),“明天天气”("Tomorrow's Weather"),“后天天气”("The day after tomorrow's weather"). Turn on the light or Turn off the lights , that is to control  the external LED red light on the EVK board. ”今天天气” gets today’s weather forecast, it is in the following format:                     "date": "2022-05-27",                     "week": "5",                     "dayweather": "阴",                     "nightweather": "阴",                     "daytemp": "28",                     "nighttemp": "21",                     "daywind": "东南",                     "nightwind": "东南",                     "daypower": "≤3",                     "nightpower": "≤3" “明天天气”,“后天天气” are the same format, but it is 1-2 days after the date of today. To get the weather data, the MIMXRT1060-EVK board needs to connect the network to achieve the acquisition of the Gaode Map(restapi.amap.com) Weather API data. 2.  Related preparations 2.1 Weather API Platform     At present, there are many third-party platforms that can obtain weather on the Internet for Chinese, such as: Baidu Intelligent Cloud, Baidu Map API, Huawei cloud platform, Juhe weather, Gaode Map API, and so on. This article tried several platform, the test results found: Baidu intelligent cloud, the number of daily free calls is small, the need for real-time synthesis of AK, SK, cumbersome to call; Baidu Map API needs to upload ID card information; Several others have a similar situation. In the end, the Gaode Map API with convenient registration, many daily calls and relatively full feedback weather data information was selected.     Here, we mainly talk about the Gaode Map API usage, the link is: https://lbs.amap.com/api/webservice/guide/api/weatherinfo Create the account and the API key, then add the relevant parameters to implement the call of the weather API, the application for API Key is as follows: 2.jpg Fig 2 Gaode map API key The following diagram shows the call volume:   3.jpg Fig 3 Gaode Map API call volume This is the API calling format:   4.jpg Fig 4 Weather API calling parameters So, the full Gaode Map API link should like this: https://restapi.amap.com/v3/weather/weatherInfo?key=xxxxxxx&city=xxx&extensions=all&output=JSON If need to test the Shanghai weather, city code is 310000. 2.2 Postman test weather API     Postman is an interface testing tool, when doing interface testing, Postman is equivalent to a client, it can simulate various HTTP requests initiated by users, send the request data to the server, obtain the corresponding response results, and verify whether the result data in the response matches the expected value. Postman download link: https://www.postman.com/   After finding the proper weather API platform and the calling link, use the postman do the http GET operation to capture the weather data, refer to the Fig 4, fill the related parameters to the postman: 5.jpg Fig 5 Postman call weather API Send Get command, we can find the weather information in the position 7, the complete all information is: {     "status": "1",     "count": "1",     "info": "OK",     "infocode": "10000",     "forecasts": [         {             "city": "上海市",             "adcode": "310000",             "province": "上海",             "reporttime": "2022-05-27 17:34:12",             "casts": [                 {                     "date": "2022-05-27",                     "week": "5",                     "dayweather": "阴",                     "nightweather": "阴",                     "daytemp": "28",                     "nighttemp": "21",                     "daywind": "东南",                     "nightwind": "东南",                     "daypower": "≤3",                     "nightpower": "≤3"                 },                 {                     "date": "2022-05-28",                     "week": "6",                     "dayweather": "小雨",                     "nightweather": "中雨",                     "daytemp": "24",                     "nighttemp": "20",                     "daywind": "东南",                     "nightwind": "东南",                     "daypower": "≤3",                     "nightpower": "≤3"                 },                 {                     "date": "2022-05-29",                     "week": "7",                     "dayweather": "大雨",                     "nightweather": "小雨",                     "daytemp": "23",                     "nighttemp": "20",                     "daywind": "南",                     "nightwind": "南",                     "daypower": "≤3",                     "nightpower": "≤3"                 },                 {                     "date": "2022-05-30",                     "week": "1",                     "dayweather": "小雨",                     "nightweather": "晴",                     "daytemp": "27",                     "nighttemp": "20",                     "daywind": "北",                     "nightwind": "北",                     "daypower": "≤3",                     "nightpower": "≤3"                 }             ]         }     ] } We can see, it can capture the continuous 4 days information, with this information, we can get the weather information easily. From the postman, we also can see the Get code, like this: 6.jpg Fig 6 postman API HTTP code     With this API which already passed the testing, it can capture the complete weather information, here, we can consider adding the working http API to the MIMXRT1060-EVK code.    2.3 VIT custom commands     From the maestro code of the RT1060 SDK, we can know that the SDK already supports the VIT library, what is VIT?     VIT's full name: Voice Intelligent Technology, the library provides voice recognition services designed to wake up and recognize specific commands, control IOT, and the smart home. 7.jpg Fig 7 VIT system block diagram     In NXP RT1060 SDK code, the generated wake word and command word have been provided and placed in the VIT_Model.h file. If in the customer's project, how to customize the wake word and command word? With the NXP's efforts, we have made a web page form for customers to choose their own command, and then generate the corresponding VIT_Model.h file for code to call. VIT command word generation web page is: https://vit.nxp.com/#/home     Login the NXP account, choose the RT chip partn umber, wakeup word, voice command. Please note, the current supported RT chip is: RT1060,RT1160,RT1170,RT600,RT500 The following is the example for generating wakeup word and voice command:   8.jpg Fig 8 Custom VIT configuration 9.jpg Fig 9 generated result Download the generated model, you can get VIT_Model_cn.h, open to see the command word information and related model data stored in the const PL_MEM_ALIGN (PL_UINT8 VIT_Model_cn[], VIT_MODEL_ALIGN_BYTES) array, the command word information is as follows: WakeWord supported : " 小恩 小恩 " Voice Commands supported     Cmd_Id : Cmd_Name       0    : UNKNOWN       1    : 开灯       2    : 关灯       3    : 今天 天气       4    : 明天 天气       5    : 后天 天气 Use the RT1060 SDK maestro_record demo to test this custom command result:   10.jpg Fig 10 Custom Wakeup word and voice command test From the test result, we can see, both the wakeup word and voice command is detected. 3 Software code 3.1 LWIP socket client code capture weather API From chapter 2.2, we have been able to obtain the weather API and through testing, we can successfully achieve weather acquisition, so we need to add relevant commands in combination with the needs of our own system. For the acquisition of the weather API, the lwip code based on the RT1060 SDK is in the form of socket client. The relevant code is as follows: #define PORT 80 #define IP_ADDR "59.82.9.133" uint8_t get_weather[]= "GET /v3/weather/weatherInfo?key=xxx&city=310000&extensions=all&output=JSON HTTP/1.1\r\nHost: restapi.amap.com\r\n\r\n\r\n\r\n"; if (sys_thread_new("weather_main", weathermain_thread, NULL, HTTPD_STACKSIZE, HTTPD_PRIORITY) == NULL) LWIP_ASSERT("main(): Task creation failed.", 0); static void weathermain_thread(void *arg) { static struct netif netif; ip4_addr_t netif_ipaddr, netif_netmask, netif_gw; ethernetif_config_t enet_config = { .phyHandle = &phyHandle, .macAddress = configMAC_ADDR, }; LWIP_UNUSED_ARG(arg); mdioHandle.resource.csrClock_Hz = EXAMPLE_CLOCK_FREQ; IP4_ADDR(&netif_ipaddr, configIP_ADDR0, configIP_ADDR1, configIP_ADDR2, configIP_ADDR3); IP4_ADDR(&netif_netmask, configNET_MASK0, configNET_MASK1, configNET_MASK2, configNET_MASK3); IP4_ADDR(&netif_gw, configGW_ADDR0, configGW_ADDR1, configGW_ADDR2, configGW_ADDR3); tcpip_init(NULL, NULL); netifapi_netif_add(&netif, &netif_ipaddr, &netif_netmask, &netif_gw, &enet_config, EXAMPLE_NETIF_INIT_FN, tcpip_input); netifapi_netif_set_default(&netif); netifapi_netif_set_up(&netif); PRINTF("\r\n************************************************\r\n"); PRINTF(" TCP client example\r\n"); PRINTF("************************************************\r\n"); PRINTF(" IPv4 Address : %u.%u.%u.%u\r\n", ((u8_t *)&netif_ipaddr)[0], ((u8_t *)&netif_ipaddr)[1], ((u8_t *)&netif_ipaddr)[2], ((u8_t *)&netif_ipaddr)[3]); PRINTF(" IPv4 Subnet mask : %u.%u.%u.%u\r\n", ((u8_t *)&netif_netmask)[0], ((u8_t *)&netif_netmask)[1], ((u8_t *)&netif_netmask)[2], ((u8_t *)&netif_netmask)[3]); PRINTF(" IPv4 Gateway : %u.%u.%u.%u\r\n", ((u8_t *)&netif_gw)[0], ((u8_t *)&netif_gw)[1], ((u8_t *)&netif_gw)[2], ((u8_t *)&netif_gw)[3]); PRINTF("************************************************\r\n"); sys_thread_new("weather", weather_thread, NULL, DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO); vTaskDelete(NULL); } static void weather_thread(void *arg) { int sock = -1,rece; struct sockaddr_in client_addr; char* host_ip; ip4_addr_t dns_ip; err_t err; uint32_t *pSDRAM= pvPortMalloc(BUF_LEN);// host_ip = HOST_NAME; PRINTF("host name : %s , host_ip : %s\r\n",HOST_NAME,host_ip); while(1) { sock = socket(AF_INET, SOCK_STREAM, 0); if (sock < 0) { PRINTF("Socket error\n"); vTaskDelay(10); continue; } client_addr.sin_family = AF_INET; client_addr.sin_port = htons(PORT); client_addr.sin_addr.s_addr = inet_addr(host_ip); memset(&(client_addr.sin_zero), 0, sizeof(client_addr.sin_zero)); if (connect(sock, (struct sockaddr *)&client_addr, sizeof(struct sockaddr)) == -1) { PRINTF("Connect failed!\n"); closesocket(sock); vTaskDelay(10); continue; } PRINTF("Connect to server successful!\r\n"); write(sock,get_weather,sizeof(get_weather)); while (1) { rece = recv(sock, (uint8_t*)pSDRAM, BUF_LEN, 0);//BUF_LEN if (rece <= 0) break; memcpy(weather_data.weather_info, pSDRAM,1500);//max 1457 } Weather_process(); memset(pSDRAM,0,BUF_LEN); closesocket(sock); vTaskDelay(10000); } }  3.2 VIT detect customer command code    Put the generated VIT_Model_cn.h to the maestro_record folder path:   vit\RT1060_CortexM7\Lib    The specific wake word and voice command related code can be viewed from the code vit_pro.c, mainly involving function is: int VIT_Execute(void *arg, void *inputBuffer, int size) The code is modified as follows, mainly to record the wake and wake word number, for specific function control, the command directly controlled here is the local "开灯:turn on the light", "关灯:turn off the light" command, as for the weather command needs to call the socket client API, so in the main lwip call area combined with the command word recognition number to call: if (VIT_DetectionResults == VIT_WW_DETECTED) { PRINTF(" - WakeWord detected \r\n"); weather_data.ww_flag = 1; //kerry } else if (VIT_DetectionResults == VIT_VC_DETECTED) { // Retrieve id of the Voice Command detected // String of the Command can also be retrieved (when WW and CMDs strings are integrated in Model) VIT_Status = VIT_GetVoiceCommandFound(VITHandle, &VoiceCommand); if (VIT_Status != VIT_SUCCESS) { PRINTF("VIT_GetVoiceCommandFound error: %d\r\n", VIT_Status); return VIT_Status; // will stop processing VIT and go directly to MEM free } else { PRINTF(" - Voice Command detected %d", VoiceCommand.Cmd_Id); weather_data.vc_index = VoiceCommand.Cmd_Id;//kerry 1:ledon 2:ledoff 3:today weather 4:tomorrow weather 5:aftertomorrow weather if(weather_data.vc_index == 1)//1 { GPIO_PinWrite(GPIO1, 3, 1U); //pull high PRINTF(" led on!\r\n"); } else if(weather_data.vc_index == 2)//2 { GPIO_PinWrite(GPIO1, 3, 0U); //pull low PRINTF(" led off!\r\n"); } // Retrieve CMD Name: OPTIONAL // Check first if CMD string is present if (VoiceCommand.pCmd_Name != PL_NULL) { PRINTF(" %s\r\n", VoiceCommand.pCmd_Name); } else { PRINTF("\r\n"); } } }  3.3 Voice recognize weather information    In the weather_thread while, check the wakeup word and voice command, if meet the requirement, then create the socket connection, write the API and capture the weather data.   The related code is: while(1) { //add the command request, only cmd == weather flag, then call it. if((weather_data.ww_flag == 1)) { if(weather_data.vc_index >= 3) { // create connection //write API and read API Weather_process(); } memset(weather_data.weather_info, 0, sizeof(weather_data.weather_info)); weather_data.ww_flag = 0; weather_data.vc_index = 0; } vTaskDelay(10000); } void Weather_process(void) { char * datap, *datap1; datap = strstr((char*)weather_data.weather_info,"date"); if(datap != NULL) { memcpy(today_weather, datap,184);//max 1457 if(weather_data.vc_index == 3) { PRINTF("\r\n*******************today weather***********************************\n\r"); PRINTF("%s\r\n",today_weather); return; } } else return; datap1 = strstr(datap+4,"date"); if(datap1 != NULL) { memcpy(tomorr_weather, datap1,184);//max 1457 if(weather_data.vc_index == 4) { PRINTF("\r\n*******************tomorrow weather*******************************\n\r"); PRINTF("%s\r\n",tomorr_weather); return; } } else return; datap = strstr(datap1+4,"date"); if(datap != NULL) { memcpy(aftertom_weather, datap,184);//max 1457 if(weather_data.vc_index == 5) { PRINTF("\r\n*******************after tomorrow weather**************************\n\r"); PRINTF("%s\r\n",aftertom_weather); } } else return; }   Function Weather_process is used to refer to the voice recognized weather number to get the related date’s weather, and printf it. 4 Test result  the test result video: (view in My Videos) Print the log results as shown in Figure 11, after testing, you can see that the wakeup word and voice command can be successfully recognized, in the recognition of word sequence numbers 3, 4, 5 is the weather acquisition, you can successfully call the lwip socket client API, successfully obtain weather information and printf it.   11.jpg Fig 11 system test print result  evkmimxrt1060_maestro_weather_backup.zip is the project without sound playback, weather information will print to the terminal! 5 Meet issues conclusion 5.1 LWIP failed to get weather    When creating the code, call the postman provided http code: GET /v3/weather/weatherInfo?key=8f777fc7d867908eebbad7f96a13af10& city=310000& extensions=all& output=JSON HTTP/1.1 Host: restapi.amap.com    Add it to the socket API function: uint8_t get_weather[]= "GET /v3/weather/weatherInfo?key=xxx&city=310000&extensions=all&output=JSON HTTP/1.1\r\nHost: restapi.amap.com\r\n\r\n\r\n\r\n";    The test result is:   12.jpg Fig 12 socket weather API return issues     We can see, server connection is OK, http also return back the data, but it report the parameter issues, after checking, we use the postman C code, and put it to the get_weather: uint8_t get_weather[]= "GET /v3/weather/weatherInfo?key=xxx&city=310000&extensions=all&output=JSON HTTP/1.1\r\nHost: restapi.amap.com\r\n\r\n\r\n\r\n"; Then, it can capture the weather data, the same as postman test result. 5.2 VIT LWIP merger memory is not enough     After combining the maestro_record and lwip socket code together, compile it, it will meet the DTCM memory overflow issues. 13.jpg Fig 13 memory overflow After optimize, still meet the DTCM overflow issues, so, at last, choose to reconfigure the FlexRAM: OCRAM 192K, DTCM 256K, ITCM 64K Compile it, and the memory overflow issues disappear:   14.jpg Fig 14 FlexRAM recofiguration 5.3 Print Chinese word in tera    Directly use teraterm, when the weather API returns the Chinese word, the print out information is the garbled code, and then after the following configuration, to achieve Chinese printing: Setup  ->  Terminal Locale    : american->chinese Codepage : 65001 ->936 15.jpg Fig 15 Tera Term Chinese word print In summary, after various data collection and problem solving, in MIMXRT1060-EVK board  combined with the official SDK complete the function of customizing VIT voice commands to obtain real-time weather and local control.So, even if the ordinary RT series which is not S/L/A/F series, you also can use VIT to implement speech recognition functions. 6 Add the sound broadcast    This chapter mainly gives the method how to add the sound broadcast with the mp3 video data which is stored in the memory, but to the realtime weather data playback, it is not very freely, it needs to check the weather data, and use the video mp3 data lib get the correct mp3 data, as it is not the online TTS method.     So, here, just share one example add the sound broadcast, eg: WW : “小恩小恩”    ->   “小恩来了,请吩咐!” VC  :“今天天气”   ->   “温度32.1度” VC playback is fixed now, if need to play real data, it needs to generate the mp3 voice data lib, then according to the feedback weather information, to generate the correct weather mp3 data array, and play it, as this is a little complicated, but not difficult, so here, just use one fixed sound give an example of it. 6.1 MP3 playback audio data preparation     For audio broadcasting which need to convert the Chinese word into MP3 files, you can use some online speech synthesis software, here use Baidu online speech synthesis function, you can view the previous article, chapter 2.2.2 online speech synthesis: https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT106L-S-voice-control-system-based-on-the-Baidu-cloud/ta-p/1363295     If use the Baidu online speech synthesis generated mp3 file to convert to the c array directly, it will meet the first audio play issues, so, here we use the Audacity to convert the mp3 file, the convert configuration is like this: 16.jpg  Fig 16 Audacity convert configuration     After the regeneration of mp3, you can use xxd .exe to convert the mp3 file to an array of C files, and then put it into RT-related memory or external flash , xxd .exe can be found at the following link: https://github.com/baldram/ESP_VS1053_Library/issues/18 The convert command like this: xxd -i your-sound.mp3 ready-to-use-header.c Convert the xiaoencoming.mp3 and temptest.mp3 file to the C array, then modify the data to the C file, save file as: xiaoencoming.h and temptest.h. Here, take xiaoencoming.c as an example: #define XIAOEN_MP3_SIZE  6847 unsigned char xiaoencoming_mp3[XIAOEN_MP3_SIZE] = {   0x49, 0x44, 0x33, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x54, 0x58, …   0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55 }; unsigned int xiaoencoming1_mp3_len = XIAOEN_MP3_SIZE;//6847; Until now, the playback audio data is finished.     Copy xiaoencoming.h and temptest.h to project path: evkmimxrt1060_maestro_weather_mp3\source 6.2 Play the MP3 data from memory    Here, share the related code. 6.2.1 app_streamer.c added code    #include "xiaoencoming.h" #include "temptest.h" void *voice_inBuf = NULL; void *voice_outBuf = NULL; status_t STREAMER_file_Create(streamer_handle_t *handle, char *filename, int eap_par) { STREAMER_CREATE_PARAM params; OsaThreadAttr thread_attr; int ret; ELEMENT_PROPERTY_T prop; MEMSRC_SET_BUFFER_T inBufInfo = {0}; SET_BUFFER_DESC_T outBufInfo = {0}; PRINTF("Kerry test begin!\r\n"); if(filename == "temptest.mp3") inBufInfo = (MEMSRC_SET_BUFFER_T){.location = (int8_t *)temptest_mp3, .size = TEMPtest_MP3_SIZE}; else if(filename == "xiaoencoming.mp3") inBufInfo = (MEMSRC_SET_BUFFER_T){.location = (int8_t *)xiaoencoming_mp3, .size = XIAOEN_MP3_SIZE}; /* Create message process thread */ osa_thread_attr_init(&thread_attr); osa_thread_attr_set_name(&thread_attr, STREAMER_MESSAGE_TASK_NAME); osa_thread_attr_set_stack_size(&thread_attr, STREAMER_MESSAGE_TASK_STACK_SIZE); ret = osa_thread_create(&msg_thread, &thread_attr, STREAMER_MessageTask, (void *)handle); osa_thread_attr_destroy(&thread_attr); if (ERRCODE_NO_ERROR != ret) { return kStatus_Fail; } /* Create streamer */ strcpy(params.out_mq_name, APP_STREAMER_MSG_QUEUE); params.stack_size = STREAMER_TASK_STACK_SIZE; params.pipeline_type = STREAM_PIPELINE_MEM; params.task_name = STREAMER_TASK_NAME; params.in_dev_name = "buffer"; params.out_dev_name = "speaker"; handle->streamer = streamer_create(&params); if (!handle->streamer) { return kStatus_Fail; } prop.prop = PROP_DECODER_DECODER_TYPE; prop.val = (uintptr_t)DECODER_TYPE_MP3; ret = streamer_set_property(handle->streamer, prop, true); if (ret != STREAM_OK) { streamer_destroy(handle->streamer); handle->streamer = NULL; return kStatus_Fail; } prop.prop = PROP_MEMSRC_SET_BUFF; prop.val = (uintptr_t)&inBufInfo; ret = streamer_set_property(handle->streamer, prop, true); if (ret != STREAM_OK) { streamer_destroy(handle->streamer); handle->streamer = NULL; return kStatus_Fail; } handle->audioPlaying = false; error: PRINTF("End STREAMER_file_Create\r\n"); PRINTF("Kerry test end!\r\n"); return kStatus_Success; } The code implements the thread build, creates a streamer, defines it as playing from memory, decodes the properties for MP3, and specifies an array of MP3 files in memory. Specify a different array of mp3 files in memory based on the calling file name. 6.2.2 cmd.c added code void play_file(char *filename, int eap_par) { STREAMER_Init(); int ret = STREAMER_file_Create(&streamerHandle, filename, eap_par); if (ret != kStatus_Success) { PRINTF("STREAMER_file_Create failed\r\n"); goto file_error; } STREAMER_Start(&streamerHandle); PRINTF("Starting playback\r\n"); file_playing = true; while (streamerHandle.audioPlaying) { osa_time_delay(100); } file_playing = false; file_error: PRINTF("[play_file] Cleanup\r\n"); STREAMER_Destroy(&streamerHandle); osa_time_delay(100); } Play file, it calls the STREAMER_file_Create API function, start play, and wait the play finished, then release the STREAMER. shellRecMIC API function add the VIT recorded flag, which is used to play feedback audio file. static shell_status_t shellRecMIC(shell_handle_t shellHandle, int32_t argc, char **argv) { … //kerry PRINTF("Kerry MP3 stream data test!\r\n"); PRINTF("---weather_data.ww_flag =%d--\r\n ", weather_data.ww_flag); PRINTF("---weather_data.vc_inde =%d--\r\n ", weather_data.vc_index); PRINTF("---weather_data.mp3_flag =%d--\r\n ", weather_data.mp3_flag); if(weather_data.ww_flag == 1) { play_file("xiaoencoming.mp3", 0); } if(weather_data.vc_index == 3) { play_file("temptest.mp3", 0); } if(weather_data.mp3_flag != 0) { weather_data.ww_flag = 0; weather_data.vc_index = 0; } weather_data.mp3_flag = 0; /* Delay for cleanup */ osa_time_delay(100); return kStatus_SHELL_Success; } If detect the Wakeup Word: “小恩小恩”, play feedback audio: “小恩来了请吩咐”. If detect the voice command: “今天天气”, play feedback audio: “温度32.1度”, please note, this playback just an example, it is the fixed audio, you also can create audio word lib, then according to the received weather information, combine the related word audio together, then playback it. This is a little complicated, but not difficult. So, if need to play the free audio, also can consider the online TTS method in real time. 6.2.3 VIT WW and VC flag VIT_Execute function int VIT_Execute(void *arg, void *inputBuffer, int size) { … if (VIT_DetectionResults == VIT_WW_DETECTED) { PRINTF(" - WakeWord detected \r\n"); weather_data.ww_flag = 1; //kerry weather_data.mp3_flag = 1; } else if (VIT_DetectionResults == VIT_VC_DETECTED) { // Retrieve id of the Voice Command detected // String of the Command can also be retrieved (when WW and CMDs strings are integrated in Model) VIT_Status = VIT_GetVoiceCommandFound(VITHandle, &VoiceCommand); if (VIT_Status != VIT_SUCCESS) { PRINTF("VIT_GetVoiceCommandFound error: %d\r\n", VIT_Status); return VIT_Status; // will stop processing VIT and go directly to MEM free } else { PRINTF(" - Voice Command detected %d", VoiceCommand.Cmd_Id); weather_data.vc_index = VoiceCommand.Cmd_Id;//kerry 1:ledon 2:ledoff 3:today weather 4:tomorrow weather 5:aftertomorrow weather weather_data.mp3_flag = 2; if(weather_data.vc_index == 1)//1 { GPIO_PinWrite(GPIO1, 3, 1U); //pull high PRINTF(" led on!\r\n"); } else if(weather_data.vc_index == 2)//2 { GPIO_PinWrite(GPIO1, 3, 0U); //pull low PRINTF(" led off!\r\n"); } // Retrieve CMD Name: OPTIONAL // Check first if CMD string is present if (VoiceCommand.pCmd_Name != PL_NULL) { PRINTF(" %s\r\n", VoiceCommand.pCmd_Name); } else { PRINTF("\r\n"); } } } return VIT_Status; } Until now, all the code is added. 6.2.4  playback audio test result     This is the audio playback test result: (view in My Videos)   17.jpg Fig 17 playback audio log   From the test result, we can see, we also can use the mp3 data which is stored in the memory and play it as audio playback.   The code project is: evkmimxrt1060_maestro_weather_mp3.zip. i.MXRT 106x
View full article
MCUXpresso Config Tools : Clocks Toolの使い方 (日本語ブログ) 目次 はじめに Clocks Toolはどのような場面で活用するのか Config Toolsのインストール Clocks Toolの画面構成 Clocks Toolを使うための基本用語 デモンストレーション:CPUコア・クロック設定を変更し、LEDの点滅速度を変更する おまけ1 - 既にプリセットとして、クロック設定が準備されている おまけ2 - 自動で初期化コードを生成した設定値はどこに はじめに  MCUXpressoは、NXPが提供するマイコン開発用ソフトウェアプラットフォームで、MCUXpresso IDEに加えて、MCUXpresso for VSC (Visual Studio Code)や、 ペリフェラル設定を支援するConfig Toolsも提供しています。  Config Toolsは、ピン設定を行う「Pins Tool」や、クロック構成を設定する「Clocks Tool」などで構成されており、マイコン周辺の初期設定をGUI上で直感的に分かりやすく行える点が特長です。本記事では、この中から クロック設定を担当する「Clocks Tool」 に焦点を当てて解説します。なお「Pins Tool」の使い方については、以下の記事をご参考ください。 MCUXpresso Config Tools : Pins Toolの使い方 (日本語ブログ) クロック設定は、マイコンの性能・消費電力・各ペリフェラルの動作に直結する重要な要素です。一方で、クロックツリーは構成が複雑で、「どのクロックがどこで使われているのか分かりにくい」と感じる方も多いのではないでしょうか。Clocks Toolを使うことで、クロックソースや分周設定、各ペリフェラルへのクロック供給状況を可視化しながら設定・確認できます。また設定内容に応じた初期化コードを自動生成することもできます。 MCUXpresso IDEをインストールした場合には、Config Toolsも一緒にインストールされるため、IDEに内蔵された機能として利用可能です。一方、近年組み込み開発においても利用が広がっている Visual Studio Code(VSC)環境では、MCUXpresso関連の拡張機能をインストールすることで、同様にConfig Tools(Clocks Toolを含む)を利用できます。Config Toolsの機能自体は、IDE版とVSC版で大きな違いはありません。 本記事では、VS Code環境におけるConfig Toolsのインストール方法から、ツールの使い方を説明し、最後にFRDM-MCXN947を用いて、実際にClocks Tool内でCPUクロック設定を変更し、LEDの点滅速度を変えるデモンストレーションを紹介します。 動画でもご覧いただきます。視聴はこちらのリンク MCUXpresso Clocks Toolの使い方(VS Code環境)から Clocks Toolはどのような場面で活用するのか? 既存の内部クロック設定(クロック・ツリー)を確認したいとき 各モジュールへの動作周波数を調整・最適化したいとき 低消費電力を意識して、クロック周波数を落とす構成を検討したいとき Config Toolsのインストール VS Code環境におけるConfig Toolsのインストール方法について解説します。 ※MCUXpresso for VS Codeのインストールがお済みでない方はこちらのブログをご参照ください。 MCUXpresso for VSCとSDKのインストール (日本語ブログ) VS Codeを起動後、左側のパネルからMCUXpressoを選択し、Quick Start PanelよりOpen MCUXpresso Installerをクリックしてください。 Kogiso_0-1778572125810.png Installerが立ち上がりますので、MCUXpresso Configuration Toolsを選択し、右上のInstallをクリックしてください。 (今回のブログではMCUXpresso Config Tools v26.03 をInstallしています) Kogiso_1-1779262222580.png インストールの開始と同時にMyNXPへのログインを求められます。 Kogiso_2-1778572191255.png ログインの後、License Agreementが表示されますので内容をご確認のうえ同意してください。 ※インストール後は、VS Codeを再起動してください。 Q. もしインストールに失敗した場合は? A. 以下ウェブサイトからのご自身のPC OS環境に応じたインストーラーをダウンロードして、試してください。 MCUXpresso Config Tools | NXPマイクロコントローラ (MCU) 向けソフトウェア開発 | NXP Semiconductors) インストールを進めると初期画面で以下のような画面が表示されますが、該当がなければ閉じて問題ありません。 Kogiso_3-1778572212609.png VS CodeからConfig Toolsを呼び出すにはSDKをインストールし、サンプルをインポート後、プロジェクトを右クリックすると Open with MCUXpresso Config Toolsが現れますので、こちらをクリックしてください。 ※この一連のプロセスは最後のデモンストレーションで詳細に説明するので、ここでは割愛します。  しばらくするとConfig Toolsが起動します。 Kogiso_0-1779263924259.png なおMCUXpresso IDEを使用している場合、Config Toolsは標準で統合されており、上部タブから直接起動できます。 Kogiso_5-1778572280128.png Clocks Toolの画面構成 Config Tools起動後、画面右側のパネルでツールの切り替えが可能です。 今回は「Clocks」を選択します。 Kogiso_6-1778572331001.png クロック設定を変更する際によく使用するClocks Diagramは、画面左上から選択することができます。 画面右下のProblemビューには、設定内容に関するエラーや警告が表示されます。 Kogiso_0-1779261646084.png クロック設定に誤りがあり、エラーが発生するとProblemビューにはエラーの発生箇所と原因が表示されます。またClock Diagram上にも該当箇所が赤色でハイライト表示されるため、問題箇所を視覚的に特定できます。 例えば、CPUクロックが規定の最大値を超えるような設定を行った場合、その旨のエラー(下記)が表示されます。 Kogiso_1-1778634860572.png Clocks Toolを使うための基本用語 ここではClocks Toolを使用するうえで、Clock Diagram上に表示される基本用語を整理します。 Clock Tree (クロック・ツリー) クロックがどこで生成され、どのように分配・選択され、各ブロックへ供給されるかを示した構成図(ツリー図)です。Clocks Toolでは、このClock Treeを視覚的に確認しながら設定を行います。 Clock Source (クロック供給源) クロックの起点となる信号源です。内蔵RCクロックや外部クリスタル(振動子)、外部クロック入力などが該当し、クロックツリーの上流に配置されます。 MCX N947では、標準で48MHzの内蔵RCクロック(FIRC)がClock Sourceとして使用されます。 Kogiso_8-1778572482107.png PLL (Phase Locked Loop) Clock Sourceを入力として、安定した高周波クロックを生成する回路です。 倍率設定や分周設定によって出力周波数を調整でき、CPUや高速バス向けのクロックを柔軟に作ることができます。 ここでは、Clock Sourceである48MHzの入力クロックをもとに300MHzのクロック(48MHz/8*50=300MHz)を生成しています。 Kogiso_9-1778572553141.png DIV (Divider : 分周器) クロック周波数を分割して調整するための機能です。 CPU、バス、各ペリフェラルごとに分周設定が用意されており、必要な動作周波数に調整するために使用されます。 以下では、PLL0で生成された300MHzのクロックから150MHzのクロック(300MHz/2=150MHz)を生成しています。 Kogiso_0-1778575383641.png Mux (Multiplexer:マルチプレクサ) 複数のクロック候補の中から、どのクロックを使用するかを切り替えるための機構です。 選択を切り替えることで、下流に供給されるクロックが変わります。 下図では、2つのMUXが存在し、左側は内蔵RCクロックからの48MHzのクロックを選択、右側はDIV(PLL0_PDIV)により分周された150MHzを選択しています。 Kogiso_10-1778572690176.png デモンストレーション:CPUコア・クロック設定を変更し、LEDの点滅速度を変更する ここでは実際にClocks Tool上でCPUに供給されるクロックを変更し、評価ボード上のLEDの点滅速度が変更するかを見ていきます。 ハードウェアの準備 本稿で使用する評価ボード ・FRDM-MCXN947 SDKのインストール VS Code内の左側のパネルからMCUXpressoのアイコンを選択した状態で「Import Repository」をクリックしてください。 Kogiso_11-1778572835161.png その後、左から2番目の「REMOTE ARCHIVE」をクリックし、Packageにて「FRDM-MCXN947」を検索してください。「947」と打ち込むとすぐにFRDM-MCXN947が候補として表示されます。 Kogiso_12-1778572855885.png Name名、Location名、Create Gitへのチェックは任意に設定して下さい。 ※NameおよびLocation名については、「小文字の英数字」「アンダースコア(_)またはハイフン(-)」のみを使用し、(\, /, :, *, ?, ", <, >, |)などの記号(プログラムの動作不良の原因になりうる)やスペースを避けるのが無難です。 最後に「I agree」にチェックを入れた後、「Import」をクリックするとSDKのインストールが開始しますので、しばらくお待ちください。画面右下に"Repository successfully imported"が表示されたら完了です。 Kogiso_13-1778572880338.png サンプルコードのインポート SDKのインストールが完了したら、サンプルコードのインポートへと進みます。 左側のパネルから「Import Example From Repository」をクリックしてください。 Kogiso_14-1778572955527.png 右側に表示された各タブ内で、「Repository」では先ほどインポートしたSDKを選択、 「Board」はFRDM-MCXN947を選択してください。 「Template」では、今回はLEDの点滅速度を変えるデモンストレーションですので、 「led」と打ち込んで表示される「driver_examples/gpio/gpio_led_output_cm33_core0」で試してみます。 Kogiso_15-1778572977361.png その後、Toolchainを選択して「Import」をクリックしてください。 Kogiso_16-1778572998907.png ConfigToolsを開く インポートしたサンプル上で右クリックして、「Open with MCUXpresso Config Tools」を選択してください。少し待つとConfig Toolsが立ち上がります。 Kogiso_17-1778573044565.png Config Toolsが開いたらまずは右側のパネルにあるOverviewを確認します。このサンプルにおいては、ClocksとPinsの2つが緑色(ONの状態)になっており、2つのツールが有効であることを示しています。 Kogiso_18-1778573085903.png では、Clock Diagramを見てみましょう。 Clock SourceであるFIRC 48MHzからPLL(PLL0)、DIV(PLL0_PDIV)、MUX(SCSSEL)を経由して、MAIN Clock 150MHzが生成されています。 Kogiso_19-1778573132716.png 続いて、少し下にスクロールダウンしてCPUに供給されるクロックを見てみます。今回のサンプル・アプリケーションでは、「System_clock」がCPUコア・クロックに該当します。 MAIN Clock 150MHzは途中でDIVを経由しますが、System Clockに150MHzのまま供給されています。後ほど、この途中に存在するDIVの値を変更し、System Clockに入力されるクロックを変更することでLEDの点滅速度の変化を見ます。 Kogiso_20-1778573194903.png CPU Clock 150MHzの状態のLEDの点滅速度を確認する 先ずは、何の変更もしていない150MHzの状態でLEDの点滅速度を見てみましょう。一旦Config Toolsを閉じて、VS Codeを開きます。 ビルドの前にボード(FRDM-MCXN947)とPCを接続します。 Kogiso_21-1778573253173.png 接続が完了したらインポートしたサンプルをデバッグ(ビルド&書き込み&アプリケーションの実行)します。 Kogiso_4-1779431772140.png デバッグのプロセスが完了したら、プログラムがブレイクポイントで止まっているので、画面上部のアイコン内の"|▶"をクリックします。 Kogiso_23-1778573283897.png 動画のように赤色のLEDが点滅を開始します。これがクロック150MHz時(デフォルト設定)の点滅速度です。 (function() { var wrapper = document.getElementById('lia-vid-6395306957112w304h540r743'); var videoEl = wrapper ? wrapper.querySelector('video-js') : null; if (videoEl) { if (window.videojs) { window.videojs(videoEl).ready(function() { this.on('loadedmetadata', function() { this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) { bar.setAttribute('role', 'presentation'); bar.setAttribute('aria-hidden', 'true'); }); }); }); } }})(); (マイビデオを表示) 停止はアイコンの□をクリックします(デバッグ停止後も、ボード上ではプログラムが実行され続けるため、LEDは点滅を続けますが一旦無視してください)。 Kogiso_24-1778573665179.png CPU Clockを50MHzに変更してLEDの点滅速度を確認する 続いて、Clocks Toolを用いてCPUコア・クロックを150MHzから50MHzへと変更します。 再度Config ToolsのClocks Toolを開いてください。Clocks Diagramを少し下にスクロールダウンして、System ClockにつながるDIV(AHBCLKDIV)を変更します。変更の際には変更したいDIVの内の数字をクリックするとプルダウンで選択することができます。ここで1/3を選択するとSystem Clockが50MHzに変化します。 ※クロック設定を変更する際には、Clock Sourceに近い上流のクロック設定を変更すると、下流に存在する複数のクロック設定に影響を及ぼす可能性があるので注意してください。 Kogiso_0-1779430403587.png この状態でサンプルコードを書き換えます。まずはConfig Toolsの画面左上にあるUpdate Codeをクリックしてください。表示されるダイアログで「OK」を選択してください。 Kogiso_26-1778573845631.png この状態でVS Codeに戻ると、画面上部にチェックボックスが3つ並んで表示されますので、チェックが入った状態でOKをクリックしてください。少し待つと、Clocks Toolでの変更がVS Code上のサンプルコードに適応されます。 ※SDKのバージョンが異なる場合は表示されない場合もあります。 Kogiso_27-1778573865307.png 成功すると画面右下に以下のメッセージが表示されます。 Kogiso_28-1778573878068.png もう一度デバッグの実行し、完了したら"|▶"でサンプルアプリケーションを実行してください。 LEDが点滅を開始します。こちらがクロック 50MHz時の点滅速度です。150MHz時の速度と比べて明らかに遅くなりました。 (function() { var wrapper = document.getElementById('lia-vid-6395308518112w304h540r499'); 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'); }); }); }); } }})(); (マイビデオを表示) 以上でデモンストレーションは完了です。お疲れ様でした。 おまけ1 - 既にプリセットとして、クロック設定が準備されている なお、これまでの手順ではDIVを使ってクロックの変更をしましたが、Clocks Toolにはあらかじめ複数のクロック設定がプリセットとして用意されています。Config ToolsにてClocks Toolを選択し、画面上部からFRO 12MHz / FRO HF 48MHz / FRO HF 144MHz…と任意のクロックを選ぶことができます。 Kogiso_0-1778574158553.png たとえば「BOARD_BootClockPLL_100M」を選んでみると、Clock Source、PLL、DIV、それぞれが先ほどと異なることがわかります。例としてClock Sourceは24MHzの外部クロック(SOSC)となっています。 Kogiso_1-1778574179336.png おまけ2 - 自動で初期化コードを生成した設定値はどこに? Clock Toolsを用いてクロック設定を自動更新(Update Code)した後、実際の初期化コードにどのように反映されるのかを見てみます。 インポートしたサンプルのProject FilesからCソースファイル(gpio_led_output.c)を確認します。 Kogiso_2-1778574228909.png Cソースファイルの中身を見ていくと、Pin、Clock、Debug consolの初期化を実行するコードが存在します。 Kogiso_3-1778574247421.png BOARD_InitHardware(); 上で右クリックし、Go to Definition をクリックするとさらに詳細を見ることができます。 Kogiso_4-1778574280972.png Pin、Clock、Debug consolのそれぞれ初期化を実行するためのコードがあります。BOARD_InitBootClocks(); で右クリックし「Go to Definition(もしくは"fn + F12")」を選択し、さらに詳細を見てみます。 遷移先のファイル(clock_config.c)は、FRDM‑MCXN947 の起動時クロック構成を定義する生成コードです。 スクロールダウンしていくと先ほど説明した通り、複数のクロック構成(FRO 12MHz / FRO HF 48MHz / FRO HF 144MHz / PLL 150MHz / PLL 100MHz)がプリセットとして用意されていることがわかります。下記画像では規定値である PLL150Mとなっていますが、 Kogiso_5-1778574353197.png 例えばこの部分をBOARD_BootClockFROHF48Mに変更すると Kogiso_6-1778574378576.png プリセットとして準備されているFRO HF 48Mのクロック構成にて初期化が実行されます。 Kogiso_7-1778574399078.png 次にFRO HF 48Mのまま、Clocks Tool上で直接DIVの変更を行うとクロック構成およびコードがどのように変化するか見てみます。赤枠で囲んだテキスト&設定部分が変更されます。 Kogiso_8-1778574466864.png 更に、Clocks Tool上でSystem ClockへとつながるDIVを1/2、つまり48→24MHzへ変更し、Update Codeを行うと、DIVの変更により赤枠が変わったことがおわかりいただけると思います。 Kogiso_9-1778574928326.png   なお、Clocks Tool側でも変更前後の差分を確認することができます。 クロック設定を変更後、Update Codeをクリックした際に以下のようなダイアログが表示されます。差分が生じたファイルにはファイル名の右側に change と表示されます。これをクリックすると差分を見ることができます。 Kogiso_2-1779431079086.png clock_config.c の差分を確認します。左側(Newly generated)が変更後のファイル、右側(On disk)が変更前のファイルです。System Clockに差分が生じているのが確認できると思います。 差分が生じた箇所は色が変更しているので視覚的にわかりやすいです。 Kogiso_3-1779431340110.png   マイコン、プロセッサには、機能集約が進んでいるため、内部のクロックツリーも非常に複雑化しています。このようなクロック可視化ツールがないと、現実的に設計・評価は難しいと思いますので、是非ご活用ください。   参考資料 解説動画: MCUXpresso Clocks Tooの使い方(VS Code環境)    =========================​ 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。​ お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。​ (既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。) MCUXpresso Config Toolsの中から「Clocks Tool」にフォーカスし、クロック設定の基本および設定方法を解説します。VS Code環境での導入方法から、CPUクロック変更によるLED点滅デモまで紹介します。 (作業時間:10分 *MCUXpresso for VSC (Visual Studio Code), SDKをインストールしている前提) MCUXpresso MCX SW | Downloads 日本語ブログ
View full article
FXPS71407 相对压力值 你好! 我使用的是 FXPS71407!我将数据类型配置为 0x0,即相对压力数据。然后读取 snsdata0,结果是 0x0。但正如数据表如下所示:板处于恒定压力中,16 位寄存器中的数据必须是 0x75C0,但是 0x0。有什么问题吗? 谢谢您! gangli_weride_1-1735548844485.png Re: FXPS71407 relative pressure value 你好 我仍在与专家联系,让我与你们分享一下信息。 "寄存器 0x40 中不应写入任何内容,这很可能是导致问题的原因"。 希望这些信息对您有所帮助 祝你愉快,好运连连。 Re: FXPS71407 relative pressure value 你好,拉法: 我将数据类型配置为 0x0",配置是指写入寄存器还是写入闪存?:写入寄存器 如果没有写入闪存,能否确认是否向寄存器 0x40 写入了任何内容? 以下是我的设置: physaddr 为 0x1 所有设置均通过 CRM 命令发送: DSI3-MasterGen2.exe DSI3da 0 5 8 1000 crm2 0x1 0x8 0x1a 0xf0 0xf8 0 DSI3-MasterGen2.exe DSI3da 0 5 8 1000 crm2 0x1 0x8 0x40 0x00 0xe9 0 DSI3-MasterGen2.exe DSI3da 0 5 8 1000 crm2 0x1 0x8 0x42 0x00 0x14 0 DSI3-MasterGen2.exe DSI3da 0 5 8 1000 crm2 0x1 0x8 0x26 0x1a 0xb8 0 DSI3-MasterGen2.exe DSI3da 0 5 8 1000 crm2 0x1 0x8 0x23 0x0f 0xb9 0 DSI3-MasterGen2.exe DSI3da 0 5 8 1000 crm2 0x1 0x8 0x44 0x10 0x92 0 DSI3-MasterGen2.exe DSI3da 0 5 8 1000 crm2 0x1 0x8 0x44 0x00 0x3c 0 谢谢! Re: FXPS71407 relative pressure value 你好 我联系了一位专家,他告诉我以下几点。 "我将数据类型配置为 0x0",配置是指写入寄存器还是写入闪存? 如果写入闪存,上述问题同样适用。 (施加到 BUS_I 的电压) 如果没有写入闪存,能否确认是否向寄存器 0x40 写入了任何内容? 如果是,他们能分享设置吗? 您能确认这些信息吗?我将等待您的答复。 Re: FXPS71407 relative pressure value UF2 没有锁定。寄存器 0x5f 的值为 0x00 Re: FXPS71407 relative pressure value 你好 P_CAL_ZERO 寄存器是 UF2,如果 UF2 被锁定,可能会导致保存数值时出现问题,请检查 UF2 是否被锁定。 RafaR_0-1735588291638.png 祝你愉快,好运连连。
View full article
Hello NPU! Running a TFLite model on i.MX 9 The following is a guide on training a simple model in Pytorch and Tensorflow and deploying it on an application using the i.MX93 Ethos-65 Neural Processing Unit (NPU). After following this guide you will accomplish: Training a simple CNN on the MNIST dataset Convert the model to tflite, quantize it and compile it for the i.MX93 NPU (Ethos-65). Run a simple application where a digit can be drawn and identified by our model. Prerequisites To follow this guide you will need: Yocto image, GTKMM3 support is needed for the C++ example, for the python example a pre-built image can be used. An i.MX93 board Running Python example The application implementation is provided in both Python and C++, if using the python application, pre-built full image can be used instead, simply copy the python scripts to the target and execute as follows: # Running quantized example on the CPU ./run.py -m cnn_tf_quant.tflite # Running example on the Ethos NPU ./run.py -m cnn_tf_quant_vela.tflite -d /usr/lib/liblitert_ethosu_delegate.so Pre-built models are provided in the attachment however steps and scripts used to train and generate the models are also included (see below). Building image with GTKMM3 support (C++ example only) The GUI application used for demonstration has been written in GTKMM3 (C++ wrapper of the GTK library) therefore an image with GTKMM3 support is needed, luckily there is already a recipe we can use to easily integrate this into our yocto image. To build the image simply follow the instructions in the Yocto User's guide, as of the time of this writing the latest BSP is 6.12.49_2.2.0 so we will use that. Once you have setup all the requirements in your host and installed repo, you can setup your build enviroment as follows: repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-walnascar -m imx-6.12.49-2.2.0.xml repo sync Depending on your target you can now setup your build directory, we will use wayland graphics with X11 support, and the iMX93 Freedom board as example: DISTRO=fsl-imx-xwayland MACHINE=imx93-11x11-lpddr4x-frdm source imx-setup-release.sh -b 93-frdm-xwayland Simply select the MACHINE configuration that matches your board. Now we're almost ready to start the build, we still need to add GTKMM3 support to our image, simply modify your local.conf file under conf/local.conf and add the following: IMAGE_INSTALL:append = " gtkmm3" Make sure the space in front of gtkmm3 is there to avoid issues on the build. Since the build is very resource intensive out of memory issues can arise during the build, to limit the amount of concurrent recipes attempted to build at once it is recommended to add the following as well: BB_NUMBER_THREADS="8" PARALLEL_MAKE="-j8" BB_PRESSURE_MAX_CPU ?= "50000" BB_PRESSURE_MAX_IO ?= "100000" BB_PRESSURE_MAX_MEMORY ?= "25000" After this your local.conf should look similar to this: Screenshot from 2025-12-30 13-00-44.png  NOTE: Make sure to have plenty of storage available on your machine since the build requires upwards of 500GB to complete. The build can now start, if you want to build the GTKMM application from source it is required to have an available SDK create it as follows: bitbake imx-image-full -c populate_sdk And to create the image simply do: bitbake imx-image-full We require the full image since it contains all the Tensorflow Lite libraries and different examples. After the build completes the toolchain can be installed and the image flashed onto the board. To install the toolchain: ./tmp/deploy/sdk/fsl-imx-xwayland-glibc-x86_64-imx-image-full-armv8a-imx93-11x11-lpddr4x-frdm-toolchain-6.12-walnascar.sh And afterwards every time you want to use the toolchain: source /opt/fsl-imx-xwayland/6.12-walnascar-full-gtkmm3/environment-setup-armv8a-poky-linux To flash the image to an SD card: zstdcat imx-image-full-imx93-11x11-lpddr4x-frdm.rootfs.wic.zst | sudo dd of=/dev/mmcblk0 bs=1M conv=fsync And now you are ready to build the application, train some models and deploy them. Building the GTKMM3 application (C++) The source for the application can be found here, a prebuilt binary is also provided and attached here.  The application contains a drawing area where one can simply draw a digit with the mouse or touch display, and two buttons one to clear the drawing area and one to trigger the execution of the model and predict the digit. window_example.png To build from scratch CMake is required, as well as a toolchain with support for GTKMM3 (see above), the following steps can be followed to build the project: sudo apt install cmake git clone https://github.com/ManRod2982/drawing_window_imx cd drawing_window_imx/drawing_window_cpp/ source /opt/fsl-imx-xwayland/6.12-walnascar-full-gtkmm3/environment-setup-armv8a-poky-linux cmake -B build -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake cmake --build build After this a binary called window will be created under the build directory, now it can be simply copied to the target SD card. If using linux the filesystem will be mounted, so you can simply copy the binary to the root directory: sudo cp build/window /media/user/root/root/ SCP can also be used if a connection to the board is already established: scp build/window [email protected]:/root And after this on the target the application can be started as follows: ./window -m model_path [optional] -d delegate_path [optional] -v Three parameters are accepted by the application: Path to the model: -m or --model_path [Optional] Path to the delegate if any: -d or --delegate_path, if none is provided the model will be attempted to be run on the CPU using the XNN delegate [Optional] Verbosity flag, if present the model will output more information Now we need a model to run. Training a simple CNN model Looking at the Machine Learning User's guide for this release. The following is the support for the different frameworks with respect to the available compute engines in each device: Screenshot from 2025-12-30 16-24-57.png Tensorflow Lite and LiteRT (latest release of Tensorflow Lite and the only one moving forward) are the frameworks that are widely supported for most compute engines in the i.MX9 family, this guide will use Tensorflow lite since the example uses C++ and the current release of LiteRT only supports Python, however the interface and process it's pretty much the same. Setting up the environment The example repository contains different python scripts used to train the models and convert them to the tflite format. In order to follow the next steps a python3 installation is necessary. It is recommended to setup a virtual environment: python3 -m venv myenv source myenv/bin/activate pip install -r requirements.txt This will install all the required packages for both Tensorflow and Pytorch. Training a model with Tensorflow Tensorflow allows an straightforward path to quantize and convert the model to Tensorflow Lite, our Convolutional Neural Network (CNN) architecture looks as follows: model = tf.keras.models.Sequential([ tf.keras.layers.Input(batch_shape=(1, 28, 28, 1)), tf.keras.layers.Conv2D(16, 5, padding='same', activation='relu'), tf.keras.layers.Conv2D(32, 3, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.MaxPool2D(2, strides=(2,2)), tf.keras.layers.Flatten(), tf.keras.layers.Dense(100, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10, activation='softmax') ]) We can train the model by running the script train_tf.py, it takes around 2min to train on a normal laptop and achieves 99.05% accuracy on the test dataset. For details on the framework please refer to the official Tensorflow documentation. After running the script we can visualize our model using the eIQ toolkit model visualizer or the Netron.app: cnn_tf.keras (1).png The i.MX93 features an ARM Ethos-65 NPU which requires the weights, biases and inputs to be integers and our current model uses float32, therefore we need to quantize the model, to achieve this we can run tf2quant_tflite.py which will quantize the model and convert it to tflite: cnn_tf_quant.tflite.png Which we can now see takes integer inputs and outputs, the weights and biases have also been quantized and we can easily see the difference in size of the files: Screenshot from 2025-12-30 17-46-15.png The quantized model is 555kB whereas the float32 model is 2.2MB, since float32 requires 4 bytes to store each weight and bias, whereas the quantized model requires only one byte. You now have a model than can be used on the target, however as it is right now it will be run on the CPU using the XNN delegate, to run the model simply do: ./window -m cnn_tf_quant.tflite We can now compile our quantized model for the ARM Ethos NPU. The eIQ toolkit will be used. Open the model through the model tool: 2025-12-30_17-53.png Navigate to the folder with your quantized model, cnn_tf_quant.tflite in this case and open it, you should be able to visualize the model, now we can click on the options menu to select convert: 2025-12-30_17-55.png We select the i.MX93 converter, we will prompted to select the destination folder as well: 2025-12-30_17-56.png After selecting the destination folder if all goes well the conversion finalizes and we should be able to visualize the model optimized to be run on the Ethos, any operations not supported by the NPU will be shown and carried out by the CPU, in the case of this simple example all the operations are carried out by the NPU: cnn_tf_quant_vela.tflite.png And we can now run the model on the target as follows: ./window -m cnn_tf_quant_vela.tflite -d /usr/lib/libethosu_delegate.so Training a model with Pytorch The repository contains a sample model using Convolutional Neural Networks to train on the MNIST data set, the model structure is as follows: NeuralNetwork( (cnn): Sequential( (0): Conv2d(1, 16, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2)) (1): ReLU() (2): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1)) (3): ReLU() (4): Dropout(p=0.2, inplace=False) (5): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False) (6): Flatten(start_dim=1, end_dim=-1) (7): Linear(in_features=5408, out_features=100, bias=True) (8): ReLU() (9): Dropout(p=0.2, inplace=False) (10): Linear(in_features=100, out_features=10, bias=True) ) ) Pytorch models can be easily converted to Tensorflow lite (without quantization) to be run on the CPU, as well as the Open Neural Network Exchange  model (ONNX) however Executorch has recently been released, which is an inference model for pytorch models on embedded devices, support for it is currently in the works. The Pytorch model is defined under pytorch_model.py: #!/usr/bin/env python3 import torch from torch import nn # Define model class NeuralNetwork(nn.Module): def __init__(self): super().__init__() self.cnn = nn.Sequential( # Input 28x28x1, after padding 32x32x1, output 28x28x16 nn.Conv2d(in_channels=1, out_channels=16, kernel_size=5, padding=2), nn.ReLU(), # Input 28x28x16, output 26x26x32 nn.Conv2d(in_channels=16, out_channels=32, kernel_size=3), nn.ReLU(), nn.Dropout(p=0.2), # Input 26x26x32, output 13x13x32 nn.MaxPool2d(kernel_size=2, stride=2), nn.Flatten(), nn.Linear(13*13*32, 100), nn.ReLU(), nn.Dropout(p=0.2), nn.Linear(100, 10) ) def forward(self, x): logits = self.cnn(x) return logits  And the training is carried out by executing train_pytorch.py, the training achieves 99.3% accuracy on the test dataset and it takes around 7 min to complete on a normal laptop. For details on the framework itself and the training process refer to the official pytorch documentation. The pytorch model is then saved under pytorch_model.pth however pytorch does not save the graph information only the weights and biases, if we visualize the saved model on netron or the eIQ toolkit model visualizer we can observe the disconnected weight and biases: pytorch_model.pth.png To better visualize our model we can simply convert it to the ONNX format by using the script pytorch2onnx.py, and now we can visualize the graph of our model on Neutron: pytorch_cnn.onnx.png NOTE: ONNX might also provide a way to quantize and convert the quantized model to tflite however in my tests of onnx-tf the tool seemed to be out of sync with the latest Tensorflow framewok, it was easier to create a similar model on Tensorflow and then quantize and export. We can now export our model to tflite, since the model is not quantized it will be run on the CPU (XNN delegate), to export it we run pytorch2tflite.py and we can now visualize the exported model: pytorch_cnn.tflite.png And we can run this model on the target as follows: ./window -m pytorch_cnn.tflite Deploying and running the model We now have an application where we can draw the digits, a model capable of detecting those digits, but our application needs to be able to execute that model and get the results, this is our next step. In order to be able to run the model on the target we need to: Load the model Create a tflite interpreter Load external delegates if any Allocate the tensors C++ example A minimal example is provided here, however it doesn't include the loading of the external delegate, which we will need in order to be able to run our model on the NPU. The required headers are the following: #include "tensorflow/lite/delegates/external/external_delegate.h" #include "tensorflow/lite/interpreter.h" #include "tensorflow/lite/interpreter_builder.h" #include "tensorflow/lite/kernels/register.h" #include "tensorflow/lite/model_builder.h" We can now load our model as follows using the TFLite API: std::unique_ptr<:flatbuffermodel> model = tflite::FlatBufferModel::BuildFromFile(model_path); An interpreter needs to be created now, for this an operation resolver is needed as well as our model: tflite::ops::builtin::BuiltinOpResolver resolver; std::unique_ptr<:interpreter> interpreter; tflite::InterpreterBuilder(*model, resolver)(&interpreter);  If a delegate is required we now need to create it and update our execution graph so that the interpreter knows to call the delegate on the supported operations: // Create external delegate option and pass the delegate library TfLiteExternalDelegateOptions external_delegate_options = TfLiteExternalDelegateOptionsDefault(delegate_path); // Create the External Delegate. This will load the delegate. TfLiteDelegate *external_delegate = TfLiteExternalDelegateCreate(&external_delegate_options); // Add External Delegate into TFLite Interpreter to automatically delegate nodes. if (interpreter->ModifyGraphWithDelegate(external_delegate) != kTfLiteOk) { std::cerr << "Failed to add delegate" << std::endl; } We can now allocate the tensors for our model: // Allocate tensors for the model if (interpreter->AllocateTensors() != kTfLiteOk) { std::cerr << "Failed to allocate tensors" << std::endl; } And at this point we are ready to run the inference using our model! The last step is to fill the input buffers with our data, invoke the interpreter and retrieve the results from the output buffer, in the following example with a float model: // Fill input buffers // Note: The buffer of the input tensor with index `i` of type T can // be accessed with `T* input = interpreter->typed_input_tensor (i);` float *input_tensor = interpreter->typed_input_tensor (0); std::memcpy(input_tensor, input.data(), input.size() * sizeof(float)); // Run inference if (interpreter->Invoke() != kTfLiteOk) { std::cerr << "Failed to invoke Interpreter!" << std::endl; return {}; } // Read output buffers // Note: The buffer of the output tensor with index `i` of type T can // be accessed with `T* output = interpreter->typed_output_tensor (i);` float *output_tensor = interpreter->typed_output_tensor (0); std::memcpy(output, output_tensor, output.size() * sizeof(float)); In our example application the interpreter creating and inference calling is wrapped in a class called NnModel, it's implementation can be seen on the repository but it can handle both the float models and int8 models without any modification. The class is instantiated inside the main routine and the inference is called every time the predict button is clicked. // Create model with parsed parameters NnModel nn(model_path, delegate_path, verbose); void Window::on_predict_clicked() { // Save screen to file std::cout << "Predict clicked!" << std::endl; // Call inference on NnModel depending on the type // the model expects int number; auto data_type = nn_.get_dtype(); switch (data_type) { case kTfLiteFloat32: { std::vector drawing = mouse_drawing.export_to_vector (28, 28, 255.0); std::vector output_vec_f = nn_.infer (drawing); number = get_max_index (output_vec_f); break; } case kTfLiteInt8: { std::vector drawing = mouse_drawing.export_to_vector (28, 28, 255.0); std::vector output_vec_int = nn_.infer (drawing); number = get_max_index (output_vec_int); break; } default: std::cerr << "Cannot handle input type: " << std::to_string(data_type) << std::endl; break; } std::string display = "You drew a: " + std::to_string(number); std::cout << display << std::endl; text_view.set_text(display); } Python example The process for creating an interpreter in Python is pretty similar, we still need to load a delegate if any is used and load the model as well as allocate the tensors. In this example LiteRT is used instead however the API remains the same, the only change needed is where the interpreted is imported from. The following minimal code can be used to load the model and any external delegates: from ai_edge_litert.interpreter import Interpreter # Create interpreter if delegate_path is not None: # attempt to load external delegate if provided (platform specific) try: from ai_edge_litert.interpreter import load_delegate delegate = load_delegate(delegate_path) self.interpreter = Interpreter(model_path=model_path, experimental_delegates=[delegate]) except Exception as e: raise RuntimeError(f"Failed to load delegate: {e}") else: self.interpreter = Interpreter(model_path=model_path) self.interpreter.allocate_tensors() We now have an interpreter we can use, we just need to fill the input tensors, invoke the interpreter and retrieve the output tensors with the results from our model: # Set input input_details = self.interpreter.get_input_details()[0] self.interpreter.set_tensor(input_details['index'], input_data) # Run inference self.interpreter.invoke() # Get results out_details = self.interpreter.get_output_details()[0] output_data = self.interpreter.get_tensor(out_details['index']) These steps are contained in a wrapper class under nn_model.py.  Benchmarking the models A prebuilt benchmarking tool is provided in the release it generates random inputs and measures the time it takes to run the inference on the model, the following are the results running the different models on the i.MX93: ./benchmaark_model --graph=model --num_threads=num_cores   CPU 1 core CPU 2 cores NPU pytorch_cnn.tflite 1559.61 us 1023.22 us NA cnn_tf_quant.tflite 585.37 us 379.69 us NA cnn_tf_quant_vela.tflite NA NA 221.84 us This is of course a toy example but it can be observed how running on the dedicated hardware provides a significant improvement on inference speed. The following is a guide on training a simple model in Pytorch and Tensorflow and deploying it on an application using the i.MX93 Ethos-65 Neural Processing Unit (NPU) and the i.MX95 eIQ Neutron NPU.
View full article
SPIサンプルコード こんにちは。私は「Spi_Transfer_S32K312」というプロジェクトでNXP が提供する spi サンプル コードを勉強しています。コード内の各関数の意味を知りたいのですが、ヘッダーファイルの場所を知ることはCANですか? mingimin_0-1766466097344.png Re: spi example code こんにちは@mingimin ヘッダー ファイルは、プロジェクト ディレクトリ内の RTD → include の下にあります。 さらに、S32K3/S32M27x SPI ドライバ統合マニュアルと RTD に付属のユーザー マニュアルを確認することをお勧めします。これらのドキュメントには、ドライバの制限、ハードウェアとソフトウェアの要件、使用ガイドライン、構成手順など、ドライバに関する詳細情報が記載されています。これらは、ドライバの行動や能力をより深く理解するのに役立ちます。 これらのリソースは、たとえば次のパスにあります: C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32K3\RTD\Spi_TS_T40D34M50I0R0\doc 正確なパスは、S32DS のバージョンとインストール ディレクトリによって異なる場合があることに注意してください。 BR、ヴェインB
View full article
S32K314 の ADC セルフテスト (スクエアチェック) サポート こんにちは、 UM Square Checkのドキュメントには、ADCセルフテスト機構について記載されています。しかし、「セーフティ機構」を確認すると、ADCセルフテストは「NONE(なし)」と表示されており、S32K314パッケージのSquare Check (SCheck)設定にもこのオプションは見つかりません。 この機能をCANで有効にする方法や設定方法を教えてください。 優先度: 高 SAFETY_SW Re: ADC Self-Test (Square Check) Support for S32K314 こんにちは、チームの皆さん アップデートはありますか? よろしくお願いします。 Re: ADC Self-Test (Square Check) Support for S32K314 こんにちは、チームの皆さん アップデートはありますか? よろしくお願いします。 Re: ADC Self-Test (Square Check) Support for S32K314 こんにちは@JasonTsengSG 、 私の理解では、これらはより高いパフォーマンスとトラクションインバーターおよびモーター制御 (eTPU) の追加サポートを備えた新しい K3 派生製品です。 S32K3E_SW_アーキテクチャ.docx RMとSMはイントラネットで見つけることができます。ここでは(K3Eの代わりに、このK3サブグループを指すために特定のK396派生名を使用することもできます): Zebra - ドキュメント - S32K396 - すべてのドキュメント オートモーティブ セーフティ ソフトウェア - リリース_1.0.6 - すべてのドキュメント 敬具、 ラドスラフ Re: ADC Self-Test (Square Check) Support for S32K314 こんにちは、ラドスラフさん。 S32K3E と S32Kxx の違いは何ですか? どちらも S32K396、S32K394、S32K376、S32K374、S32K366、S32K364 のグループだそうです。 S32K3E 固有の RM および HW セーフティマニュアルはどこにあるか教えていただけますか? よろしくお願いします。 Re: ADC Self-Test (Square Check) Support for S32K314 わかりやすい説明をありがとう、ラドスラフ。
View full article
i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello, I am trying to debug firmware for the Cortex-M33 on an i.MX93 using a Segger J-Link and gdb. I established an SWD connection using the patch from NXP for the J-Link software and can halt the processor, read the registers and memory and so on. My problem is, that resetting the processor does not work. The content of the registers does not change so I assume the reset is ignored: (gdb) monitor regs R0 = 40D000C0, R1 = 2001EFE3, R2 = 40D000C0, R3 = 00000000 R4 = 00000000, R5 = 00000000, R6 = FFFFFFFF, R7 = 2001EEE8 R8 = FFFFFFFF, R9 = FFFFFFFF, R10= 2000F000, R11= 00000000 R12= FFFFFFFF, R13= 2001EEE8, MSP= 2001EEE8, PSP= 00000000 R14(LR) = 0FFE219D, R15(PC) = 0FFE2248 XPSR 49000003, APSR 48000000, EPSR 01000000, IPSR 00000003 CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00 Security extension regs: MSP_S = 2001EEE8, MSPLIM_S = 00000000 PSP_S = 00000000, PSPLIM_S = 00000000 MSP_NS = 00000000, MSPLIM_NS = 00000000 PSP_NS = FFFFFFFC, PSPLIM_NS = 00000000 CONTROL_S 00, FAULTMASK_S 00, BASEPRI_S 00, PRIMASK_S 00 CONTROL_NS 00, FAULTMASK_NS 00, BASEPRI_NS 00, PRIMASK_NS 00 (gdb) monitor reset Resetting target (gdb) monitor regs R0 = 40D000C0, R1 = 2001EFE3, R2 = 40D000C0, R3 = 00000000 R4 = 00000000, R5 = 00000000, R6 = FFFFFFFF, R7 = 2001EEE8 R8 = FFFFFFFF, R9 = FFFFFFFF, R10= 2000F000, R11= 00000000 R12= FFFFFFFF, R13= 2001EEE8, MSP= 2001EEE8, PSP= 00000000 R14(LR) = 0FFE219D, R15(PC) = 0FFE2248 XPSR 49000003, APSR 48000000, EPSR 01000000, IPSR 00000003 CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00 Security extension regs: MSP_S = 2001EEE8, MSPLIM_S = 00000000 PSP_S = 00000000, PSPLIM_S = 00000000 MSP_NS = 00000000, MSPLIM_NS = 00000000 PSP_NS = FFFFFFFC, PSPLIM_NS = 00000000 CONTROL_S 00, FAULTMASK_S 00, BASEPRI_S 00, PRIMASK_S 00 CONTROL_NS 00, FAULTMASK_NS 00, BASEPRI_NS 00, PRIMASK_NS 00 The reset strategy from the J-Link is using SYSRESETREQ and not the reset signal since only the Cortex-M33 core is supposed to be reset. Is it possible that the debug controller does not have the necessary security privileges to write the SYSRESETREQ bit? What is the correct way to perform a reset of the Cortex-M33 using a J-Link? Regards, Malte Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello, Can you also share the details on [email protected]? More than a yer already from this topic, and still same issue. Thanks. Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working It worked in the sense I never lost again the processor, but the execution time was heavily affected, which I don't understand why. Each operation took 10x more the time. Does it make sense to perform a cold reset but have by default some code in the ROM (contrary on what is suggested by NXP to have no SD card) and attach the debugger to what is ongoing and overwrite ram? Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello, Is it possible to use this JLink script? https://kb.segger.com/images/8/86/Example_Reset_CortexM_Normal.JLinkScript It is a standard strategy for CortexM. Kind Regards Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello, Can you please share your solution? I am currently facing the same situation. Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello Krzysztof, as stated above, I did manage to work out a way to reset the Cortex-M33 in an i.MX93 using a J-Link. If that is what you are looking for, I will gladly share the details with you. Just tell me your e-mail address or another way of contacting you directly. Regards, Malte Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hi, I just found this topic and was wondering if someone was finally able to find some reliable solution for working with M33 in separation from A55. Recently I have started creating development environment for upcoming project and pretty quickly got into the same trouble with triggering software reset. It's been some time since the thread was opened, SEGGER now (v8.10) provides software with builtin IMX targets, although still seems not capable of performing single core reset. I did some experiments with SCB (SYSRESETREQ) and SCR registers but just can't achieve anything stable. I had also quickly tested MCUXpresso plugin for VSCode and didn't notice any custom, working reset strategy implementation. Regards, Krzysztof Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hi Malkai, I am very much interested in a solution as I get exactly the same problem. Is it possible to send me your solution or advice? Many thanks. [email protected] Best regards Junshu Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hi Malte That would be much appreciated. My mail is [email protected] Best regards Niels Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hi Niels, no thanks to the NXP support, which is less than helpful, I worked out a solution for this problem. If you tell me your e-mail address or any other way of contacting you directly I will be glad to help you. Kind regards, Malte Kaiser Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello @Sanket_Parekh  I'm in the exact same situation as the original author. It appears that the JLink script provided by NXP doesn't actually reset the M33 core, but only halts it. This leaves registers and processor state unchanged and if a fault was encountered, I'm not able to continue debugging properly without resetting the core through Linux first. Is there any way that I can trigger such a reset of the M33 core but using the JLink debugger? Best regards Niels Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello Sanket_Parekh, (1) Where can I get the NXP J-Link script patch for i.MX93 Cortex-M33? (2) According to Segger there is no roadmap yet to support i.MX93 in J-Link. But it make come in Q1/Q2. Is there any other possibilities to debug the Cortex-M33? BR Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello @malkai , I hope you are doing well. "What is the procedure intended by NXP to reset the Cortex-M33 core in the i.MX93?" ->The System Reset Controller (SRC) is responsible for the generation of all the system reset signals and boot argument latching. ->Its main functions are as follows: • Deals with all global system reset sources from other modules and generates global system reset. • Responsible for power gating of MIXs (Slices) and their memory low power control. ->The SRC takes the POR_B from the PAD and fuse bits to complete the boot sequence and the GPC low power request to complete the power down/up sequence. Please refer to Chapter 33 System Reset Controller (SRC). https://www.nxp.com/webapp/Download?colCode=IMX93RM Thanks & Regards, Sanket Parekh Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello @Sanket_Parekhm, thank you for your reply. However, that information does not help to solve the issue. As you know, the Cortex-M33 core in the i.MX93 has the Armv8-M architecture which does not have a VECTRESET bit in the AIRCR register (see D1.2.3 in https://developer.arm.com/documentation/ddi0553/latest/). So the only available reset request is SYSRESETREQ to which there is no reaction by the Cortex-M33 core nor by the entire system. Why is that? I already looked into the reset strategies used by the J-Link. The thing is, that the patch from NXP replaces these with just halting the CPU, as I told you. And the reset line cannot be used here, since it resets the entire SoC. So, the issue still remains: What is the procedure intended by NXP to reset the Cortex-M33 core in the i.MX93? Thank you and kind regards, Malte Kaiser Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello @malkai , I hope you are doing well. ->The Reset selection controls the target device reset operation. All reset options apply to Cortex-M processor-based devices, are available in JTAG and SWD mode, and halt the CPU after the reset. ->Core - performs a reset of the Cortex-M core only by setting the VECTRESET bit. On—chip peripherals are not reset. For some Cortex—M devices, this reset method is the only way they may be reset. However, in most cases, this method is not recommended, because most target applications rely on the reset state of some peripherals (PLL, External memory interface, etc.) and may be confused if they boot up, but the peripherals are already configured. ->ResetPin - J-Link pulls its RESET pin low to reset the core and peripherals. Normally, this causes the CPU RESET pin of the device to go low as well, resulting in a reset of the CPU and peripherals. This reset method will fail if the RESET pin of the target device is not pulled low. Please refer to the section reset strategies in the below link. https://community.nxp.com/ pwmxy87654/attachments/ pwmxy87654/kinetis/28743/1/ UM08001_JLink.pdf Thanks & Regards, Sanket Parekh Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello @Sanket_Parekh, thank you for your reply. Unfortunately, that information is not helping to solve my problem. In the meantime, I found out multiple things: 1. The J-Link script provided by NXP in the patch for the i.MX93 does not implement a reset. It replaces resetting the CPU with just halting it. 2. Requesting a reset by manually writing AICR.SYSRESETREQ to 1 through the debugger does not result in a reset of the Cortex-M33 core. So, my original question remains: What possibility exits to reset the Cortex-M33 through a debugger? Thanks and regards, Malte Re: i.MX93: Cortex-M33 Reset using J-Link and SYSRESETREQ not working Hello @malkai, I hope you are doing well. Please refer to this link, It will be helpful. https://community.nxp.com/t5/ i-MX-Processors-Knowledge- Base/All-Boards-JTAG/ta-p/ 1106822 ------------------------------ ------------------------------ ------------------------------ ----------------------------- Note: If this post answers your question, please click the Correct Answer button. ------------------------------ ------------------------------ ------------------------------ ----------------------------- Thanks & Regards, Sanket Parekh
View full article
Watch The Freescale Cup EMEA Finals LIVE A Livecast has been set up for you to enjoy The Freescale Cup EMEA Finals on 28-29 April that are hosted at the Politecnico of Torino. Connect on Freescale Cup 2015 live streaming - SeLM - Politecnico di Torino Freescale Cup Content
View full article
S32K148锁死 S32K148 MCU用J-LINK错刷Flash,再用J-LINK链接发生如下错误,JLINK unsecured已没用,怎么解决? Connecting ... - Connecting via USB to probe/ programmer device 0 - Probe/ Programmer firmware: J-Link V9 compiled Dec 13 2022 11:14:50 - Probe/ Programmer S/N: 25994751 - Device "S32K148" selected. - Target interface speed: 50 kHz (Fixed) - VTarget = 3.301V - ConfigTargetSettings() start - ConfigTargetSettings() end - Took 305us - InitTarget() start - SWD selected. Executing JTAG -> SWD switching sequence. - Protection bytes in flash at addr. 0x400 - 0x40F indicate that readout protection is set. For debugger connection the device needs to be unsecured. Note: Unsecuring will trigger a mass erase of the internal flash. - Executing default behavior previously saved in the registry. - Device will be unsecured now. - Timeout while unsecuring device. Erase never stops. - InitTarget() end - Took 2.17s - Found SW-DP with ID 0x2BA01477 - DPv0 detected - CoreSight SoC-400 or earlier - Scanning AP map to find all available APs - AP[2]: Stopped AP scan as end of AP map has been reached - AP[0]: AHB-AP (IDR: 0x24770011, ADDR: 0x00000000) - AP[1]: JTAG-AP (IDR: 0x001C0000, ADDR: 0x01000000) - Iterating through AP map to find AHB-AP to use - AP[0]: Skipped. Could not read CPUID register - AP[1]: Skipped. Not an AHB-AP - Attach to CPU failed. Executing connect under reset. Re: S32K148锁死 Hi@dongkuili 首先不见得保证能恢复,因为加密段被你写入了错误持续值,可能并不支持mass erase擦除 可以阅读该文档6. S32K1xx系列MCU芯片锁死(lockup)现象 https://mp.weixin.qq.com/s?__biz=MzI0MDk0ODcxMw==&mid=2247485716&idx=1&sn=979631aa2385a4e3c7651ee75ee252b4&chksm=e9124d92de65c484f1cfec7de451958cfd5cf818c46a4f71a7d3dd8a522af229c5a18aad58ff&scene=21#wechat_redirect Re: S32K148锁死 Hi@dongkuili 这和你使用什么软件没关系,按照文章中说的,直接去测试reset管脚的波形来判断是否可能被恢复,不能的话就不要再浪费你的时间了。 Re: S32K148锁死 谢谢回复 仔细看了链接文档和芯片手册,多次尝试还是无法通过mass erase恢复,想用S32FlashTool_v2.3.4,但不支持S32K148,有支持S32K148的S32FlashTool吗?
View full article