Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
FTF-SNT-F1282 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> このセッションでは、QorIQ LS1021A Towerボードのデモをご覧いただく機会を提供します。ARM®ベースの製品でCodeWarriorをデジタルネットワーキングに使用する方法、Processor Expert for QCSツールを使用してRCWを生成する方法、ubootとRCWをTowerボードにロードする方法、SDKの経験を積む方法を学びます。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> このセッションでは、QorIQ LS1021A Towerボードのデモをご覧いただく機会を提供します。ARM®ベースの製品でCodeWarriorをデジタルネットワーキングに使用する方法、Processor Expert for QCSツールを使用してRCWを生成する方法、ubootとRCWをTowerボードにロードする方法、SDKの経験を積む方法を学びます。 日時:FTF-SNT-F1282 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> こんにちはErkan、残念ながらこのセッションは現場でキャプチャされませんでした。具体的なご質問がございましたら、プレゼンターのFarshid Parandianまでお問い合わせください。 日時:FTF-SNT-F1282 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> こんにちは。。この素晴らしいプレゼンテーションのオーディオ/ビデオへのリンクが見つかりませんでした(PDFファイルとして表示されます)。オーディオ/ビデオは利用できますか?それはそれで良いですが、ただ疑問に思います。私はFTFを逃しました ...
View full article
传感器发布示例 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> NXP技术支持发布的软件示例列表: NXP 技术支持发布的传感器软件示例* NXP技术支持设计的分线板列表: 飞思卡尔传感器分线板设计 – 主页 *以上所有源代码仅供示例使用。恩智浦不对用户应用程序中使用这些代码承担任何责任。
View full article
センサーの公開例 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> NXPテクニカルサポートが公開したソフトウェア例のリスト: NXPテクニカルサポートが公開したセンサソフトウェアの例 * NXPテクニカルサポートによって設計されたブレークアウトボードのリスト: フリースケール・センサ・ブレークアウト・ボード・デザイン – HOME ※ 上記スペースに収録されているソースコードは、すべて参考までにご利用いただくためのものです。NXPは、このコードをユーザーのアプリケーションで使用することについて責任を負いません。
View full article
テクニカルレポート 裏野Brazil.pdf <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ブラジル代表の浦野チームによるフリースケールカップWWファイナルズのテクニカルレポート <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ブラジル代表の浦野チームによるフリースケールカップWWファイナルズのテクニカルレポート Re:テクニカルレポート裏野Brazil.pdf <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> こんにちはルーカス、私たちはそれらを強制するために最善を尽くしています...確かに、英語が一番です。 Re:テクニカルレポート裏野Brazil.pdf <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> テクニカルレポートは英語でなければならないと思いましたか? ルールは明確ですが、尊重されていませんか? それともエラーですか? よろしくお願いいたします
View full article
Low power demo application on FRDM-KL03Z board with KSDK 1.1.0 This document describes the creation of the Low power demo application (Low power demo application on FRDM-KL03Z board ) in KDS 2.0.0  with latest version of KSDK 1.1.0. It is an update of the previous document because the KSDK 1.1.0 implementation brings new features that makes design of a low power demo application more complicated. This document describes the creation of the following low power demo application: When the application starts the green LED blink one time, The RTC device  alarm is set to 15 second  (external oscillator 32768Hz is used) to wakeup CPU and the CPU enters the VLLS1 mode (VLLS0 mode cannot be used with external oscillator).  The CPU wake up is possible by the following ways: - When you push the SW2 button the processor is woken and the green LED start blinking (5 times). - When you short the pin PTB6 to ground 5 times (the pin is available on the 8 pin header connector – pin number 4; you can for example connect a button to the pin number 4 and ground) the processor is woken and the green LED start blinking (5 times). - When selected RTC timeout expired (15 seconds) the processor is woken by the alarm interrupt and the green LED start blinking (5 times). The application is initialized again and recovery from the VLLS1 mode is executed. The alarm is set again to 15 second and the CPU enters the VLLS1 mode again. Preparation First of all the KDS 2.0.0 and KSDK 1.1.0 must be installed. You can find instructions in the document  How to install Kinetis SDK 1.1.0 support in KDS 2.0.0. New project When you properly install and update all the software you are prepared to create the Low power demo application. Create a new Kinetis design Studio project: Select the FRDM-KL03Z board Select the Kinetis SDK path to the KSDK 1.1.0 and select Processor Expert The application is created and there are not any warnings reported in the Problems window. But there is another issue. The fsl_os_abstraction component in the OSs group is added into application (it was not in the KSDK 1.0.0) and it allocated LPTMR device in the inherited fsl_lptmr_hal  component: The only solution of this conflict is removal of this component (the low power demo needn’t any OS; it is a simple application only). But this component is used by fsl_clock_manager and the fsl_clock_manager is used by PinSettings componnet. So you must remove all these component ( fsl_os_abstraction, fsl_clock_manager, PinSettings). When the PinSettings is removed from the project all signal names are also removed and you must select pins in the Cpu component again: The PinSettings component must be replaced by Init_GPIO component that allows settings of GPIO pins including routing and electrical properties. Add the Init_GPIO component into the project and set following properties (switch to Advance view): Select Device - GPIOB Set Settings/Clock Gate to Enabled. Set Settings/Pin 0 group to Initialize and select following properties of this pin (LLWU_P4): Pin Direction – Input Pull resistor – Enabled Pull selection  - Pull Up Set Settings/Pin 6 group to Initialize and select following properties of this pin (LPTMR_ALT3): Pin Direction – Input Pull resistor – Enabled Pull selection  - Pull Up Set Settings/Pin 11 group to Initialize and select following properties of this pin (PTB11 – GREEN LED): Pin Direction – Output Output value  – 1 Set Pin selection/routing/Pin 11 to Enabled. The Pin 11 group is open and the PTB11 is selected as the Pin (GPIO functionality). These settings provide initialization code for routing of selected pins and also GPIO functionality for PTB11 that used for driving of the green LED of the RGB LED on the freedom board. There is also necessary to change the linker settings when you have installed the new version of GCC tools (according to the document How to install Kinetis SDK 1.1.0 support in KDS 2.0.0 - Additional Steps for Kinetis L family chapter) Open the context menu of the project, select Properties item and change the Other linker flags settings to “-specs=nano.specs -specs=nosys.specs”, in C/C++ Build / Settings,  Tools Settigns tab, Cross ARM C++ Linker/Miscellaneous: Tip: If you want to know details of compiled code and the code size, you can use the following options to create extended list file and print code size info on the following Toolchains tab: You can generate Processor Expert code and process Build of the application without any error and warning. When the Build is finished the following information is provided in the Console window: 'Invoking: Cross ARM GNU Create Listing' arm-none-eabi-objdump --source --all-headers --demangle --line-numbers --wide "Low power demo KL03.elf" > "Low power demo KL03.lst" 'Finished building: Low power demo KL03.lst' ' ' 'Invoking: Cross ARM GNU Print Size' arm-none-eabi-size --format=berkeley "Low power demo KL03.elf" text         data          bss          dec          hex      filename 1480          108          876         2464          9a0      Low power demo KL03.elf 'Finished building: Low power demo KL03.siz' ' ' Note: You can see that the memory footprint is quite small because all SDK component are removed. Routing of pins Routing of pins is provided by Init_GPIO and other components in the project. There will be used following pins: SW2 - ADC0_SE9/PTB0/IRQ_5/LLWU_P4/EXTRG_IN/SPI0_SCK/I2C0_SCL – input pin for the SW2 button on the board as LLWU wakeup pin GPIO pin – PTB6/IRQ_2/LPTMR0_ALT3/TPM1_CH1/TPM1_CLKIN1 – input pin of LPTMR device LED_GREEN - PTB11/TPM0_CH0/SPI0_MISO - output pin that driver the green LED of the RGB LED on the board Adding Processor Expert components Now you can add all components for the low power demo application. fsl_gpio_hal to control GPIO pins Init_LLWU and fsl_llwu_hal components to control LLWU device Init_SRTC and fsl_rtc_hal to control RTC device Init_LPTMR and fsl_lptmr_hal to control LPTMR device fsl_smc_hal to control SMC (System Mode Controller) device CPU device We are going to use external oscillator 32768Hz and we need to configure device to allow Very Low Leakage Stop modes. There we set following properties in the Component Inspector of the CPU (switch to Advance view): Check that the Clock settings/Clock Sources/System oscillator 0 is Enabled and set Enable in stop to Enabled. The Clock source, clock pins and clock frequency are preset for the FRDM-KL03Z board Go to the Clock configuration/Clock Configuration 0 and set: Internal reference clock/Slow IRC frequency to 2MHz (it is enough for our demo application and it also decrease power consumption). MCG lite settings/MCG mode set to LIRC_2M Very low power mode to Enabled (leave setting of VLP mode entry to User because the VLLS1 mode is entered after blinking; we will write the code to enter VLLS1 mode) System clocks/Core clock set to 0.5Mhz System clocks/Bus clock set to 0.5Mhz (it allow us to enter very low leakage stop modes) Set Low Power mode setings/Acknowledge isolation to Not allowed value (we will do it in the user code) GPIO pins Open the Component Inspector of fsl_gpio_hal componet, switch to Advance view and set following properties: Select Device - GPIOB LLWU (Low-Leakage Wakeup unit) device Open the Component Inspector of Init_LLWU, switch to Advance view and set following properties: Set Settings/External Source/Pin 4 to Any edge value (we will use this pin that is connected to SW2 button) Set Pins/Pin 4 to Enabled and select  the Pin ADC0_SE9/PTB0/IRQ_5/LLWU_P4/EXTRG_IN/SPI0_SCK/I2C0_SCL in the item below Set Initialization/Utilize after reset values to no We will use the LLWU to wake-up the CPU and we need not any interrupt. RTC (Real Time Clock) device Open the Component Inspector of Init_SRTC, switch to Advance view and set following properties: Set Settings/Clock gate to Enabled Set Settings/Oscillator settings/Oscillator state to Enabled (it enable external oscillator also in stop modes) Set Settings/Time settings/Alarm time [s] to 15 (15 seconds timeout to wake-up from VLLS1 mode) Set Interrupts/ RTC interrupt/Interrupt request to Enabled Set Interrupts/ RTC interrupt/Time overflow interrupt to Disabled Set Interrupts/ RTC interrupt/Time invalid interrupt to Disabled Set Initialization/Time counter to Enabled Set Initialization/Utilize after reset values to no LPTMR (Low-Power Timer) device Open the Component Inspector of Init_LPTMR, switch to Advance view and set following properties: Set  Settings/Clock gate to Enabled Set Settings/Clock settings/Clock select to Internal 1kHz LPO (this clock source is enabled in the VLLS1 mode) Set Settings/Clock settings/Prescale value/Glitch filter to Prescaler/64; Glitch Filter 32 (it will eliminates glitches on connected button that will be used for generating pulses) Set Settings/Compare value to 4 (the LPTMR interrupt is invoked when the compare value is equal to counter and the counter value is increased, i.e. 5 pulses on the input pins invoke the LPTMR interrupt) Set Settings/Timer mode to Pulse Counter (we will use the timer to count external pulses on the input pin 3) Set Settings/Pin select to Input 3 Set Settings/Pin polarity to Active Low Set Pins/Input pin 3 to Enabled and select PTB6/IRQ_2/LPTMR0_ALT3/TPM1_CH1, TPM_CLKIN1 in Pin 3 item. Set Interrupts/Interrupt request to Enabled Set Interrupts/Timer interrupt to Enabled (we will use the timer interrupt to wakeup CPU from VLLS1 mode after 5 pulses on the input 3 pin) Set Initialization/Timer enable to yes Set Initialization/Utilize after reset values to no We have finished design time settings of Processor Expert components and we are ready to write the application code. When you generate code and Build the application there will not be any error or warning. The Processor Expert project looks as follow: Application code During the component settings we have enabled two interrupt – RTC interrupt and LPTMR interrupt. Therefore we need to write theses interrupt service routines. If you look for example into RTC.h file, you can find the declaration of the RTC_IRQHandler interrupt routine. So we can use the declaration to write the definition of the routine in the main.c program module: #define RTC_ALARM_TIMEOUT_SEC 15 /* RTC interrupt service routine */ PE_ISR(RTC_IRQHandler) { if (RTC_HAL_HasAlarmOccured(RTC_BASE)) {   // set the next alarm in RTC_ALARM_TIMEOUT_SEC seconds (clear also the TAF flag)   RTC_HAL_SetAlarmReg(RTC_BASE,RTC_HAL_GetAlarmReg(RTC_BASE) + RTC_ALARM_TIMEOUT_SEC); } if (RTC_HAL_IsTimeInvalid(RTC_BASE)) {        /* clear TIF (Time Invalid Flag) by stop of the counter and setting TSR reg */        RTC_HAL_EnableCounter(RTC_BASE, false);        RTC_HAL_SetSecsReg(RTC_BASE, 0);        /* enable counter */        RTC_HAL_EnableCounter(RTC_BASE, true); } } This interrupt routine services the Alarm interrupt in case that it is invoked during blinking of the green LED in the run mode (clear the flag and set the new Alarm time) and also it services the Invalid Time interrupt that can occur during recovering from the VLLS1 mode. Please note, that RTC module is little bit special , it runs in all  run, wait and stop modes and the reset enables the Time Invalid interrupt bit (TIIE bit in RTC_IER) and invoke the Time Invalid interrupt on reset (POR or software reset). Therefore we need to clear the Invalid Time flag otherwise the application remain invoking RTC interrupt in an infinite cycle and the application does not work at all (it is also one of the issue that has not a straight forward solution). The RTC interrupt routine (defined above) shall properly serve all case we need in our application. Please note, that RTC interrupt always cause the wake-up from low-leakage stops modes (it is not configurable by LLWU on KL03 derivatives – see the chip-specific LLWU information). In addition, the after reset value of RTC_SR register is 0x01 (TIF flag is set). Therefore when the RTC is not initialized and a low-leakage stop mode is entered the CPU is immediately woken-up due to the RTC module interrupt flag (TIF flag is set). I.e. you must always properly initialize RTC module and clear all flags before you enter a low-leakage stop mode. We need also a service routine for the LPTMR device that is used for waking up from VLSS1 mode. This is a simple interrupt service routine that just clear the LPTMR interrupt flag: /* LPTMR interrupt service routine */ PE_ISR(LPTMR0_IRQHandler) {   /* clear LPTMR interrupt flag */   LPTMR_HAL_ClearIntFlag(LPTMR0_BASE); } Now we can write the main function. We will need a temporary count variables for blinking: /* Write your local variable definition here */ volatile uint32_t i; // for waiting uint8_t blink_count; We need also a definition of the pin PTB11 that drivers the GREEN LED /* PTB11 - LED GREEN pin */ #define LED_GREEN_PIN 11 And the number of LED blinking: #define LED_BLINK 5 After devices initialization in PE_low_level_init() we need to check the reason of reset (POR reset or VLLS1 recovery). Thus we can write following code: /* Write your code here */   if (RCM_SRS0 == 0x01) { /* test the reason of reset - wakeup on VLLS */     if(PMC->REGSC &  PMC_REGSC_ACKISO_MASK) {       PMC->REGSC |= PMC_REGSC_ACKISO_MASK; /* VLLSx recovery */     }     for (blink_count = 0; blink_count < LED_BLINK; blink_count++) {        // green LED blinking     GPIO_HAL_ClearPinOutput(GPIOB_BASE,LED_GREEN_PIN);        for (i = 0; i<40000; i++);     GPIO_HAL_SetPinOutput(GPIOB_BASE,LED_GREEN_PIN);         for (i = 0; i<40000; i++);   }     // set the next alarm in "RTC_ALARM_TIMEOUT_SEC" seconds (clear also the TAF flag)     RTC_HAL_SetAlarmReg(RTC_BASE,RTC_HAL_GetAlarmReg(RTC_BASE)+RTC_ALARM_TIMEOUT_SEC);   } else {       /* power-on reset */       /* switch the green LED on */     GPIO_HAL_ClearPinOutput(GPIOB_BASE,LED_GREEN_PIN);        /* wait a while */        for (i = 0; i<40000; i++);        /* switch the green LED off */     GPIO_HAL_SetPinOutput(GPIOB_BASE,LED_GREEN_PIN);   } In case of VLLS1 recovery we acknowledge the pin isolation ACKISO bit in the PMC_REGSC register. This bit must be cleared to allow normal run mode of all pins. Then five blinking of the green LED follows (it is just a simple code for demo purposes only; you can write your own more sophisticated code for blinking by TPMx device with Init_TPM component if you want). In case of POR reset one blink of the green LED is processed. When the reset/wakup state is served by the our application code the VLLS1 mode can be entered. As the first step, we need to be sure that there are not any interrupt flags set to wake-up the CPU from VLLS1 mode so we clear LLWU and SW2 pin (PTB0) interrupt flags and then we enter VLLS1 mode by using enter_vllsx function: /* clear LLWU flag for the selected pin 4 - PTB0 */ LLWU_F1 |= LLWU_F1_WUF4_MASK; /* clear interrupt flag of the SW2 pin - PTB0 */ PORTB_PCR0 |= PORT_PCR_ISF_MASK; // enter the VLLS3 //enter_vllsx((smc_por_option_t)NULL,kSmcStopSub3); // enter the VLLS0 - RTC and LPTMR do not work becuase of external crystal clock source does not work in the VLLS0 mode //enter_vllsx(kSmcPorEnabled, kSmcStopSub0); // enter the VLLS1 enter_vllsx((smc_por_option_t)NULL,kSmcStopSub1); // switch the green LED on - error state when the VLLSx mode is not entered GPIO_HAL_ClearPinOutput(GPIOB_BASE,LED_GREEN_PIN);  There is also code for switching on the green LED in case the VLLS1 mode is not entered (indication of the error state). The enter_vllsx function is defined by the following way (it is used existing function from a demo KSDK demo example): /* * VLLSx mode entry routinue */ static void enter_vllsx(smc_por_option_t PORPOValue, smc_stop_submode_t VLLSValue) {        smc_power_mode_config_t smcConfig;        /* set power mode to specific VLLSx mode */        smcConfig.porOption = true;        smcConfig.porOptionValue = (smc_por_option_t) PORPOValue;        smcConfig.powerModeName = kPowerModeVlls;        smcConfig.stopSubMode = (smc_stop_submode_t) VLLSValue;        SMC_HAL_SetMode(SMC_BASE, &smcConfig); } It is all code we need for our low power demo application. The application can be built and run now. 'Invoking: Cross ARM GNU Create Listing' arm-none-eabi-objdump --source --all-headers --demangle --line-numbers --wide "Low power demo KL03.elf" > "Low power demo KL03.lst" 'Finished building: Low power demo KL03.lst' ' ' 'Invoking: Cross ARM GNU Print Size' arm-none-eabi-size --format=berkeley "Low power demo KL03.elf" text         data          bss          dec          hex      filename 7828          112          896         8836         2284      Low power demo KL03.elf 'Finished building: Low power demo KL03.siz' ' ' Note: You can see that the code size has increased because SDK functions have been used in the application. This is partly due to usage assert function that allows reporting of error by using standard libraries. If you needn’t this functionality and you need just a compact code (to decrease the power consumption) you can do it by the following way: Open Properties of the Low power demo KL03 application, select C/C++Build/Settings, on the Tool Settings tab, select Cross ARM C Compiler/Preprocessor and add NDEBUG symbol in the Defined symbols list: When you Clean and Build the application again the code size is reduced: 'Invoking: Cross ARM GNU Print Size' arm-none-eabi-size --format=berkeley "Low power demo KL03.elf" text         data          bss          dec          hex      filename 3192          108          876         4176         1050      Low power demo KL03.elf 'Finished building: Low power demo KL03.siz' ' ' 08:20:28 Build Finished (took 15s.886ms) There is also additional step that allows you to reduce the code size of the application. You can set Optimization Level of GNU C tools. Open Properties of the Low power demo KL03 application, select C/C++Build/Settings, on the Tool Settings tab, select Optimization and set the Optimization Level to requested value (please note that some of the level are not suitable for debugging): Debugging The application contain predefined  debug connect by default. . When you open the context menu of the project in the Project Explorer window and select Debug As/Debug Configurations.... The Debug Configurations window is opened and you can select and configure all predefined debug configurations (OpenOCD, PE Micro, Segger J-link). The default configuration can be easily used with the Freedom board (OpenSDA interface – j-link or PE Micro). You can just select the right debug connection and click on the Debug for debugging of your application. In the Debug Configuration window open the GDB SEGGER J-Link Debugger  group and select the Low power demo KL03 Debug configuration. See the Debugger tab, there is already filled MKL03Z32xxx4 Device name. Uncheck Allocate console for semihosting and SWO (SWO is not support by OpenSDA SEGGER J-link). Go to on Startup tab and uncheck the Enable SWO option (SWO is not supported by OpenSDA SEGGER J-link). Click on the Apply and Debug button and the debugger starts (you must have the FRDM-KL03Z board connect to the workstation). You can now start the application (click on the Resume button) and check the functionality. The debugger is disconnected due to VLLS1 mode entry. But the application run and can be used. If you want to connect a button for the LPTMR pulses generating you can connect one pin of the button to the PTB6 on pin #4 of 8-pins connector J1 and the second pin of the button to the GND to the pin #7 of the 10-pins connector J2, see below: You can use this demo application as a start point of your real low power application. I hope it will help you and save your time of your first low power application implementation in the Processor Expert. There is also possible to measure power consumption of the CPU in VLLS1 mode. It is described in the FRDM-KL03 User Guide. Just unsolder R27 and R28 and solder a header pins to J10 position of the board. You must use jumper for J10 now to connect power supply for the CPU and when the jumper is removed you can use these two pins to measure the energy consumption of the CPU (e.g. by a multimeter)
View full article
AMF-ACC-T1659 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 除了故障安全系统架构之外,容错能力在高度自动化的汽车中也变得越来越重要。本次会议讨论了容错系统架构的理论基础,并展示了如何使用飞思卡尔微控制器构建这些架构,特别是在高级驾驶辅助系统 (ADAS) 领域。利用飞思卡尔汽车产品组合中内置的关键功能安全概念,可以实现高效、可扩展的解决方案,涵盖从故障安全系统到容错和故障运行架构的范围。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 除了故障安全系统架构之外,容错能力在高度自动化的汽车中也变得越来越重要。本次会议讨论了容错系统架构的理论基础,并展示了如何使用飞思卡尔微控制器构建这些架构,特别是在高级驾驶辅助系统 (ADAS) 领域。利用飞思卡尔汽车产品组合中内置的关键功能安全概念,可以实现高效、可扩展的解决方案,涵盖从故障安全系统到容错和故障运行架构的范围。
View full article
APF-ACC-T1551の <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> このセッションでは、オートモーティブ・アプリケーションに最適なFreescale i.MX 6シリーズのアプリケーション・プロセッサの多くのインタフェースについて説明します。 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> このセッションでは、オートモーティブ・アプリケーションに最適なFreescale i.MX 6シリーズのアプリケーション・プロセッサの多くのインタフェースについて説明します。
View full article
如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 本文件介绍了一种方法,即在项目运行于 Flash 内存时,从 RAM 中执行选定函数。 具体做法是在链接器文件 (.ld) 中创建一个自定义链接器部分,相关例程应放置在这个部分中。如果您不关心函数在 RAM 中的具体位置,那么这一步骤是可选的。在这种情况下,可以改用默认部分。 MEMORY {       flash_rchw : org = 0x00FA0000,   len = 0x4     cpu0_reset_vec : org = 0x00FA0000+0x10,   len = 0x4     cpu1_reset_vec : org = 0x00FA0000+0x14,   len = 0x4     cpu2_reset_vec : org = 0x00FA0000+0x04,   len = 0x4                  m_my_flash :     org = 0x01000000, len = 4K       // optional - this is dedicated section for the RAM function rom image     m_text :         org = 0x01001000, len = 5628K    // default section for code       m_my_ram :       org = 0x40000000, len = 4K       // optional - specific section where a RAM routine(s) should be copied into     m_data :         org = 0x40001000,  len = 764K    // default section for data/stack/heap }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 如果您打算将需要从 RAM 执行的例程保留在特定的自定义部分中,可按以下方式操作: SECTIONS { ... .MyRamCode : {    MY_RAM_START = .;       // this symbol is optional    KEEP (*(.MyRamCode))    // KEEP - avoid dead stripping if an object is not referenced    MY_RAM_END = .;         // this symbol is optional } > m_my_ram AT>m_my_flash // the section above is linked into m_my_ram and Rom image is stored into m_my_flash‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 否则,如果您不在意例程的位置,可以使用默认的内存区域来存储代码/数据: SECTIONS { ... .MyRamCode  : {     MY_RAM_START = .;     // this symbol are optional     KEEP (*(.MyRamCode))  // KEEP - avoid dead stripping if an object is not referenced     MY_RAM_END = .;       // this symbol are optional }  > m_data  AT>m_text    // the section is linked into default data memory area and its rom image is placed into the default code memory ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 将__attribute__语句添加到 RAM 函数原型中。函数属性 “longcall” 是从闪存调用此 RAM 函数所必需的。 __attribute__ ((section(".MyRamCode")))              // place the function below into .MyRamCode section int test_RAM(int arg1) __attribute__ ((longcall));   // declare the function as "far"‍‍‍‍ 默认的 S32DS 项目启动时仅初始化默认的数据段。因此,如果函数被放置在自定义段中,则必须手动执行段复制。这必须在调用 RAM 例程之前完成,例如在 main() 函数的开头或在启动例程中。 您可以创建一些链接器符号(.MyRamCode RAM 和 ROM 地址和大小),并将它们导入到实现 copy-down 的模块中。 __MY_RAM_ADR = ADDR (.MyRamCode); __MY_RAM_SIZE = SIZEOF (.MyRamCode); __MY_RAM_ROM_ADR = LOADADDR (.MyRamCode);‍‍‍‍‍‍ 最终的源文件可能如下所示: #include extern unsigned long __MY_RAM_ADR; extern unsigned long __MY_RAM_ROM_ADR; extern unsigned long __MY_RAM_SIZE; __attribute__ ((section(".MyRamCode")))              // place the function below into .MyRamCode section int test_RAM(int arg1) __attribute__ ((longcall));   // declare the function as "far" ... void main(void) {    int counter = 0;    memcpy(&__MY_RAM_ADR , &__MY_RAM_ROM_ADR, &__MY_RAM_SIZE);  // copy the function from flash to RAM    counter = test_RAM(counter);                                // call the function ... }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ 希望对您有帮助! Stan 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Duke ,相关组件其实已经包含在内了。您可以直接安装最新累积更新版: https://community.nxp.com/docs/DOC-341653。 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 太棒了! 我们正在等待这个问题的官方补丁。 感谢您的更新,Alexander 和 NXP S32DS 支持团队。 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> cmpe200gcc-181 已修复了适用于 Power Architecture 的 S32 设计工作室 2017.R1-更新 2 中已发布的编译器中的 cmpe200gcc-181 相关问题 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 尊敬的公爵!   非常感谢您。这在我的 MPC5746C 开发板上运行正常,我将 m_text 移动到了 0x00FE0400,此前曾出现启动失败的情况。 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 和 Folkert 的情况一样, 仅ecrti.o在我看来,是需要进行修改的。 如果您能追踪您的代码,您就能找到哪个部分有问题。 如果那不是我提到的 4 字节对齐的代码。 可能您可以使用相同的方法来修复您的代码。 或者,将问题点发布在反汇编代码中。 祝您好运。 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 尊敬的公爵! 非常感谢您。这似乎有帮助!(使用 MPC5745R) 顺祝商祺,Folkert 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 我遇到了同样的问题,您解决了吗? 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 我针对此问题找到的解决方案是调整文件 ELe200/src_gcc/libgcc/config/rs6000/eabivle-ci.S:在 init 函数的实现中,我添加了 se_nop 指令以强制执行 4 字节填充(在 VLE 架构中此填充并非隐式,而在 Booke 架构中是隐式的)。 /* Head of __init function used for static constructors. */ #ifdef __VLE__ .section".init","axv"#else .section".init","ax"#endif .align2FUNC_START(__init) #ifdef __VLE__ e_stwu 1,-16(1) se_mflr 0 se_nop e_stw 0,20(1)#else stwu 1,-16(1) mflr 0 stw 0,20(1)#endif 遗憾的是,应用此变通方法需要重建编译器。 此致, 埃尔克 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 大家好, 感谢您报告此问题! 我可以确认这是一个 e200 gcc 链接器缺陷(缺陷编号:CMPE200GCC-181),目前正在由编译器团队进行调查。 这在 ARM gcc (S32DS for ARM) 上运行良好。 我会随时向您汇报进展情况。 谢谢! Stan 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 您解决这个问题了吗?或许您的想法是正确的,那么我们该如何避免出现这种情况呢? 回复:如何在 S32 Design Studio 中从 RAM 运行例程 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 使用 S32 Studio for powerpc v1.2 时也有相同经历;更简单的复制方法如下: - 新项目 >> MPC5674F - 选择库 NewLib Nano - 在 main.c 中添加了 ram 函数 - 添加了 .ramfuncs将输入部分转换为 .data部分(将通过初始化进行复制) main.c: #include "derivative.h" /* include peripheral declarations */ extern void xcptn_xmpl(void); int counter = 0; #define RAMFUNC __attribute__ ((longcall, section(".ramfuncs"))) RAMFUNC void ramcall(void) {    counter+=2; } int main(void) {    xcptn_xmpl ();    for(;;) {       counter++;       ramcall();    } } 56xx_flash.ld .... .data : { *(.data) *(.data.*) *(.ramfuncs) } > m_data AT>m_text ... 在主入口点生成反汇编 (main >> __eabi >> __init) 00004438 <__init>: 4438: 18 21 06 f0 e_stwu r1,-16(r1) 443c: 00 80 se_mflr r0 443e: 54 01 00 14 e_stw r0,20(r1) 4442: 00 00 se_illegal 4444: 79 ff fc ad e_bl 40f0 4448: 79 ff fd b9 e_bl 4200 <__do_global_ctors_aux> 444c: 50 01 00 14 e_lwz r0,20(r1) 4450: 00 90 se_mtlr r0 4452: 20 f1 se_addi r1,16 4454: 00 04 se_blr 4456: 50 01 18 21 e_lwz r0,0(r1) 似乎 long call 会触发 init trampoline 上的错误对齐;调试/发布(flash)目标都会出现问题(在 Debug_RAM 中代码已在 RAM 中,所以不会触发问题)。 希望对您有所帮助。
View full article
I.MXRT1021 Flash Operation Demo on FreeRTOS in XIP Mode        由于RT系列没有内置 Flash,大多数用户会选择外部 QSPI Flash 作为应用代码和数据的非易失存储设备,同时外部Flash的大容量在满足用户代码存储需求之外也会为用户提供了足够的灵活空间存储应用数据,但是其中涉及到的对数据读擦写以及用户的应用程序均需要在外部 Flash 执行,这为 Flash 的操作带来了麻烦。        对于在XIP(eXecute-In-Place)模式下的应用,对Flash读擦写的操作需要在内部 RAM 里执行,而RT系列由于高主频而引入了内核 Dcache 以及 Flexspi 模块自带的 Pre-fetch 功能,对外部 Flash 的操作会有很多需要注意的地方,这些问题在带有 RTOS 的系统里则更是突显出来,而无论在 XIP 模式下的裸机还是基于 RTOS 方式对 Flash 的操作,SDK 里均没有提供例程可供参考。        本参考方案来自很多客户的实际应用需求,所以编写了基于 FreeRTOS 下的对片外 QSPI Flash 的读擦写操作,客户可以基于此例程移植到自己的应用里面做相关的应用开发,并配套对应的指导文档提醒用户在移植过程中需要注意的几个常见的 tips。 Products Product Category NXP Part Number URL MCU MIMXRT1021 i.MX RT1020 Crossover MCU with Arm® Cortex®-M7 core MCUXpresso SDK Software SDK v2.6.1 Welcome | MCUXpresso SDK Builder    Tools NXP Development Board URL MIMXRT1020-EVK MIMXRT1020-EVK: i.MX RT1020 Evaluation Kit Industrial
View full article
Porting PN7160 to Android 14 on i.MX8M Nano board Recently NXP released a combined NCI stack for both PN7160 and Pn7220. The newest Android 14 porting guide AN14430 brings the two (PN7160 and PN7220) together.   The pros are it is easy to maintain, and faster integration and switching between products.  The cons are when you are using PN7160, you will see for APIs for PN7220, including EMVCo and TDA API. When you are using PN7220 also APIs for PN7160 can be seen (card emulation on PN7160).  This article is a step-by-step guide on how to build AOSP for PN7160 with the new combined NCI stack.  1  Hardware setup   i.MX 8M Nano Evaluation Kit | NXP Semiconductors   OM27160| Development Kits for PN7160 Plug’n Play NFC Controller | NXP Semiconductors   The connection between i.MX8M Nano and PN7160 OM29110ARD-B i.MX8M Nano EVK pin PN7160  OM29110ARD-B 3.3V J1003-1 VDD(3.3v) J1-4 5V J1003-2 VBAT (5v) J1-5  SDA.1 J1003-3 SDA J2-2 SCL.1 J1003-5 SCL J2-1 GPIO.25 J1003-37 IRQ J2-10 GPIO.28 J1003-38 REQ J4-2 GND J1003-39 GND J1-6 GPIO.29 J1003-40 VEN J4-1 2    Get AOSP for i.MX Nano Follow Android porting guide. https://www.nxp.com/docs/en/user-guide/ANDROID_USERS_GUIDE.pdf .2.1  Download i.MX Android BSP (Android14.0.0_1.2.0) from below link.  Android OS for i.MX Applications Processors | NXP Semiconductors   You will get the package imx-android-14.0.0_1.2.0.tar.gz    .2.2 Decompressing android BSP # tar -xvzf imx-android-1c4.0.0_1.2.0.tar.gz  When decompression is done, imx-android-14.0.0_1.2.0 subdirectory is created, in the folder, we can find imx_android_setup.sh, which is script for downloading android source code and commands for patching i.MX android bsp to AOSP. .2.3 Downloading Android source code # source ./imx-android-14.0.0_1.2.0/imx_android_setup.sh  The folder structure after AOSP downloading complete.  3     AOSP Adaptation NXP adds modifications to the AOSP code. Next, we add them step by step according to AN14430, move the content of them into correct folder in AOSP code base. .3.1  nxp_nci_hal_nfc #git clone "https://github.com/nxp-nfc-infra/nxp_nci_hal_nfc.git" #cd nxp_nci_hal_nfc #git checkout br_ar_14_comm_infra_dev #cp -rf *  ../android_build/packages/apps/Nfc/ #cd .. .3.2 nxp_nci_hal_libnfc-nci #git clone "https://github.com/nxp-nfc-infra/nxp_nci_hal_libnfc-nci.git" #cd nxp_nci_hal_libnfc-nci #git checkout br_ar_14_comm_infra_dev #cp -rf *  ../android_build/system/nfc/ #cd .. .3.3 nfcandroid_nfc_hidlimpl #git clone "https://github.com/nxp-nfc-infra/nfcandroid_nfc_hidlimpl.git" #cd nfcandroid_nfc_hidlimpl #git checkout br_ar_14_comm_infra_dev #cp -rf *  ../android_build/hardware/nxp/nfc #cd .. .3.4 nfcandroid_frameworks #git clone "https://github.com/nxp-nfc-infra/nfcandroid_frameworks.git" #cd nfcandroid_frameworks #git checkout br_ar_14_comm_infra_dev #mkdir ../android_build/vendor/nxp/frameworks #cp -rf * ../android_build/vendor/nxp/frameworks #cd .. .3.5 nfcandroid_emvco_aidlimpl #git clone "https://github.com/nxp-nfc-infra/nfcandroid_emvco_aidlimpl.git" #cd nfcandroid_emvco_aidlimpl #git checkout br_ar_14_comm_infra_dev #mkdir  ../android_build/hardware/nxp/emvco #cp -rf *  ../android_build/hardware/nxp/emvco #cd .. .3.6   nfcandroid_platform_reference #git clone "https://github.com/nxp-nfc-infra/nfcandroid_platform_reference.git" #cd nfcandroid_platform_reference #git checkout br_ar_14_comm_infra_dev #cp -rf vendor/nxp/*   ../android_build/vendor/nxp/ #cd .. .3.7 nfcandroid_infra_test_apps # git clone https://github.com/nxp-nfc-infra/nfcandroid_infra_test_apps.git # cd nfcandroid_infra_test_apps/ # git checkout br_ar_14_comm_infra_dev # cd test_apps/ # cp -rf SMCU_Switch/  ../../android_build/packages/apps/ # cp -rf EMVCoModeSwitchApp/  ../../android_build/packages/apps/Nfc/ # cd ../.. .3.8  nfcandroid_infra_comm_libs #git clone "https://github.com/nxp-nfc-infra/nfcandroid_infra_comm_libs.git" #cd nfcandroid_infra_comm_libs #git checkout br_ar_14_comm_infra_dev #cp -rf nfc_tda/  ../android_build/system/ #cp -rf emvco_tda/ emvco_tda_test/  ../android_build/hardware/nxp/emvco/ #cp -rf NfcTdaTestApp/  ../android_build/packages/apps/Nfc/ #cd .. After AOSP adaptation, folder is like below.  4   Apply AOSP patches please see AN14430, page10   # patch -p1 <  ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_build_bazel.patch #patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_build_make.patch # patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_build_soong.patch # patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_frameworks_base.patch #patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_frameworks_native.patch #patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_frameworks_proto_logging.patch #patch -p1 < ../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_system_logging.patch #patch -p1 < ../../../../nfcandroid_platform_reference/build_cfg/build_pf_patches/AROOT_packages_modules_Bluetooth.patch  5    Adding the driver support. .5.1  get nfcandroid_platform_drivers from github #git clone "https://github.com/nxp-nfc-infra/nfcandroid_platform_drivers.git" #cd nfcandroid_platform_drivers #git checkout br_ar_14_comm_infra_dev #cd .. .5.2Create a folder named pn7160 under android_build/vendor/nxp-opensource/kernel_imx/drivers/nfc Copy below kernel drivers file from “nfcandroid_platform_drivers/drivers/pn7160/nfc/nfc “ into  “android_build/vendor/nxp-opensource/kernel_imx/drivers/nfc/pn7160/” Common.c  common.h   i2c_drv.c  i2c_drv.h spi_drv.h  spi_drv.c  Makefile  Kconfig Result of copying: .5.3 Modify makefile Replace Makefile default code with following code,  only add i2c for simplifying.  Now we need to add pn7160 Makefile and Kconfig to main Makefile and Kconfig Makefile Kconfig 6   Adding device tree Device tree is important since we need to tell our controller which pins we want to use for communication (this is always different between host controllers) The device tree need to be added into: “vendor/nxp-opensource/kernel_imx/arch/arm64/boot/dts/freescale” Create file with name “imx8mn-evk-pn7160.dts”, open the file and add following lines: Next task is to add .dts file into Makefile in the following location: . vendor/nxp-opensource/kernel_imx/arch/arm64/boot/dts/freescale Open Makefile and add: Final step is to add NXP_NCI_I2C as module in following file: . vendor/nxp-opensource/kernel_imx/arch/arm64/configs/imx8mn_gki.fragment Open imx8mn_gki.fragment and add: 7    Add device specific changes          The location of the device specific changes in under folder            . device/nxp/imx8m/evk_8mn 7.1 BoardConfig.mk        7.2 ShareBoardConfig.mk  7.3 compatibility_matrix.xml  7.4 device_framework_matrix.xml  7.5 evk_8mn.mk Add .mk files to specific device.mk and some product package directly to device.mk file so everything is build together with Android.   7.6 init.rc 7.7manifest.xml 7.8 ueventd.nxp.rc        Add permissions for drivers    8    Additional change in compatibility matrix Put changes into hardware/interfaces/compatibility_matrices Compatibility_matrix_8.xml  9    add changes into NXP mk files . android_build/vendor/nxp/nfc/device-nfc.mk  .android_build/vendor/nxp/emvco/device-emvco.mk    10    Build Android First , the source build/envsetup.sh command is executed to import shell functions that are defined in ${MY_ANDROID}/build/envsetup.sh. Then, the lunch evk_8mn-userdebug command is executed to set up the build configuration. #source build/envsetup.sh #lunch evk_8mn-userdebug   Possible build failures This error resulted from the incompatibility of file Kconfig, please use dos2unix command to fix it.  For some other redefine issues, please do the following. Go into file hardware/nxp/nfc/snxx/ Name Android.bp to _Android.bp Go into hardware/nxp/nfc/snxx/halimpl/power-tracker/ Name Android.bp to _Android.bp Go into file hardware/nxp/secure_element/snxxx/aidl/ Name Android.bp to _Android.bp Remove : pn8xx from hardware/nxp/ Remove : frameworks/base/core/res/res/values/config.xml.orig 11   Download build and flash images Go into “android_build/out/target/product/evk_8mn” and download all files without folders . When downloaded, open following two files and add: .in fastboot_imx_flashall.bat   .in uuu_imx_android_flash.bat   Change switches on i.MX8M Nano .    Flashing Android: when flashing Android images .    Running Android:  when images are flashed, put switches to Running Android and Android OS will start. Flash images .  Put i.MX8 to “Flash Android” .  Open a PowerShell as admin in the location where download images are .  Running following command .  ./uuu_imx_android_flash.bat -f imx8mn -a -d pn7160 12  Firmware update Download the FW from Github Open terminal at the FW location Run the following commands • adb push libpn7160_fw.so vendor/lib64/libpn7160_fw.so (for 64-bit version) and adb                  push libpn7160_fw.so vendor/lib/libpn7160_fw.so (for 32-bit version) • adb shell svc nfc disable • adb shell svc nfc enable    References: PN7160/PN7220 – Android 14 porting guide UG10156 : Android User’s Guide  Build Andriod image for PN7160 on i.MX8M Nano:  Andraz this is a step by step guider to port PN7160 to Android 14 on i.MX 8M Nano board NFC Controller Solutions
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
RT1176 PWM startup failed I am using PWM + fault + QTimer to implement motor pulse control, but the PWM3 submodule 0 PWM_A channel occasionally fails to start, where after the first high level it remains constant and subsequent pulses do not appear.After the inspection, it was found that the "run" bit of the pwm was not correctly set. Even though repeated startup operations were added in the program later, this anomaly still occurred. Re: RT1176 PWM startup failed Hi @liu626, Are you using a custom board or an EVK? If you are using the EVK, did you make any rework to it? Could you share the configuration you are using for PWM3? Are you using an example as a reference? If so, which one? If you try to replicate the issue using a project with only PWM3, does the problem persist? Does this only happen with PWM3 submodule 0 PWM_A channel? Has this occurred on other PWM modules or submodules? Is there any other task or interrupt that manipulates PWM3 registers and could affect or overwrite the run bit? Best Regards, Pablo Re: RT1176 PWM startup failed hi,I used a custom circuit board. I didn't refer to any examples. This was a problem that was discovered during the official development of the project. I configured six PWM channels for pulse control. Only this channel had problems, while no such issue occurred on the other sub-modules. I checked and found that only this channel was using the PWM3 module. No other interfering factors were detected. Below is my configuration. static axis_ctrl_t g_axes[AXIS_NUM] = { { .id = AXIS_X1, .name = "X1", .pwmBase = PWM1, .pwmModule = kPWM_Module_0, .pwmChannel = kPWM_PwmA, .tmrBase = TMR3, .lowCh = kQTMR_Channel_2, .highCh = kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin, .cascadePcs = 6U, .faultNum = 0U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_X2, .name = "X2", .pwmBase = PWM2, .pwmModule = kPWM_Module_0, .pwmChannel = kPWM_PwmA, .tmrBase = TMR2, .lowCh = kQTMR_Channel_0, .highCh = kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin, .cascadePcs = 4U, .faultNum = 0U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_Y, .name = "Y", .pwmBase = PWM3, .pwmModule = kPWM_Module_0, .pwmChannel = kPWM_PwmA, .tmrBase = TMR3, .lowCh = kQTMR_Channel_0, .highCh = kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin, .cascadePcs = 4U, .faultNum = 0U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_Z, .name = "Z", .pwmBase = PWM4, .pwmModule = kPWM_Module_0, .pwmChannel = kPWM_PwmA, .tmrBase = TMR1, .lowCh = kQTMR_Channel_0, .highCh = kQTMR_Channel_1, .tmrInputsrc=kQTMR_ClockCounter0InputPin, .cascadePcs = 4U, .faultNum = 0U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_EX1, .name = "EX1", .pwmBase = PWM1, .pwmModule = kPWM_Module_1, .pwmChannel = kPWM_PwmA, .tmrBase = TMR1, .lowCh = kQTMR_Channel_2, .highCh = kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin, .cascadePcs = 6U, .faultNum = 1U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, { .id = AXIS_EX2, .name = "EX2", .pwmBase = PWM2, .pwmModule = kPWM_Module_1, .pwmChannel = kPWM_PwmA, .tmrBase = TMR2, .lowCh = kQTMR_Channel_2, .highCh = kQTMR_Channel_3, .tmrInputsrc=kQTMR_ClockCounter2InputPin, .cascadePcs = 6U, .faultNum = 1U, .hwExactSupported = true, .outTrigMask = kPWM_ValueRegisterMask_3, }, };static void APP_Init_PWM_QTMR(void) { pwm_config_t pwmConfig; pwm_fault_param_t faultConfig; qtmr_config_t qtmrConfig; PWM_GetDefaultConfig(&pwmConfig); pwmConfig.pairOperation = kPWM_Independent; pwmConfig.reloadLogic = kPWM_ReloadImmediate; PWM_FaultDefaultConfig(&faultConfig); faultConfig.faultLevel = true; faultConfig.enableCombinationalPath = false; faultConfig.faultClearingMode = kPWM_ManualSafety; faultConfig.recoverMode = kPWM_NoRecovery; QTMR_GetDefaultConfig(&qtmrConfig); CLOCK_EnableClock(kCLOCK_Qtimer1); CLOCK_EnableClock(kCLOCK_Qtimer2); CLOCK_EnableClock(kCLOCK_Qtimer3); PWM_StopTimer(PWM1, 0x0FU); PWM_StopTimer(PWM2, 0x0FU); PWM_StopTimer(PWM3, 0x0FU); PWM_StopTimer(PWM4, 0x0FU); pwm_fault_input_filter_param_t faultFilter; faultFilter.faultFilterPeriod = 255U; faultFilter.faultFilterCount = 7U; faultFilter.faultGlitchStretch = false; /* 记录每个 PWM 实例上已配置的 fault channel,避免重复设置 */ uint16_t pwm1FaultDone = 0U, pwm2FaultDone = 0U, pwm3FaultDone = 0U, pwm4FaultDone = 0U; for (uint8_t i = 0U; i < AXIS_NUM; i++) { axis_ctrl_t *ax = &g_axes[i]; PWM_Init(ax->pwmBase, ax->pwmModule, &pwmConfig); PWM_SetupFaults(ax->pwmBase, (pwm_fault_input_t)ax->faultNum, &faultConfig); /* 故障滤波(每个 PWM 实例的每个 fault channel 只设一次) */ { uint16_t *faultDone; if (ax->pwmBase == PWM1) faultDone = &pwm1FaultDone; else if (ax->pwmBase == PWM2) faultDone = &pwm2FaultDone; else if (ax->pwmBase == PWM3) faultDone = &pwm3FaultDone; else faultDone = &pwm4FaultDone; uint16_t faultBit = (uint16_t)(1U << ax->faultNum); if ((*faultDone & faultBit) == 0U) { PWM_SetupFaultInputFilterExt(ax->pwmBase, (pwm_fault_channels_t)ax->faultNum, &faultFilter); *faultDone |= faultBit; } } /* Fault 时输出低电平 */ ax->pwmBase->SM[ax->pwmModule].OCTRL &= ~(PWM_OCTRL_PWMAFS_MASK | PWM_OCTRL_PWMBFS_MASK); APP_PWM_Unmap_Selected_Fault(ax); APP_PWM_ClearFault_Safe(ax); ax->pwmBase->SM[ax->pwmModule].INIT = 0U; ax->pwmBase->SM[ax->pwmModule].VAL0 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL1 = 1U; ax->pwmBase->SM[ax->pwmModule].VAL2 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL3 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL4 = 0U; ax->pwmBase->SM[ax->pwmModule].VAL5 = 0U; ax->pwmBase->SM[ax->pwmModule].TCTRL = PWM_TCTRL_OUT_TRIG_EN(ax->outTrigMask); APP_PWM_Disable_Output(ax); if (ax->hwExactSupported) { qtmrConfig.primarySource = ax->tmrInputSrc; QTMR_Init(ax->tmrBase, ax->lowCh, &qtmrConfig); QTMR_Init(ax->tmrBase, ax->highCh, &qtmrConfig); ax->tmrBase->CHANNEL[ax->lowCh].CTRL = TMR_CTRL_CM(kQTMR_PriSrcRiseEdge) | TMR_CTRL_PCS(ax->tmrInputSrc); ax->tmrBase->CHANNEL[ax->highCh].CTRL = TMR_CTRL_CM(kQTMR_CascadeCount) | TMR_CTRL_PCS(ax->cascadePcs); APP_QTMR_Disable_Low_OFLAG_Output(ax); QTMR_DisableInterrupts(ax->tmrBase, ax->lowCh, 0xFFU); QTMR_DisableInterrupts(ax->tmrBase, ax->highCh, 0xFFU); QTMR_ClearStatusFlags(ax->tmrBase, ax->lowCh, 0xFFU); QTMR_ClearStatusFlags(ax->tmrBase, ax->highCh, 0xFFU); } ax->phase = kAxisIdle; ax->armed = false; ax->running = false; ax->done = true; #if HARD_PWM_STATE_GUARD_ENABLE APP_StateGuard_Reset(ax); #endif } /* 使能 QTMR 中断 */ NVIC_SetPriority(TMR1_IRQn, 2U); NVIC_SetPriority(TMR2_IRQn, 2U); NVIC_SetPriority(TMR3_IRQn, 2U); EnableIRQ(TMR1_IRQn); EnableIRQ(TMR2_IRQn); EnableIRQ(TMR3_IRQn); }static bool APP_PWM_Config_Pulse(axis_ctrl_t *axis, uint32_t highCnt400M, uint32_t lowCnt400M) { pwm_clock_prescale_t prescale; uint16_t periodTicks; uint32_t totalCnt400M = highCnt400M + lowCnt400M; if ((axis == NULL) || (totalCnt400M == 0U)) return false; if (!APP_PWM_SelectPrescaler_FromPeriodCnt400M(totalCnt400M, &prescale, &periodTicks)) return false; uint32_t highTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)highCnt400M + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); if (highTicks32 == 0U) highTicks32 = 1U; if (highTicks32 >= periodTicks) highTicks32 = (uint32_t)periodTicks - 1U; uint32_t riseTicks32 = 0U; uint32_t fallTicks32 = highTicks32; #if HARD_PWM_LOW_START_PHASE_ENABLE uint32_t lowTicks32 = (uint32_t)periodTicks - highTicks32; if (lowTicks32 >= (2U * HARD_PWM_LOW_START_PHASE_MIN_TICKS)) { uint32_t desiredLeadCnt400M = highCnt400M; uint32_t minLeadCnt400M = (uint32_t)HARD_PWM_LOW_START_PHASE_MIN_US * 400U; if (desiredLeadCnt400M < minLeadCnt400M) desiredLeadCnt400M = minLeadCnt400M; uint32_t desiredLeadTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)desiredLeadCnt400M + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); if (desiredLeadTicks32 < HARD_PWM_LOW_START_PHASE_MIN_TICKS) desiredLeadTicks32 = HARD_PWM_LOW_START_PHASE_MIN_TICKS; uint32_t maxRiseByHalfTicks32 = lowTicks32 / 2U; uint32_t postGuardTicks32 = (uint32_t)(((uint64_t)periodTicks * (uint64_t)(HARD_PWM_VAL3_POST_LOW_GUARD_US * 400U) + ((uint64_t)totalCnt400M / 2ULL)) / (uint64_t)totalCnt400M); if (postGuardTicks32 < HARD_PWM_VAL3_POST_LOW_GUARD_MIN_TICKS) postGuardTicks32 = HARD_PWM_VAL3_POST_LOW_GUARD_MIN_TICKS; uint32_t maxRiseByPostGuardTicks32 = (lowTicks32 > postGuardTicks32) ? (lowTicks32 - postGuardTicks32) : 0U; uint32_t selectedRiseTicks32; if (maxRiseByHalfTicks32 >= desiredLeadTicks32) { selectedRiseTicks32 = desiredLeadTicks32; if (selectedRiseTicks32 > maxRiseByHalfTicks32) selectedRiseTicks32 = maxRiseByHalfTicks32; } else if (maxRiseByPostGuardTicks32 >= desiredLeadTicks32) { selectedRiseTicks32 = desiredLeadTicks32; if (selectedRiseTicks32 > maxRiseByPostGuardTicks32) selectedRiseTicks32 = maxRiseByPostGuardTicks32; } else { selectedRiseTicks32 = maxRiseByPostGuardTicks32; } if (selectedRiseTicks32 >= HARD_PWM_LOW_START_PHASE_MIN_TICKS) { riseTicks32 = selectedRiseTicks32; fallTicks32 = riseTicks32 + highTicks32; } } #endif if (fallTicks32 >= (uint32_t)periodTicks) fallTicks32 = (uint32_t)periodTicks - 1U; uint16_t riseTicks = (uint16_t)riseTicks32; uint16_t fallTicks = (uint16_t)fallTicks32; PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), false); uint16_t ctrl = axis->pwmBase->SM[axis->pwmModule].CTRL; ctrl &= (uint16_t)(~PWM_CTRL_PRSC_MASK); ctrl |= PWM_CTRL_PRSC(prescale); axis->pwmBase->SM[axis->pwmModule].CTRL = ctrl; axis->pwmBase->SM[axis->pwmModule].INIT = 0U; axis->pwmBase->SM[axis->pwmModule].VAL0 = 0U; axis->pwmBase->SM[axis->pwmModule].VAL1 = (uint16_t)(periodTicks - 1U); if (axis->pwmChannel == kPWM_PwmA) { axis->pwmBase->SM[axis->pwmModule].VAL2 = riseTicks; axis->pwmBase->SM[axis->pwmModule].VAL3 = fallTicks; } else if (axis->pwmChannel == kPWM_PwmB) { axis->pwmBase->SM[axis->pwmModule].VAL4 = riseTicks; axis->pwmBase->SM[axis->pwmModule].VAL5 = fallTicks; } axis->pwmBase->SM[axis->pwmModule].TCTRL = PWM_TCTRL_OUT_TRIG_EN(axis->outTrigMask); PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), true); PWM_SetPwmLdok(axis->pwmBase, APP_PwmModuleMask(axis), true); axis->pwmConfigValid = true; axis->cachedHighCnt400M = highCnt400M; axis->cachedLowCnt400M = lowCnt400M; return true; } Re: RT1176 PWM startup failed Hi @liu626, Could you help me isolate the configuration and test whether the issue persists when only PWM3 is initialized? After reviewing the configuration, you shared and in order to try to replicate the behavior, I have the following questions: What is the definition of axis_ctrl_t? Are HARD_PWM_LOW_START_PHASE_ENABLE and HARD_PWM_STATE_GUARD_ENABLE enabled in your application? What do the following APP functions do? APP_PWM_Unmap_Selected_Fault APP_PWM_ClearFault_Safe APP_PWM_Disable_Output APP_QTMR_Disable_Low_OFLAG_Output APP_StateGuard_Reset APP_PWM_SelectPrescaler_FromPeriodCnt400M APP_PwmModuleMask Best Regards, Pablo Re: RT1176 PWM startup failed Thank you for your reply. The GPIO pin I'm using is GPIO_EMC_B1_29 of the rt1176."axis_ctrl_t" is the definition related to the motor shaft. * PWM output pulse -> Trigger XBAR signal -> Falling edge of pulse drives the external clock input of QTMR -> * QTMR 32-bit cascaded counter decrements by 1 -> When it reaches 0, triggers QTMR comparison interrupt -> Interrupt internally turns off PWM * At the same time, QTMR triggers the hardware Fault, directly pulling down the physical output pin of PWM. .id = AXIS_Y, .name = "Y", /* Used for serial port logging or breakpoint debugging to identify the Y-axis */ /* ================= PWM Output Resource Allocation ================= */ .pwmBase = PWM3, /* The Y-axis uses the FlexPWM3 module */ .pwmModule = kPWM_Module_0, /* Uses the sub-module 0 of PWM3 (each PWM has 4 sub-modules from 0 to 3) */ .pwmChannel = kPWM_PwmA, /* Uses the output pin of phase A of sub-module 0, corresponding to the physical pin GPIO_EMC_B1_29 */ /* ================= 32-bit QTMR cascaded count resource allocation ================= */ .tmrBase = TMR3, /* The Y-axis uses the QTMR3 peripheral (corresponding to IRQ interrupt number TMR3_IRQn) */ .lowCh = kQTMR_Channel_0, /* 16-bit low counter: uses channel 0 of TMR3 */ .highCh = kQTMR_Channel_1,/* 16-bit high counter: uses channel 1 of TMR3 */ /* 👉 .lowCh and .highCh are paired, and in the hardware level, they are automatically combined into a 32-bit counter */ /* ================= Configuration of Hardware Cascaded Clock Sources (Core Critical) ================= */ .tmrInputsrc=kQTMR_ClockCounter0InputPin, /* The clock source for Channel 0: Set to "External Pin Input 0". In the XBAR configuration, the falling edge of the pulse from PWM3 is connected to the input pin of Channel 0 of TMR3 through the XBAR. Therefore, every time a pulse is output by PWM, Channel 0 (16-bit) will perform a decrement operation once. */ .cascadePcs = 4U, /* Configuration of the clock source (PCS) for the high 16-bit channel (Channel 1). In the QTMR register of i.MX RT, the PCS value corresponds as follows: 0-3 = External pin input; 4 = Overflow/Termination event of Channel 0; 5 = Overflow/Termination event of Channel 1; 6 = Overflow/Termination event of Channel 2; 7 = Overflow/Termination event of Channel 3. Here, it is configured as 4U, meaning: Let "Channel 1 of TMR3" monitor the "Overflow event of Channel 0 of TMR3". HARD_PWM_LOW_START_PHASE_ENABLE and HARD_PWM_STATE_GUARD_ENABLE have been enabled. APP_PWM_Unmap_Selected_Fault Function: Remove the Fault pin mapping corresponding to the current axis. Call the underlying PWM_SetupFaultDisableMap function to disable the Fault. The purpose is: When the hardware Fault is not needed, prevent accidental external interference from causing the PWM to be turned off, facilitating the underlying debugging process. APP_PWM_ClearFault (original code function) Function: Clear the Fault status flag (axis->pwmBase->FSTS) of the PWM module. After triggering a hardware Fault, you must first clear this flag before the PWM can be allowed to restart. APP_PWM_Disable_Output Function: Immediately stop the PWM timer, force the pin to output a low level (PWM_SetPwmForceOutputToZero), and enable the output. Its purpose is to ensure that the pin does not output a high level due to being left floating or in the default state before the motor starts, which could cause the motor to move erratically. APP_QTMR_Disable_Low_OFLAG_Output Function: Disable the OFLAG (status flag) output of QTMR and force the OFLAG to be at a low level. In conjunction with the XBAR hardware, its role is to cut off the path from the QTMR output to the PWM Fault pin, preventing accidental triggering of Fault before startup. APP_StateGuard_Reset Function: Clears the counters and flags of the state guard (watchdog). This function is used to reset these protection variables before stopping or restarting the system if it encounters a long period of no pulse change or a deadlock when HARD_PWM_STATE_GUARD_ENABLE is enabled. APP_PWM_SelectPrescaler_FromPeriodCnt400M Function: This is a very core underlying frequency calculation function. It receives the total 400MHz count value of High + Low, and calculates how many prescalers (PRSC) and PWM periods (PERIOD) should be set in order to fit into the 16-bit PWM register. Please note: If the calculated period exceeds 65535 and the division coefficient is out of range, this function will return false, causing the motor to fail to start. APP_PwmModuleMask Function: Convert the index number of the PWM sub-module (for example, kPWM_Module_0 with the value 0) into a bit mask shifted left by N bits. Many of NXP's PWM registers (such as OUTEN, MCTRL) are controlled bit by bit. This function is responsible for generating the correct binary mask. Re: RT1176 PWM startup failed I have found the cause. It is because the internal load of the PIT interrupt in the cm4 core is too heavy, which has affected the PWM operation of the cm7 core. After I reduced the load of the PIT interrupt, the failure of PWM startup disappeared.
View full article
NFCカードを大量印刷するためのアドバイス NFCコミュニティの皆さん、こんにちは! クレジットカードサイズのType 4A NFCカードを、カスタム印刷を施した上で、10枚から200枚(場合によってはそれ以上)まとめて注文したいです。カードも印刷も高品質でなければなりません。カナダへの迅速な配送も必要です。 このような用途でおすすめできる会社やサプライヤーはありますか?この件に関しては、良いグループと長期的な関係を築きたいと思っています。 ご回答に感謝申し上げます。 Re: Advice for bulk printing NFC cards こんにちは、 @isenki さん。 あなたの調子が良いといいのですが。 タグ/カードの供給については、NTAG 424 DNA製品ページの「デザインリソース>エンジニアリングサービス」セクションをご覧ください。ここではタグおよびリーダーメーカー、ソリューションプロバイダ、システムインテグレーターのお問い合わせを見つけることができます。この製品をサポートする追加のパートナー商品を探すには、パートナー市場をご覧ください。 よろしくお願いいたします。 エドゥアルド。
View full article
ISP support for iMX95 FRDM Evaluation kit Hi Team, I am trying to port a Bayer sensor on the i.MX95 FRDM platform. Following the software setup guide below, I was able to connect and stream video using the NXP-supported OS08A20 camera module which was provided in the NXP website. Now, I would like to port and stream a different Bayer sensor. Is there any documentation available that explains: Where to obtain the libcamera source code and how to build it for the i.MX95 platform? How to generate ISP-specific YAML and configuration files for a new Bayer sensor? What camera driver parameters and controls are required to support a Bayer sensor on the i.MX95 FRDM platform? The complete software flow for integrating a new Bayer sensor with the NXP ISP pipeline? Can you please let me know at the earliest. Thanks Re: ISP support for iMX95 FRDM Evaluation kit Hello, Please refer to the following guide: https://www.nxp.com/docs/en/user-guide/UG10215.pdf Best regards/Saludos, Aldo.
View full article
关于 S32K311 的 ECU 核心配置说明 你好,@danielmartynek和团队 我们有一个关于核心配置的问题。在 S32K311(单核)上,生成的代码定义了: DET_NO_ECU_CORES = 4 NUMBER_OF_CORES = 4 鉴于我们面临内存限制: 我们可以安全地将这些简化为1吗? MCAL/DET 是否有任何副作用? 另外,有没有办法在 NXP 配置工具或其他配置中进行设置,而无需手动编辑生成的文件? 谢谢 & 问候, Yusup Khan S32K3 S32DS-ARM S32K31XEVB-Q100 Re: ECU Core Configuration Clarification on S32K311 你好,@yusupkhan241、 请参考 RTD 软件开发团队提供的以下回答: https://community.nxp.com/t5/S32K/RTD-memory-occupation/td-p/2148479 该参数无法通过配置工具进行配置,目前也没有计划支持此类功能。 此致, 丹尼尔
View full article
以太网摄像头同步流媒体传输解决方案 我们正在为汽车摄像头系统开发基于i.MX8MP的定制主板。我们在5.15.71恩智浦Yocto BSP上使用VPU硬件解码器,有一条有效的单摄像机H.264 RTP直播流水线。我们目前计划通过以太网交换机将系统扩展至支持4路同时传输的摄像头流。 该交换机将聚合4个100BASE-T1摄像头端口,并通过千兆RGMII上行链路连接至i.MX8MP EQOS MAC,每个摄像头均隔离在各自的VLAN中。 我们的显示屏分辨率为1280x800。要实现4路视频同时显示,每路视频只需占据屏幕的四分之一(约640×400或更低分辨率,30帧/秒),因此我们可以根据需要降低摄像头的分辨率。 1.是否有涵盖多通道视频解码的恩智浦i.MX8MP参考设计或应用说明可以作为起点? 2。H.264 VPU 解码器能否处理来自不同来源的多个独立实例,还是需要预解码组合步骤来减少进程和上下文切换的数量?如果需要进行图像合成,在 i.MX8MP 上推荐采用什么方法? 3. 从恩智浦的角度来看,针对此用例,总体推荐的软件架构是什么? 我们未来的应用是全景视图,因此可扩展性和低延迟是关键要求。 谢谢! Re: Simultaneous Ethernet Camera Streaming Solution 嗨@Wobaffet i.MX8MP 可以作为此 4 通道以太网 H.264 摄像机四视图应用的候选平台;然而,只有 i.MX8QM 和 i.MX95 具有环视参考设计。 推荐的架构适用于四个 RTP/H.264流进入单独的 GStreamer 管道,由 VPU 硬件解码器分别解码,解码后进行硬件辅助缩放和合成,输出显示在 1280×800 显示器上。不建议在 H.264 解码之前尝试合成,因为除非上游交换机或摄像机已经完成解码和重新编码,否则无法将单独的 H.264 流直接合成到压缩功能域中的单个显示帧中。 对于 4 路 640×400@30fps 的显示要求,根据像素速率的粗略估计,负载明显低于 1080p60 解码,因此这种方法是合理的。然而,这是否最终满足环视的低延迟和稳定性要求,还需要进行系统级验证,考虑实际的摄像机比特率、配置文件、GOP、RTP抖动、DDR带宽、GStreamer零拷贝路径和合成方法。 此致, 志明 Re: Simultaneous Ethernet Camera Streaming Solution 你好, 谢谢你的回答! 作为后续, 1. 我们计划同时运行 4 个独立的 GStreamer 流水线,每个流水线使用 VPU 硬件解码自己的 H.264 流。我们想确认 5.15.71 BSP 中的 VPU 驱动程序是否支持 4 个真正并发的解码实例。该电路板支持包中是否存在任何已知的配置或限制,会阻止所有四个流水线并行解码,或者是否需要调度方法?如果有,能否提供一些例子? 2. 我们的设置中,有一个以太网交换机,通过单个 RGMII 上行链路将 4 个摄像头连接到 i.MX8MP,每个摄像头都有自己的 VLAN。在 Linux 端,我们计划在 EQOS 端口上创建 VLAN 子接口,并让每个 GStreamer 管道从其自己的子接口接收 UDP/RTP。关于这一点有两个问题:5.15.71 电路板支持包。中的 EQOS 驱动程序是否开箱即用地正确支持 802.1Q VLAN 标记帧,还是需要任何额外的配置?对于在此 电路板支持包。 中在此接口上同时运行 4 个 UDP 流,是否有已知的接收路径调优建议? 谢谢您!  
View full article
iMX95 FRDM 套件电源 我正在阅读入门指南,但找不到任何提及额定电压的地方。我们能否将 iMX95 Verdin EVK 提供的 12V 电源用于 FRDM。套件中只提供了一条 C 到 C 的电缆,没有提供其他电源。 如果有人正在使用 FRDM 套件,请告诉我。 Re: Power supply for iMX95 FRDM kit FRDM‑i.MX95 板使用 CH344 USB-to‑UART 桥接器,而不是像 i.MX95 EVK 这样的 FTDI 设备。   您可以使用标准的终端工具,如 picocom、minicom 或 screen。对特定的 "CH343 工具 "没有限制。 如果 picocom 不能正常工作,问题通常与下列因素有关- 选择了正确的 /dev/ttyUSBx 端口(CH344 提供多个 UART),或 - 主机上的 CH34x 驱动程序缺失或不兼容。串行控制台配置为标准配置(115200-8N1)。 Re: Power supply for iMX95 FRDM kit 谢谢您的答复。我可以接通电源。 另外,串行控制台设置只有 CH343USB 可以使用吗?与 IMX95 EVK 类似,picocom 无法正常工作。 Re: Power supply for iMX95 FRDM kit 没有规定固定的 12 V 电压要求 唯一的要求是 使用 USB-PD 适配器 ≥ 65 W Re: Power supply for iMX95 FRDM kit 请说明所用 PD 的额定功率。是 12 伏吗?你能验证一下并与我们联系吗。谢谢 Re: Power supply for iMX95 FRDM kit 不是 — 你不应该在 FRDM‑i.MX95 板上使用 12 伏电源。 FRDM-i.MX95 设计为通过USB Type-C 和 USB-PD 供电,而非固定的 12 V 直流输入。
View full article
Can_example_S32K144ポート こんにちは!私はサンプルからCan_example_S32K144を作成しました。元々はCANループバック制御でしたが、現在は外部CAN通信に変更されています。ピンが無効になっていたので、ピンを有効にし、CANピンPTC2とPTC3を追加しました。その後、ポートを追加した際にエラーが発生しました。どうすればこの問題を解決できますか?ありがとう!   通信および制御(I3C | I2C | SPI | FlexCAN | イーサネット | FlexIO) Re: Can_example_S32K144 port ハイ エラーメッセージに従って 、 ピンツール 内の 機能グループ 名 を PortContainer_0_VS_0 に変更してください。 問題: Pins Toolの機能グループの名前は、 PortContainerName _ PeripheralFunctionalGroupName の形式にする必要があります。例:PortContainer_0_BOARD_InitPeripherals。PortContainer_0はPortContainer 0の名前、BOARD_InitPeripheralsは周辺機能グループの名前です。 よろしくお願いします、 ロビン ------------------------------------------------------------------------------- 注記: この投稿があなたの質問への回答になっている場合は、「解決策として承認」ボタンをクリックしてください。ありがとう! - 最後の投稿から7週間はスレッドをフォローしますが、それ以降の返信は無視されます。 後日、関連する質問がある場合は、新しいスレッドを作成し、閉じられたスレッドを参照してください。 -------------------------------------------------------------------------------
View full article
脳の歌のレビュー 「ブレインソング」は、一般的な「脳機能向上ソング」とは別に、その構成が特徴である。集中力を高めるために、大量のカフェインに頼るだけではない。その代わりに、認知機能の健康における3つの主要な柱に焦点を当てています。 詳細はこちら Re: The brain song reeviews こんにちは、Nhhnnさん、 NXPにご連絡いただき、また弊社製品にご関心をお寄せいただきありがとうございます。 お問い合わせ内容が特定のNXP製品またはデバイスに関するものか、お知らせいただけますでしょうか?そうであれば、喜んでさらにサポートさせていただきます。 ご質問がNXP製品に関係しない場合、残念ながら詳細なサポートを提供することは難しい場合がございます。ご理解いただき、誠にありがとうございます。 必要に応じて、さらに詳しい情報をお聞かせください。できる限りお手伝いさせていただきます。 良い1日を。
View full article
2S TDM Master: Persistent 1-slot downward shift during continuous DMA streaming 1. Test Configuration I2S configured as TDM Master, DSP mode with short WS 8 slots per frame, 32-bit per slot, frame length = 256 bit Using fsl_i2s_dma driver Dual-buffer ping-pong transfer FreeRTOS task waits on a semaphore from the DMA callback, fills the buffer, then calls I2S_TxTransferSendDMA to re-submit Test data pattern: fixed 0x000Axxxx (upper 16 bits = 0x000A, lower 16 bits contain slot index and sample sequence number) 2. Persistent One-Slot Downward Shift (100% Reproducible) Logic analyzer captures show: Transmitted data is consistently shifted down by exactly one slot Data intended for Slot 0 appears in the physical Slot 1 position Data intended for Slot 1 appears in the physical Slot 2 position By extension, data intended for Slot 7 appears in Slot 0 of the next frame (or is lost) This shift is stable after the stream starts; it does not drift further over time and remains a fixed 1-slot offset 3. Startup Data Misalignment (Intermittent) The logic analyzer occasionally observes: After the WS frame sync pulse, the DATA line remains at low level (all zeros) for a period After a blank interval of 1~3 frames, valid test data suddenly appears Once the blank interval ends, the data still exhibits the 1-slot offset described in item 2 Audio(PDM | I2S | SAI) Re: 2S TDM Master: Persistent 1-slot downward shift during continuous DMA streaming Hello @Xanderwangx , Thank you for your post. Could you please let us know which NXP MCU you are using? Also, are you working with one of our evaluation boards or a custom board? Are you using the SDK example code, or is this based on your own implementation? If it is your own code, would you be able to share it with us for further analysis? BR Celeste Re: 2S TDM Master: Persistent 1-slot downward shift during continuous DMA streaming Hello @Xanderwangx , Thank you for your reply. However, the RT family is not within my support scope. I mainly support MCX and Kinetis family. Also, this is MCX channel, not for RT product. Could you please create a new post under i.MX RT Crossover MCUs - NXP Community? The RT support team will be able to assist you there. BR Celeste Re: 2S TDM Master: Persistent 1-slot downward shift during continuous DMA streaming MCU: MIMXRT685-EVK (i.MX RT685) Board: Custom product board based on RT685. I am using Loop DMA mode with ping-pong buffers. The DMA is configured with I2S_TransferSendLoopDMA() using 2 descriptors. In the DMA callback, I fill the next buffer and the loop continues automatically. void I2S1_TDM_Init(void) { I2S_Type *base = I2S1; /* I2S Configuration */ i2s_config_t cfg; I2S_TxGetDefaultConfig(&cfg); cfg.masterSlave = kI2S_MasterSlaveNormalMaster; cfg.mode = kI2S_ModeDspWsShort; /* TDM = DSP mode */ cfg.divider = 24576000 / (TDM_SAMPLE_RATE * TDM_SLOT_NUM * TDM_SLOT_WIDTH); cfg.dataLength = TDM_SLOT_WIDTH; /* 32-bit */ cfg.frameLength = TDM_FRAME_LENGTH; /* 256-bit */ cfg.oneChannel = false; cfg.position = 0; cfg.wsPol = true; /* DSP A or B */ I2S_TxInit(base, &cfg); /* Enable 8 slots (Primary + 3 Secondary Channels) */ /* Note: Using 4 channels to cover 8 slots with 32-bit data */ I2S_EnableSecondaryChannel(base, kI2S_SecondaryChannel1, false, 32 * 2); I2S_EnableSecondaryChannel(base, kI2S_SecondaryChannel2, false, 32 * 4); I2S_EnableSecondaryChannel(base, kI2S_SecondaryChannel3, false, 32 * 6); /* DMA Loop Transfer Setup */ DMA_Init(DMA0); DMA_EnableChannel(DMA0, I2S_TX_DMA_CH); DMA_SetChannelPriority(DMA0, I2S_TX_DMA_CH, kDMA_ChannelPriority3); DMA_CreateHandle(&dma_handle, DMA0, I2S_TX_DMA_CH); I2S_TxTransferCreateHandleDMA(base, &i2s_handle, &dma_handle, I2S1_Callback, tdm_xfer); I2S_TransferInstallLoopDMADescriptorMemory(&i2s_handle, tdm_desc, 2); if (I2S_TransferSendLoopDMA(base, &i2s_handle, &tdm_xfer[0], 2) != kStatus_Success) { while (1); /* Fails if TDM_FRAMES * 8 > DMA_MAX_TRANSFER_COUNT(1024) */ } } The slot offset is random across power cycles, not fixed.I also tried disable interrupts before and after the DMA transfer to force synchronization, but slot misalignment still occurs. Does I2S_TransferSendLoopDMA() guarantee frame-aligned DMA startup on RT685? If not, how to force alignment to WS boundary? i.MX-RT600 
View full article