Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
FRDM-STBC-AGM01 - Bare metal example project Hi Everyone, In this tutorial I intend to run through my simple bare metal example code I created for the Freescale FRDM-KL25Z platform and the FRDM-STBC-AGM01 board containing a three axis accelerometer + magnetometer (FXOS8700CQ) and a three axis gyroscope (FXAS21002C). I will not cover the Sensor Fusion library and the ISF which also support this board. The FreeMASTER tool is used to visualize all the data that are read from both sensors using an interrupt technique through the I 2 C interface. This example illustrates: 1. Initialization of the MKL25Z128 MCU (mainly I 2 C and PORT modules). 2. I 2 C data write and read operations. 3. Initialization of the FXOS8700CQ and FXAS21002C. 4. Simple accelerometer offset calibration based on the AN4069. 5. Output data reading using an interrupt technique. 6. Conversion of the output raw values to real values in g’s, µT, dps and °C. 7. Visualization of the calculated values in the FreeMASTER tool. 1. As you can see in the FRDM-STBC-AGM01 schematic, both sensors are controlled via I 2 C by default. With jumpers J6 and J7 in their default position (2-3), the I 2 C signals are routed to the I2C1 module (PTC1 and PTC2 pins) of the KL25Z MCU. The INT1_8700 output is connected to the PTD4 pin and the INT1_21002 pin to the PTA5 pin of the KL25Z MCU. These both interrupt pins are configured as push-pull active-low outputs, so the corresponding PTD4/PTA5 pin configuration is GPIO with an interrupt on falling edge. The MCU is, therefore, configured as follows. void MCU_Init(void) {      //I2C1 module initialization      SIM_SCGC4 |= SIM_SCGC4_I2C1_MASK;        // Turn on clock to I2C1 module      SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;       // Turn on clock to Port C module      PORTC_PCR1 |= PORT_PCR_MUX(0x2);         // PTC1 pin is I2C1 SCL line      PORTC_PCR2 |= PORT_PCR_MUX(0x2);         // PTC2 pin is I2C1 SDA line      I2C1_F  |= I2C_F_ICR(0x14);              // SDA hold time = 2.125us, SCL start hold time = 4.25us, SCL stop hold time = 5.125us      I2C1_C1 |= I2C_C1_IICEN_MASK;            // Enable I2C1 module                       //Configure the PTD4 pin (connected to the INT1 of the FXOS8700CQ) for falling edge interrupts      SIM_SCGC5 |= SIM_SCGC5_PORTD_MASK;       // Turn on clock to Port D module      PORTD_PCR4 |= (0|PORT_PCR_ISF_MASK|      // Clear the interrupt flag                       PORT_PCR_MUX(0x1)|      // PTD4 is configured as GPIO                       PORT_PCR_IRQC(0xA));    // PTD4 is configured for falling edge interrupts                   //Configure the PTA5 pin (connected to the INT1 of the FXAS21002) for falling edge interrupts      SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK;       // Turn on clock to Port A module      PORTA_PCR5 |= (0|PORT_PCR_ISF_MASK|      // Clear the interrupt flag                       PORT_PCR_MUX(0x1)|      // PTA5 is configured as GPIO                       PORT_PCR_IRQC(0xA));    // PTA5 is configured for falling edge interrupts                          //Enable PORTD interrupt on NVIC      NVIC_ICPR |= 1 << ((INT_PORTD - 16)%32);      NVIC_ISER |= 1 << ((INT_PORTD - 16)%32);                //Enable PORTA interrupt on NVIC      NVIC_ICPR |= 1 << ((INT_PORTA - 16)%32);      NVIC_ISER |= 1 << ((INT_PORTA - 16)%32); } 2. The 7-bit I 2 C slave address of the FXOS8700CQ is 0x1E since both SA0 and SA1 pins are shorted to GND. The address of the FXAS21002C is 0x20 since SA0 pin is also shorted to GND. The two screenshots below show the write operation which writes the value 0x25 to the CTRL_REG1 (0x2A) of the FXOS8700CQ and 0x16 to the CTRL_REG1 (0x13) of the FXAS21002C. Here is the single byte read from the WHO_AM_I register. As you can see, it returns the correct value 0xC7 for the FXOS8700CQ and 0xD7 for the FXAS21002C. Finally, a burst read of 12 bytes from the FXOS8700CQ output data registers (0x01 – 0x06 and 0x33 – 0x38) and 6 bytes from the FXAS21002C output data registers (0x01 – 0x06) is shown below. 3. At the beginning of the initialization, all registers are reset to their default values by setting the RST bit of the CTRL_REG2 register. Then the FXOS8700CQ is initialized as shown below. void FXOS8700CQ_Init (void) {      I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG2, 0x40);          // Reset all registers to POR values      Pause(0x631);          // ~1ms delay            I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, XYZ_DATA_CFG_REG, 0x00);   // +/-2g range with 0.244mg/LSB              I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_CTRL_REG1, 0x1F);        // Hybrid mode (accelerometer + magnetometer), max OSR      I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, M_CTRL_REG2, 0x20);        // M_OUT_X_MSB register 0x33 follows the OUT_Z_LSB register 0x06 (burst read)                       I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG2, 0x02);          // High Resolution mode      I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG3, 0x00);          // Push-pull, active low interrupt      I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG4, 0x01);          // Enable DRDY interrupt      I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG5, 0x01);          // DRDY interrupt routed to INT1 - PTD4      I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG1, 0x25);          // ODR = 25Hz, Reduced noise, Active mode   } And here is the initialization of the FXAS21002C. void FXAS21002C_Init (void) {      I2C_WriteRegister(FXAS21002C_I2C_ADDRESS, GYRO_CTRL_REG1, 0x40);     // Reset all registers to POR values      Pause(0x631);        // ~1ms delay            I2C_WriteRegister(FXAS21002C_I2C_ADDRESS, GYRO_CTRL_REG0, 0x03);     // High-pass filter disabled, +/-250 dps range -> 7.8125 mdps/LSB = 128 LSB/dps      I2C_WriteRegister(FXAS21002C_I2C_ADDRESS, GYRO_CTRL_REG2, 0x0C);     // Enable DRDY interrupt, routed to INT1 - PTA5, push-pull, active low interrupt      I2C_WriteRegister(FXAS21002C_I2C_ADDRESS, GYRO_CTRL_REG1, 0x16);     // ODR = 25Hz, Active mode        } 4. A simple accelerometer offset calibration method is implemented according to the AN4069. void FXOS8700CQ_Accel_Calibration (void) {      char X_Accel_offset, Y_Accel_offset, Z_Accel_offset;            FXOS8700CQ_DataReady = 0;           while (!FXOS8700CQ_DataReady){}           // Is a first set of data ready?      FXOS8700CQ_DataReady = 0;            I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG1, 0x00);          // Standby mode                 I2C_ReadMultiRegisters(FXOS8700CQ_I2C_ADDRESS, OUT_X_MSB_REG, 6, AccelMagData);          // Read data output registers 0x01-0x06                     Xout_Accel_14_bit = ((short) (AccelMagData[0]<<8 | AccelMagData[1])) >> 2;          // Compute 14-bit X-axis acceleration output value      Yout_Accel_14_bit = ((short) (AccelMagData[2]<<8 | AccelMagData[3])) >> 2;          // Compute 14-bit Y-axis acceleration output value      Zout_Accel_14_bit = ((short) (AccelMagData[4]<<8 | AccelMagData[5])) >> 2;          // Compute 14-bit Z-axis acceleration output value                   X_Accel_offset = Xout_Accel_14_bit / 8 * (-1);          // Compute X-axis offset correction value      Y_Accel_offset = Yout_Accel_14_bit / 8 * (-1);          // Compute Y-axis offset correction value      Z_Accel_offset = (Zout_Accel_14_bit - SENSITIVITY_2G) / 8 * (-1);          // Compute Z-axis offset correction value                   I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, OFF_X_REG, X_Accel_offset);                  I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, OFF_Y_REG, Y_Accel_offset);           I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, OFF_Z_REG, Z_Accel_offset);                        I2C_WriteRegister(FXOS8700CQ_I2C_ADDRESS, CTRL_REG1, 0x25);          // Active mode again } 5. In the ISRs, only the interrupt flags are cleared and the DataReady variables are set to indicate the arrival of new data. void PORTD_IRQHandler() {      PORTD_PCR4 |= PORT_PCR_ISF_MASK;          // Clear the interrupt flag      FXOS8700CQ_DataReady = 1;  } void PORTA_IRQHandler() {      PORTA_PCR5 |= PORT_PCR_ISF_MASK;          // Clear the interrupt flag      FXAS21002C_DataReady = 1;  } 6. The output values from accelerometer registers 0x01 – 0x06 are first converted to signed 14-bit integer values and afterwards to real values in g’s. Similarly, the output values from magnetometer registers 0x33 – 0x38 are first converted to signed 16-bit integer values and afterwards to real values in microtesla (µT). if (FXOS8700CQ_DataReady)          // Is a new set of accel + mag data ready? {                  FXOS8700CQ_DataReady = 0;                                                                                                                          I2C_ReadMultiRegisters(FXOS8700CQ_I2C_ADDRESS, OUT_X_MSB_REG, 12, AccelMagData);         // Read FXOS8700CQ data output registers 0x01-0x06 and 0x33 - 0x38                     // 14-bit accelerometer data      Xout_Accel_14_bit = ((short) (AccelMagData[0]<<8 | AccelMagData[1])) >> 2;        // Compute 14-bit X-axis acceleration output value      Yout_Accel_14_bit = ((short) (AccelMagData[2]<<8 | AccelMagData[3])) >> 2;        // Compute 14-bit Y-axis acceleration output value      Zout_Accel_14_bit = ((short) (AccelMagData[4]<<8 | AccelMagData[5])) >> 2;        // Compute 14-bit Z-axis acceleration output value                              // Accelerometer data converted to g's      Xout_g = ((float) Xout_Accel_14_bit) / SENSITIVITY_2G;        // Compute X-axis output value in g's      Yout_g = ((float) Yout_Accel_14_bit) / SENSITIVITY_2G;        // Compute Y-axis output value in g's      Zout_g = ((float) Zout_Accel_14_bit) / SENSITIVITY_2G;        // Compute Z-axis output value in g's                               // 16-bit magnetometer data                   Xout_Mag_16_bit = (short) (AccelMagData[6]<<8 | AccelMagData[7]);          // Compute 16-bit X-axis magnetic output value      Yout_Mag_16_bit = (short) (AccelMagData[8]<<8 | AccelMagData[9]);          // Compute 16-bit Y-axis magnetic output value      Zout_Mag_16_bit = (short) (AccelMagData[10]<<8 | AccelMagData[11]);        // Compute 16-bit Z-axis magnetic output value                                                         // Magnetometer data converted to microteslas      Xout_uT = (float) (Xout_Mag_16_bit) / SENSITIVITY_MAG;        // Compute X-axis output magnetic value in uT      Yout_uT = (float) (Yout_Mag_16_bit) / SENSITIVITY_MAG;        // Compute Y-axis output magnetic value in uT      Zout_uT = (float) (Zout_Mag_16_bit) / SENSITIVITY_MAG;        // Compute Z-axis output magnetic value in uT              } Similarly, the output values from gyroscope registers 0x01 – 0x06 are first converted to signed 16-bit integer values and afterwards to real values in degrees per second. Temperature is also read out from the 0x12 register. if (FXAS21002C_DataReady)         // Is a new set of gyro data ready? {                  FXAS21002C_DataReady = 0;                                                                                                                                       I2C_ReadMultiRegisters(FXAS21002C_I2C_ADDRESS, GYRO_OUT_X_MSB_REG, 6, GyroData);         // Read FXAS21002C data output registers 0x01-0x06                                   // 16-bit gyro data      Xout_Gyro_16_bit = (short) (GyroData[0]<<8 | GyroData[1]);           // Compute 16-bit X-axis output value      Yout_Gyro_16_bit = (short) (GyroData[2]<<8 | GyroData[3]);           // Compute 16-bit Y-axis output value      Zout_Gyro_16_bit = (short) (GyroData[4]<<8 | GyroData[5]);           // Compute 16-bit Z-axis output value                                           // Gyro data converted to dps      Roll = (float) (Xout_Gyro_16_bit) / SENSITIVITY_250;          // Compute X-axis output value in dps      Pitch = (float) (Yout_Gyro_16_bit) / SENSITIVITY_250;         // Compute Y-axis output value in dps      Yaw = (float) (Zout_Gyro_16_bit) / SENSITIVITY_250;           // Compute Z-axis output value in dps                               // Temperature data      Temp = I2C_ReadRegister(FXAS21002C_I2C_ADDRESS, GYRO_TEMP_REG);                   }   7. The calculated values can be watched in the "Variables" window on the top right of the Debug perspective or in the FreeMASTER application. To open and run the FreeMASTER project, install the FreeMASTER application​ and FreeMASTER Communication Driver. I guess this is enough to let you start experimenting with the FRDM-STBC-AGM01 board. Attached you can find the complete source code written in the CW for MCU's v10.6 including the FreeMASTER project. If there are any questions regarding this simple application, do not hesitate to ask below. Your feedback or suggestions are also welcome. Regards, Tomas Accelerometers Magnetic Sensors
View full article
2015 Training Course Listing ARM Processors i.MX Kinetis Power Architecture Processors QorIQ Analog and Power Management RF Sensors Wireless Connectivity Medical and Healthcare Additional Courses Material ARM Processors i.MX 2014 Archives Kinetis Power Architecture Processors QorIQ Analog and Power Management RF Sensors 2014 Archives Wireless Connectivity 2014 Archives Medical and Healthcare 2014 Archives Additional Courses Material Arm® Processors i.MX Applications Processors Interface & Connectivity Kinetis Cortex®-M Microcontrollers Power Architecture® Processors Power Management Sensors
View full article
Wifi 连接问题! <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 大家好 ! 我发现一个问题,Wiif连接问题。当我连接WiFi热点时,报了一个警告!     <4>RTL871X:关联成功 <4>------------[ 从此处剪开 ]------------ <4>警告:在 net/wireless/sme.c:482 __cfg80211_connect_result+0x2f4/0x32c() <4>链接模块:8188eu <4>[ ] (unwind_backtrace+0x0/0x138) 来自 [ ] (warn_slowpath_common+0x4c/0x64) <4>[ ] (warn_slowpath_common+0x4c/0x64) 来自 [ ] (warn_slowpath_null+0x1c/0x24) <4>UpdateHalRAMask8188EUsb => mac_id:0,网络类型:0x0b,掩码:0x000fffff <4> ==> rssi_level:0,rate_bitmap:0x000ff015 <4>[ ] (warn_slowpath_null+0x1c/0x24) 来自 [ ] (__cfg80211_connect_result+0x2f4/0x32c) <4>[ ] (__cfg80211_connect_result+0x2f4/0x32c) 来自 [ ] (cfg80211_process_rdev_events+0x1e0/0x204) <4>[ ] (cfg80211_process_rdev_events+0x1e0/0x204) 来自 [ ] (cfg80211_event_work+0x24/0x54) <4>[ ] (cfg80211_event_work+0x24/0x54) 来自 [ ] (process_one_work+0x12c/0x494) <4>[ ] (process_one_work+0x12c/0x494) 来自 [ ] (worker_thread+0x170/0x3cc) <4>[ ] (worker_thread+0x170/0x3cc) 来自 [ ] (kthread+0x80/0x88) <4>[ ] (kthread+0x80/0x88) 来自 [ ] (kernel_thread_exit+0x0/0x8) <4>---[结束跟踪 14efbc2d6eba2439]---       本文件是根据以下讨论生成的:
View full article
FTF-IND-F1143 Learn about the latest MCUs recently added to the Kinetis V series, including the Kinetis KV5x MCU - Freescale's first MCU featuring the ARM Cortex-M7 core. Learn about the latest MCUs recently added to the Kinetis V series, including the Kinetis KV5x MCU - Freescale's first MCU featuring the ARM Cortex-M7 core.
View full article
How to register and retrieve CodeWarrior suite licenses Freescale customer license management web page was changed since Dec, 2014. This document introduced How to register a CodeWarrior suite licenses( Node-Lock and Floating License) . General
View full article
AN5200 - Error Correcting Codes Implemented on MPC55xx and MPC56xx Revision 1 of the document is now officially published: https://www.nxp.com/docs/en/application-note/AN5200.pdf   Related code examples can be found also here (equal to AN5200SW): Example 1 - MPC5634M_2b_RAM_ECC_error_injection CW210 Example 2 - MPC5674F_1b+2b_RAM_ECC_error_injection CW210 Example 3 - MPC5643L 1b_RAM_ECC_error_injection CW210 Example 4 - MPC5643L 2b RAM and 2b FLASH ECC error injection CW210 Example 5 - MPC5675K-2b_RAM+2b_FLASH_ECC_error_injection CW210 Revision 1 of the document is now officially published: http://cache.freescale.com/files/microcontrollers/doc/app_note/AN5200.pdf http://cache.freescale.com/files/microcontrollers/doc/app_note/AN5200SW.zip   Related code examples can be found also here (equal to AN5200SW): Example 1 - MPC5634M_2b_RAM_ECC_error_injection CW210 Example 2 - MPC5674F_1b+2b_RAM_ECC_error_injection CW210 Example 3 - MPC5643L 1b_RAM_ECC_error_injection CW210 Example 4 - MPC5643L 2b RAM and 2b FLASH ECC error injection CW210 Example 5 - MPC5675K-2b_RAM+2b_FLASH_ECC_error_injection CW210 Re: AN5200 - Error Correcting Codes Implemented on MPC55xx and MPC56xx SOLVED. Your code is running properly, but my did not run properly. The problem was completly different. Whe I downloaded (twice) your code was corrupted.Today I download it again and I could see it running. Then I translate your code to my application with SSD. Everithing is working now. I wanted  Exceprion_Handlers to correct corrupted flash block, that works. Thank you. Re: AN5200 - Error Correcting Codes Implemented on MPC55xx and MPC56xx I am not sure if you speak about 2b ECC error injection (because it described in chapter 6.2 and example for MPC5643L have it shown in function Generate_noncorrectable_FLASH_ECC_error) or your question is related to certain ECC error reporting flags (EER) implemented in flash memory controller. I consider these flags as redundant thus I haven't mentioned them in the appnote. Also I haven't used SSD driver for simplicity, but you can inject ECC error with SSD driver, the principle is the same. Re: AN5200 - Error Correcting Codes Implemented on MPC55xx and MPC56xx Hi, about there is not much documentation. Thank you for your attitude. I am using MPC5634M, CW10.2 and SSD C90LC. When I over program the flash it is possible to occur EER. The disposed examples with MPC56XX_C90LC_JDP_SSD_100_DEVD or your ECC_preliminary are not simulating EER in e200z335 core. Or there are missing files (in your projects) or there are no practical routine to do this (in SSD drive). If you can help ...
View full article
Enable Linux RT_PREEMPT on i.MX8M Products Linux kernel is not real time OS, while some applications is time sensitive tasks running in Linux environment, this request to extend the real time feature in common Linux kernel, and RT_PREEMPT is one of the methods to enable Linux kernel with real time processing requirement. But RT_PREEMPT is not accepted by kernel, so it needs extra effort to porting this patch-set to i.MX8M family products. This patch-set is based on L4.14.78 for i.MX8M products, customer need to apply patches based on this release. Re: Enable Linux RT_PREEMPT on i.MX8M Products Is there an RT_PREEMPT patch available for i.MX93 family?
View full article
S32G eMMC application doc This doc expain how to use eMMC from user space, contents as follows: 目录 1 eMMC的分区情况 ...................................................... 2 2 S32G+BSP29上默认的eMMC启动 ............................ 3 2.1 eMMC硬件设计 .................................................. 3 2.2 eMMC的镜像烧写办法与启动 ............................. 6 2.3 增加MMC内核测试工具 .................................... 10 3 eMMC GP功能的测试 .............................................. 10 3.1 eMMC GP功能的说明 ....................................... 10 3.2 eMMC GP功能的测试 ....................................... 11 4 eMMC RPMB功能的测试 ......................................... 13 4.1 eMMC RPMB功能的说明 ................................. 13 4.2 eMMC RPMB功能的测试 ................................. 15 Automotive Re: S32G eMMC application doc which is running on ubuntu PC, to copy image into sdcard related folder. Re: S32G eMMC application doc Hi, @Johnli : Hello, I referred to your article and have a question to ask you. In the picture below, is "/media/vmuser/temp/" the path of your SD card? Because I see that my SD card paths are all /dev/sdb1, /dev/sdb2, /dev/sdb3. Please guide me how to choose this path. Thank you.
View full article
i.MX93 DDR setting and config tool usage i.MX93 DDR stress test tool is different with previous i.MX tool. This Chinese article describe how to debug i.MX93 DDR and introduce DDR config tool usage. Linux Re: i.MX93 DDR setting and config tool usage Hi NXP Team, Can you please provide the IMX93 DDR calibration Test procedure in English language? Re: i.MX93 DDR setting and config tool usage HI NXP Team,  is this file also availanle in english language?  Marcel 
View full article
PTP Scenarios based on S32G PFE 在进行时钟同步时,目前S32G2/G3有一种很典型的使用场景: Grand master clock  <-> S32G PFE <-> 其余连接在PFE 某些 eMAC口上的设备 外部的grand master clock,连接在PFE的一个eMAC上,要同步S32G以及连接在PFE其余eMAC上的设备时钟。 但是S32G2/G3的PFE仅仅是支持timestamp,对于将S32G PFE设置成交换机使用时,PFE不能实现Transparent clock的功能。 因此,本文讨论将PFE + S32G SoC当作Transparent clock,以及将PFE + S32G当作boundary clock,来同步S32G以及其余部件的时钟。 Automotive
View full article
S32G Uboot customization application doc 目录 1 S32G Linux文档说明 .................................................. 3 2 创建S32G RDB2 Linux板级开发包编译环境 .............. 4 2.1 创建yocto编译环境: ................................................. 4 2.2 独立编译 ................................................................. 9 3 FSL Uboot 定制 ........................................................ 14 3.1 FDT支持 ............................................................... 14 3.2 DM(driver model)支持 ........................................... 20 3.3 Uboot目录结构 ...................................................... 31 3.4 Uboot编译 ............................................................. 34 3.5 Uboot初始化流程 .................................................. 35 3.6 使能了ATF后对Uboot初始化流程的影响 ............... 40 4 Uboot 定制 ............................................................... 41 4.1 修改 DDR大小 ....................................................... 41 4.2 修改调试串口与IOMUX说明 .................................. 44 4.3 DM I2C与PMIC初始化 .......................................... 53 4.4 通用GPIO ............................................................. 59 4.5 启动eMMC定制 ..................................................... 69 4.6 Ethernet定制 ......................................................... 78 5 Uboot debug信息 ..................................................... 89 5.1 Print env ............................................................... 89 5.2 dm - Driver model low level access ...................... 92 5.3 fdt .......................................................................... 95 5.4 I2C测试 ................................................................. 95 5.5 芯片寄存器访问 ..................................................... 98 updated to V5 Automotive
View full article
How to measure temperature of CPU and stress individual cores of CPU? The below steps describe how to measure CPU temperature and how to stress individual cores of CPU. Steps are explained with an example of LX2160A SoC. However, these steps are applicable to all Layerscape devices. Download Flexbuild and add packages in Yocto tiny Generate Yocto tiny userland Enable thermal monitoring unit and build kernel Generate .itb image Load .itb image from TFTP server to Layerscape board Validate stress package and measure CPU temperature before and after stress Step 1: Download Flexbuild and add packages in Yocto tiny On a Linux machine, download Layerscape Software Development Kit - . Go to Download tabs at http://www.nxp.com/lsdk. Enter login details, accept the agreement to download the Flexbuild source tarball in the name format flexbuild_ .tgz. Run the following commands to extract Flexbuild files from tar archived file. $ tar xvzf flexbuild_ .tgz $ cd flexbuild_ $ source setup.env $ flex-builder -h Add “stress” package to "IMAGE_INSTALL_append" parameter of local_arm64_tiny.conf file available in flexbuild_ /configs/yocto/ folder. Save and exit the file. Step 2 – Generate Yocto tiny userland Change directory to flexbuild_ . Clean obsolete cache data. This step is needed in case source/config has changed. $ source setup.env $ flex-builder -i clean-rfs -r yocto Run the following commands to generate Yocto-based tiny userland: $ flex-builder -i mkrfs -r yocto:tiny $flex-builder -i mklinux -r yocto:tiny $ flex-builder -i mkfw -m -b sd This generates the following images: rootfs_lsdk _yocto_tiny_arm64.cpio.gz (~22M), lsdk _yocto_tiny_LS_arm64.itb , and firmware_ _uboot_sdboot.img . For example: rootfs_lsdk2004_yocto_tiny_arm64.cpio.gz (~22M), lsdk2004_yocto_tiny_LS_arm64.itb, and firmware_lx2160ardb_rev2_uboot_sdboot.img Step 3 Enable system monitoring unit and build kernel Change directory to flexbuild_ /packages/linux/linux . Enable environmental setting for cross-compiling. The following setting is applicable when you configure and build kernel on a different architecture from the target. For example, compiling an Armv8 kernel on an X86 computer. Run the following commands on Ubuntu Linux: $ export CROSS_COMPILE=aarch64-linux-gnu- $ export ARCH=arm64 Run make menuconfig command to configure settings to enable thermal monitoring unit. $ make menuconfig The command opens the kernel configuration [tree-view structure] prompt. Use the Arrow keys to navigate the menu and Enter to select the submenu. Navigate to Device Drivers --> <*> Generic Thermal sysfs driver --> [ ] Generic CPU cooling support option. Press Y key to include the option. [*] symbol indicates the option is included (shown in below figure). Similarly, include the following options to enable thermal management framework. After you include all options as mentioned in the above table, save the configuration with a file name. For example,  save the configuration file as thermal.config. Exit to come out of the Kernel Configuration prompt. Copy the configuration file to arch/arm64/configs folder. $ cp arch/arm64/configs/ For example, $ cp thermal.config arch/arm64/configs/ Configure the kernel. Load the changed configuration for Layerscape Armv8 platform in 64-bit mode for LSDK. $ export CROSS_COMPILE=aarch64-linux-gnu- $ export ARCH=arm64 $ make distclean $ make defconfig Build kernel image and device tree image. $ make -j8 Step 4 - Generate .itb file Generate .itb file, which includes stress package and thermal monitoring unit installed, for kernel booting. Copy the Image and Image.gz files from the /flexbuild_ /packages/linux/linux/arch/arm64/boot folder and to the /flexbuild_ /build/linux/kernel/arm64/LS folder. Change directory to flexbuild_ . Generate .itb image using flex-builder. $ source setup.env $ flex-builder -i mkitb -r yocto:tiny This generates lsdk2 _yocto_tiny_LS_arm64.itb file. For example, lsdk2004_yocto_tiny_LS_arm64.itb file. Copy the .itb image to the TFTP server. Step 5 - Load .itb image from TFTP server to Layerscape board Set up Ethernet connection between the board (for example, LX2160ARDB) and host machine on which you have configured the TFTP server. Boot the board to U-Boot prompt. U-Boot prints a list of enabled Ethernet interfaces. For example, LX2160ARDB U-Boot prints following Ethernet interfaces. DPMAC2@xlaui4, DPMAC3@xgmii, DPMAC4@xgmii, DPMAC5@25g-aui, DPMAC6@25g-aui, DPMAC17@rgmii-id, DPMAC18@rgmii-id  Set server IP address to the IP address of the host machine on which you have configured the TFTP server. => setenv serverip Set ethact and ethprime as the ethernet interface connected to the TFTP server. See LX2160ARDB Ethernet Port Mapping for the mapping of Ethernet port names appearing on the chassis front panel with the port names in U-Boot and Linux. => setenv ethprime For example: => setenv ethprime DPMAC3@xgmii => setenv ethact For example: => setenv ethact DPMAC3@xgmii Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.  Static IP address assignment: => setenv ipaddr => setenv netmask Dynamic IP address assignment: => dhcp Save the settings. => saveenv Check the connection between the board and the TFTP server. => ping $serverip Using DPMAC3@xgmii device host 192.168.2.1 is alive Load the .itb image from TFTP server to DDR memory of the board. => tftp 0xa0000000 For example: => tftp 0xa0000000 lsdk2004_yocto_tiny_LS_arm64.itb Boot the kernel with .itb image as follows: => bootm 0xa0000000# For example: => bootm 0xa0000000#lx2160ardb Let the board boots to Tiny Linux. Step 6 – Validate stress package and measure CPU temperature before and after stress Check stress-ng package using which stress-ng command: # which stress-ng /usr/bin/stress-ng Check scaling_current_frequency of the cores. # cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq  For example: Check frequency of 16 cores of LX2160ARDB as follows: Check the temperature of the CPU before applying stress. # cat /sys/class/thermal/thermal_zone*/temp Apply stress by executing following command: # stress-ng -c 8 -i 1 -m 1 --vm-bytes 128M -t 60s & The command applies stress for 60 seconds. For more information on stress-ng command, run stress-ng -h command for help. Check the temperature of the CPU after applying stress. # cat /sys/class/thermal/thermal_zone*/temp For example:
View full article
ARM Cortex-M(V7M) MCU(S32K3XX) のフォルト例外をデバッグする方法
View full article
Example S32K324 Bootloader to Application Jump DS3.5 RTD300 *******************************************************************************  The purpose of this demo application is to present a usage of the Bootloader Jump to Application.  ------------------------------------------------------------------------------ * Test HW: S32K3X4EVB-Q172 * MCU: S32K324 * Compiler: S32DS3.5 * SDK release: RTD 3.0.0 * Debugger: PE micro * Target: internal_FLASH ******************************************************************************** Jump is decided based on the boot_header, size we use to jump to the RESET handler:-- Cortex M-7 Interrupt vector table, RESET handler is 4 byte offset from starting of vector table :-- How to burn elf file of both application & bootloader code :-- Bootloader Linker file used :-- Application Linker file used :-- This linker file has provision to distribute RAM to both the cores Application & bootloader both commented this, as CORE-1 should be started in CORE-0 main() function if required  :-- System.c file this changed (as in RTD-3.0.0 bug in startup file because of which HARDfault occurs in startup process for S32K324) :--
View full article
Example S32K312 ADC DS3.5 RTD300 *******************************************************************************  The purpose of this demo application is to present a usage of the  ADC_SAR IP Driver for the S32K3xx MCU.  The example uses the PIT0 trigger to trigger  conversions on ADC1.  ADC channels  are selected to be converted on  ADC-1:  ADC channel S10 is connected to board's potentiometer. #define ADC_SAR_USED_CH_BANDGAP 48U /* Internal Bandgap Channel */ #define ADC_SAR_USED_CH_POT_0 34U  ------------------------------------------------------------------------------ * Test HW: S32K3X2EVB-Q172 * MCU: S32K312 * Compiler: S32DS3.5 * SDK release: RTD 3.0.0 * Debugger: PE micro * Target: internal_FLASH ********************************************************************************
View full article
Connecting camera and LCD to i.MX RT EVKs This guide will walk through how to do connect the camera and LCD modules to i.MX RT boards and how to test to ensure the camera and LCD are connected properly. Update May 2022: There are now updated versions of these LCD panels that have an impact on software. See this post for more details. The physical connections are the same for both the original and new panels however so there are no changes to this guide. This first part of this guide is for the i.MX RT1050, i.MX RT1060, i.MX RT1064 EVKs. The second part of this guide is for i.MX RT595, i.MX RT1160 and i.MX RT1170 EVKs.  Part 1: Camera and LCD for i.MX RT1050, i.MX RT1060, and i.MX RT1064:  The camera used by the RT1050, RT1060, and RT1064 EVKs are the same. However this camera only comes with the RT1060 and RT1064 EVKs. There are alternatives available for the RT1050 as discussed in this blog post.  The LCD screen compatible with these boards is the RK043FN66HS-CTG  Camera:  1) The camera connector is on the front of the board. Flip the black connector up so it's 90 degrees from its original position.  2) Then slide in the flat ribbon connector of the camera 3) Flip the black connector back down. It should keep the ribbon cable snug. LCD: 1) On the back of the board, slide the black connector for the LCD ribbon forward. 2) Then slide in the flat LCD ribbon cable underneath the black connector. 3) Slide the black connector back to its original position. The cable should be snug. 4) Do the same for the touch controller connector and slide the black connector forward Then insert the cable between the black connector and the white top so that the cable is in the middle. It might take a few tries as its somewhat difficult. You could also use needle nose pliers to help guide in the cable but be careful about damaging the cable. 5) Then slide the black connector back to the original position. The cable should be snug. 6) It should look like the following when complete. Testing: 1) To test the camera and LCD, use the CSI driver examples in the MCUXpresso SDK.  2) The camera will likely be out of focus the first time you use it. Adjust it by rotating the lens clockwise until the image is in focus. You can use your fingers or some needle nose pliers. It could take up to two rotations and it should turn easily. Also remove the plastic cover.  3) To test the touch controller, use the emwin temperature control example in the MCUXpresso SDK Tape: 1) Once the LCD has been confirmed to work, you can use two layers of thick double sided foam tape to securely attach it to the board.  Part 2: Camera and LCD for i.MX 700, i.MX RT595, i.MX RT1160 and i.MX RT1170 EVKs:  The i.MX RT1160 and i.MX RT1170 EVKs both come with a OV5640 MIPI camera module in the box.  The LCD screen compatible with the i.MX RT1160, i.MX RT1170, i.MX RT595, and i.MX RT700 is the RK055HDMIPI4MA0 and it can be found here.  There are multiple alternative names for this panel and all these names refer to the exact same panel: RK055HDMIPI4MA0 RK055MHD091 RK055MHD091-CTG RK055MHD091A0-CTG Instructions for i.MX RT1170 are below: i.MX RT1170-EVK Camera:  1) The camera connector is on the front of the board at J2. It connects by simply pressing the camera down onto the connector. It takes a bit of force but should not be too difficult.  i.MX RT1170-EVK LCD: 1) On the back of the board, slide the black connector (J40) for the LCD ribbon forward towards the edge of the board.  2) Then carefully slide in the flat LCD ribbon cable into the connector. The blue writing should be facing up like in the photo. It should go above the black part of the connector that you just slid out, and under the white part of the connector.  3) Slide the black plastic connector back to its original position. The cable should be snug if pulled. It should look like the following:  i.MX RT1170-EVK Power: 1) If using the LCD, then the external power adapter must be used with the board. Connect the barrel connector to J43 on the board. 2) Also change the jumper on J38 to be on pins 1-2 so that it uses the external power.  3) Connect a micro-USB cable to J11, which will cause the board to enumerate as a COM port and as a debug interface for downloading and debugging code i.MX RT1170-EVK Camera and LCD Testing: 1) To test the camera and LCD, use the csi_mipi_rgb_cm7 driver example that can be found in the MCUXpresso SDK for i.MX RT1170. The camera input should be displayed on the LCD screen if everything is connected properly.   Re: Connecting camera and LCD to i.MX RT EVKs Thanks for this guide.
View full article
S32 Design Studio for S32 Platform 3.3 を使用した実行中のターゲットへの接続 (アタッチ) 一般的なデバッグセッションは、コードをFlashにダウンロードし、main()以降でデバッグすることから始まります。ただし、すでに実行中のシステムを探索するには、コードの実行に影響を与えることなく、ターゲットMCUにデバッグ接続(アタッチ)を行うことができます(少なくとも、ユーザーがMCUの停止を選択するまでは)。   注: 実行中のターゲットのソース レベルのデバッグは、アタッチするプロジェクトのソースがターゲットで実行されているバイナリ コードと完全に一致する場合にのみ可能です。   ツールバーの [(Debug As)] ボタンをクリックし、ドロップダウン メニューから [Debug Configurations ] をクリックします。 [デバッグ構成] ダイアログ ボックスの左側のウィンドウで、プロジェクト設定で指定されたデバッグ インターフェイスを展開し、必要な起動構成をクリックします。 左側のウィンドウで構成をクリックすると、構成設定がタブにグループ化されて右側のウィンドウに表示されます。 PEmicro(ピーマイクロ) [スタートアップ] タブを選択し、次のように [実行中のターゲットにアタッチ] チェック ボックスを設定します。 デバッグ接続が確立されると、ターゲットは一時停止するまで実行を続けます。 セガーJリンク [デバッガー] タブを選択し、次のように [実行中のターゲットに接続] チェック ボックスを設定します。 残念ながら、この機能は現在サポートされていません。 デバッグ | フラッシュプログラミング Eclipse IDEの使用と設定
View full article
How to use the NanoVNA for the board OM29263ADK      This document mainly describes how to use NanoNVA tool to do antenna tuning on OM29263ADK with CLEV663B/PN5180B board. Please refer to the application note AN12810(https://www.nxp.com/docs/en/application-note/AN12810.pdf) about the NanoVNA tool. And please refer the user manual UM11098 (https://www.nxp.com/docs/en/user-guide/UM11098.pdf) about OM29263ADK. After setting NanoVNA tool with reference to the above documents. Firstly, take the small antenna of OM29263ADK with CLEV663B as an example. The small antenna can be directly connected and used on the CLEV6630B。the antenna board can be directly connected to the CLEV6630B without any additional modification, after the original antenna had been removed (cut off). The result of the antenna tuning with NanoVNA tool as the below: Second, take the small antenna of OM29263ADK with PN5180B board as an example. Follow the UM11098 steps as the below: (a) the EMC filter cut off frequency must be adjusted, and (b) the DPC and related features should be disabled, since the antenna is asymmetrically tuned and the DPC is not used. (a) The original antenna uses a symmetrical tuning, which uses an EMC filter with L0 = 470nH and C0 = 253pF (220pF + 33pF). The inductor as well as the first part of the capacitance (220pF) are assembled on the main board. To operate the OM29263ADK antenna, the C0 (220pF) on the PNEV5180B must be replaced by a 68pF. (b) The DPC and its related features should be disabled to operate an asymmetrical antenna. If can’t get the card information please refer to the AN11740’s related steps to achieve a good sensitivity of RxP/RxN path. The result of the antenna tuning with NanoVNA tool as the below: The whole process of the small antennas tuning of OM29263ADK with CLEV66B/PN5180 with NanoVNA is completed. PS: It is the similar with the steps for the large antennas tuning of OM29263ADK with CLEV66B/PN5180 with NanoVNA.  
View full article
S32G2 support guide S32G2 support guide (rev0.1, 070521) 1. If you have any technical issues encountered when using NXP S32G-VNP-RDB2 or S32G-VNP-GLDBOX, these can be discussed and covered on the S32G product forum. 2. You can also submit your ticket through the nxp.com website here 3. We also provide professional services and support as per cases beyond standard supports, please contact your NXP sales representative in your region for more options
View full article
NXP Model-Based Design Toolbox for S32M2xx – version 1.0.0 Product Release Announcement Automotive Processing NXP Model-Based Design Toolbox for S32M2xx – version 1.0.0 RTM The Automotive Processing, Model-Based Design Tools Team at NXP Semiconductors, is pleased to announce the release of the Model-Based Design Toolbox for S32M2xx version 1.0.0. This release supports automatic code generation for S32M2xx peripherals and applications prototyping from MATLAB/Simulink for NXP S32M2xx Automotive Microprocessors. This new product adds support for S32M41, S32M242, S32M43,  S32M244, S32M274, S32M276 MCUs and part of their peripherals, based on RTD MCAL components (ADC, AE, DIO, CAN, DPGA, GDU, GPT, MCL, PWM, MCU, PORT, QDEC, UART). In this release, we have also added support for FreeMASTER, AMMCLib, and MATLAB support for the latest versions. The product comes with over 60 examples, covering all supported peripherals, and Simulink simulation modes Software-in-the-Loop, Processor-in-the-Loop, and External Mode. Target audience: This product is part of the Automotive SW – S32M2 Standard Software Package. FlexNet Location: https://nxp.flexnetoperations.com/control/frse/download?element=3785898 Technical Support: NXP Model-Based Design Toolbox for S32M2xx issues will be tracked through the NXP Model-Based Design Tools Community space. https://community.nxp.com/community/mbdt     Release Content Automatic C code generation from MATLAB® for NXP S32M2xx derivatives: S32M241 S32M242 S32M243 S32M244 S32M274 S32M276 Support for the following peripherals (MCAL components): ADC AE DIO CAN DPGA GDU GPT MCL PWM MCU PORT QDEC UART Provides 2 modes of operation: Basic – using pre-configured configurations for peripherals; useful for quick hardware evaluation and testing Advanced – using S32 Configuration Tool or EB Tresos to configure peripherals/pins/clocks Integrates the Automotive Math and Motor Control Library version 1.1.34: All functions in the Automotive Math and Motor Control Functions Library v1.1.34 are supported as blocks for simulation and embedded target code generation. Integration with FreeMASTER We provide several Simulink example models and associated FreeMASTER projects to demonstrate how our toolbox interacts with the real-time data visualization tool and how it can be used for tuning embedded software applications. Support for MATLAB® versions R2021a R2021b R2022a R2022b R2023a R2023b Support for custom board initialization Toolbox generates the components’ peripherals initialization function calls as configured in the Board Initialization window, which can be customized to each Simulink model. This feature allows users to set a custom order for the components initialization, the insertion of the Custom code sequences, or share the custom initialization with multiple Simulink models via the Export and Import functionality.     Support for custom default project configuration The toolbox provides support for users to create their custom default project configurations. This could be very useful when having a custom board design – only needing to create the hardware configuration once. After it is saved as a custom default project, it can be used for every model that is being developed. Integration with S32 Config Tools version v1.7:     Integration with S32 Design Studio The toolbox automatically generates the _Config folder, next to the Simulink model location, providing the user the opportunity to easily import the generated code from Simulink into S32 Design Studio. Each time the code is generated, the _Config folder is updated with the new changes. The toolbox also provides a mechanism to launch an S32 Design Studio instance, with the imported generated code project in the Project Explorer tab from S32DS. Simulation modes: We provide support for the following simulation modes (each of them being useful for validation and verification): Software-in-Loop (SIL) Processor-in-Loop (PIL) External mode Support for profiling in PIL mode: Examples for every peripheral/function supported: We have added over 60 examples, including: CDD Blocks (Ae, Dpga, Gdu, Mcl, Qdec) Communication (Can, Uart) AMMCLib IO Blocks (Adc, Dio, Pwm) ISR Blocks (Hardware Interrupt Handler) MCAL Blocks (Gpt) Utility Blocks (FreeMASTER) Software-in-the-Loop / Processor-in-the-Loop / External mode For more details, features, and how to use the new functionalities, please refer to the Release Notes document attached.   MATLAB® Integration The NXP Model-Based Design Toolbox extends the MATLAB® and Simulink® experience by allowing customers to evaluate and use NXP’s S32M2xx MCUs and evaluation board solutions out-of-the-box with: Model-Based Design Toolbox for S32M2xx version 1.0.0 is fully integrated with MATLAB® environment in terms of installation:   Target Audience This release (1.0.0) is intended for technology demonstration, evaluation purposes, and prototyping of S32M2xx MCUs and Evaluation Boards.   Useful Resources Examples, Training, and Support: https://community.nxp.com/community/mbdt Re: NXP Model-Based Design Toolbox for S32M2xx – version 1.0.0 When I click on the following "Go to NXP Download Site" button: It redirects me to the page below: Can you provide a location that I can download the S32M2xx Model-Based Design Toolbox? Re: NXP Model-Based Design Toolbox for S32M2xx – version 1.0.0 S32M2 ,with out   externel boost   power is  ? 回复: NXP Model-Based Design Toolbox for S32M2xx – version 1.0.0 And I still can't find the correct URL when I click on the link on this Matlab script. 回复: NXP Model-Based Design Toolbox for S32M2xx – version 1.0.0 Hello, I have encountered the same problem. Clicking on this link https://nxp.flexnetoperations.com/control/frse/download?element=3785898 will still redirect me to the account information interface, and I cannot find the correct URL. Also, I have logged into my own account before that. First,I click on this link: Then, The result is that the correct URL cannot be redirected. Re: NXP Model-Based Design Toolbox for S32M2xx – version 1.0.0 Hello @SmallWhite , It takes a little while for us after a release to update all the documentation on the NXP.com website. The Release Notes alongside the Quick Start Guide for the MBDT for S32M2xx are available on the FlexNET Location url: here:  https://nxp.flexnetoperations.com/control/frse/download?element=3785898 Please login on the NXP.COM before accessing this link. 回复: NXP Model-Based Design Toolbox for S32M2xx – version 1.0.0 When I click the urls in this passage,I will always redirect to my personal page taht I can not go to the true urls. And I wonder is there a quick reference guide for s32m244 like this ?
View full article