Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
Optimizing ARM Cortex-A9 Support in Windows Embedded Compact by Adeneo Embedded Optimizing ARM Cortex-A9 support in Windows Embedded Compact     A Discussion of random hangs and other issues using Windows Embedded Compact on Freescale i.MX6 Application Processor and how they were solved By Adeneo Embedded Engineering Team Rev 1.0, November 2014 Summary Over the last year Adeneo Embedded has been confronted with reports of random processor deadlocks and operating system crashes from customers using our Freescale i.MX6 Windows Embedded Compact Board Support Package.   The random hangs and other issues surfaced while testing the devices comprehensively, i.e., regular CTK test passes did not bring out the failures to occur.   A dedicated team of senior engineers in Adeneo worked with a number of our key customers to analyze and solve the issues across the board. With the latest version of the Adeneo i.MX6 Windows Embedded Compact (7 and 2013) BSPs we are confident this has been achieved.   This white paper is about the investigation and shares some of our discoveries. All information in this document applies to Windows Embedded Compact 7 and 2013 as well as all variants of the i.MX6. Format of the investigation   Based on the problem reports from the field it was complex to identify a single component in a system as the culprit, so we decided to use a formal and broad process to investigate the situation.   A formal code review was done for the BSP code, Microsoft kernel code and customer application code; Lauterbach JTAG hardware debuggers were used to capture all available processor data at the time of crashes; Microsoft’s kernel team assisted with all questions around the Windows CE kernel; Customer’s engineering teams with their specific knowledge of their application developed test applications to replicate the problem more easily Freescale support engineers assisted with all questions around the silicon. Adeneo engineers redesigned the BSP from the ground and optimized it for i.MX6 and Cortex-A9 architecture    In summary, the collaboration of multiple companies, and more important, a diverse group of dedicated individuals with unique value add provided the comprehensive technical coverage to develop the solution to this complex problem History of the i.MX6 BSP   Starting point for the i.MX6 Windows Embedded Compact BSP were earlier BSPs for other application processors from Freescale like i.MX5x series and back to i.MX2x series. On the OS side the history goes back to Windows CE 5.   The good thing with Freescale application processors is that they share peripheral IP blocks across a range of processors, so developers can share and reuse a lot of code. This was very helpful in the beginning to get a BSP working on the new i.MX6 SoC and get projects started. However, the i.MX6 with its multi-core Cortex-A9 architecture which made is challenging to reuse the code designed for single core Cortex A8 or ARM9 CPUs.   In particular, cache management, multi-core support and memory configuration were the areas where existing Cortex-A8 and ARM9 code first was able to get enablement possible, but then failed in long-term stability tests. Cortex-A9 Architecture   The Freescale i.MX6 Application Processor is an implementation of the ARM Cortex-A9 and ARMv7 Instruction Set architecture. This powerful architecture provides a number of features to improve the processing performance, but requires special attention when developing system software.   The i.MX6 provides up to four cores in a symmetric multi-processing configuration under Windows Embedded Compact.   Some of the stability affecting features addressed during the investigation are:   Speculative load and execution Speculative table walks Branch prediction Out-of-order execution and instruction reordering Parallel internal busses Multiple internal buffers and caches Multi-core coherency L1/L2 cache operations Abort handling As part of our code review we identified shortcomings in existing code to correctly configure these features and take proper advantage of them. All code was verified with the ARM architecture documentation and updated to follow the latest recommendations by ARM. Freescale engineers helped to understand implementation details where ARM documentation is vague as it leaves some freedom to silicon vendors how to implement a feature.  All errata documents from Freescale, ARM and other IP vendors were reviewed, and we made sure all applicable fixes or workarounds got implemented in BSP or kernel code.   In discussion with customers we decided on a good working configuration for the i.MX6 processor that focuses on stability without compromising performance.   In multi-core configurations we updated the code to operate all available cores in the same configuration at all times. A critical area was power management code to reapply the same settings when coming back from low power states. Memory Configuration   Cortex-A9 provides a powerful memory management unit that allows it to implement a virtual memory system that operates the device in multiple modes, isolates application processes from each other and provides layers of protection and security.   Looking at the memory space, we have several types of memory with this architecture. We focused on:   Normal memory Device memory ARM architecture has a flat unified memory address space as compared to x86 architecture where we have a memory address space and an I/O address space. This means all our peripheral registers and other I/O addresses are mapped into the same address space together with RAM and ROM (memory-mapped I/O). By default, this is nothing new and not a bad design as it makes things easier for software and hardware developers. In previous versions of Windows CE and other OS all addresses where treated a normal memory and the only difference between RAM and I/O was to set the non-cache flag in the memory properties for I/O. For architectures up to Cortex-A8 this was enough to ensure a stable operation of a system.  In particular with Cortex-A9 speculative engines the legacy approach causes problems. While some speculative features of the cores can be disabled, speculative table walks (which implicitly do speculative loads) can’t be disabled – for Normal Memory. So with Cortex-A9 it is necessary to use the extended access permission features of the architecture and configure all I/O memory as device memory. Device memory amongst others has the no-execute flag set in its properties (XN flag), and the processor doesn’t touch it during speculative operations. Under heavy load and stress this becomes an issue as the processor does more speculative operations per time and the chance to touch I/Os grows. It was one of the main reasons for crashes and deadlocks.   For Windows CE, Microsoft introduced a new way for OEMs to report available memory to the kernel with Compact 7. However, since the issue described above is not an issue on x86 and older ARM architectures, the i.MX6 BSP inherited the old reporting style from its ancestors.   With the legacy memory reporting the OEM fills a memory mapping table with the information about available memory and provides that to the CE kernel during startup. The kernel then creates the initial MMU page table with a cached and a non-cached entry per memory block from the OEM. For the MMU everything is normal memory.   The new WEC7 model works with two tables, the old one for RAM and ROM, and a new one for I/Os (device table). All blocks in the device table are configured as device memory in the MMU and are protected then.   This sounds straight forward, but the devil is in the details. The new model changes the way BSP code can use address translation during the early boot phase. Functionality in the startup code and the KITL component had to be updated in order to work with the new model and allow parameter transfer from boot loader code to OAL code. It is also not well documented and required kernel code reviews and discussions with Microsoft kernel engineers to fine tune this part of the code and optimize it for i.MX6. Another issue was that internal SRAM of the i.MX6, which in the first place appears as part of the processor’s I/O space, and so ended up in the device table. However, the internal RAM is used in low power modes to run power-management code while external RAM is in self-refresh, so it has to be mapped as normal memory without the XN flag set. After all, it wasn’t a trivial piece of work. Synchronization Barriers   Due to the above listed enhancements in Cortex-A9 it is necessary to set synchronization points in the flow of operation at which the processor and all memory has a known state and is in sync. This is especially important when updating processor configuration or during context switches in the OS.   Through code reviews of OAL and kernel code and in discussions with Microsoft we updated the BSP to meet all ARM requirements and fine tune the interfaces between kernel and OAL to provide optimal performance. Errata   During the investigation we spent time on errata for the i.MX6 and its various IP blocks. BSP and kernel code where intensively reviewed for each erratum, if they are affected and a fix or workaround is necessary to be implemented.   As part of this we also looked at the all software implemented BSP for i.MX6 (by Freescale) and its change log to double-check that we didn’t miss anything.   Several critical errata were identified as missing in the code and implemented during the investigation. Three of the necessary code changes were in Microsoft kernel code and required a kernel update. Adeneo Embedded implemented these modifications in the kernel, tested the updated kernel in our test lab as well as with selected customers in the field, and then submitted the kernel change requests to Microsoft to formally release the update through the Windows Embedded Update mechanism. Cache Management   The i.MX6 implements the Cortex-A9 architecture with an internal L1 data and instruction cache and an external L2 unified cache. Internal L1 means the L1 RAM array is located inside the ARM MPCore IP block, and each Cortex-A9 core in the MP cluster has its own L1 cache. External L2 means the L2 RAM array is located outside the ARM MPCore IP block but inside the SoC and connected to the internal AXI bus. Both RAM arrays are not accessible through processor load/store instructions.   Cache memory allows the system to keep often used data in memory with faster access but this requires to synchronize cache memory and external SDRAM so that observers outside the processor-cache block can see data changes.   When configured as SMP cluster some of the necessary L1 maintenance is done by the hardware cache controller. Since we may have up to 4 cores each with its own L1 cache, and a multi-tasking operating system which may assign the same execution thread to different cores due to context switches, it is necessary that all cores have the same synchronized view of the memory. This is done in hardware through the coherency unit in the MPCore as long as single addresses are affected. If the L1 needs maintenance as a whole software has to handle it.   Software also has to handle all L2 cache maintenance operations.   Cache maintenance gets invoked by the kernel normally, but there are a few situations where device drivers or even application software has to request cache maintenance. In any case, the OAL gets these requests and executes them. All cache related code in the OAL was updated and redesigned to meet the ARM architecture requirements and collaborate with the kernel in an optimized way. Shortcomings Cortex-A9 support in the cache maintenance code and maintenance requests from drivers were another major source of instability in the initial BSP.   Some of the complications in this area are:     Optimize L1 code to take advantage of the available hardware support Maintenance requests that include L1 and L2 require a specific procedure to make sure all levels of memory are in sync Maintenance requests can come from multiple threads and CPUs in parallel – L2 code has to be reentrant and multi-core safe DMA controllers work with physical addresses and do not know about caches; when DMA operations are used drivers have to make sure to request the necessary cache maintenance. Some instability with USB, SD and video operations were related to bugs in this area.    Build and Testing   As we learned at the beginning of this investigation that the CTK BSP testing failed to identify these issues we also reviewed our testing approach and implemented improved procedures. A new component in our testing is the stability lab, where we provide a dedicated set of hardware together with IT infrastructure to automate tasks and log results. With approval from our key customers we transferred customer test applications and applications that helped reproducing the issues into more generic test applications and added them to our portfolio.   Another lesson learned is that knowledge of customer use cases is important. We restructured our testing to be closer to real world scenarios and integrate feedback from customers directly.   A number of times during the investigation concerns were raised that the build process or the tools may be the root cause for some issues. Test teams reported different results based on where and how an OS image was built. We analyzed the tool installation and update process and the process to install OS bug fixes from Microsoft, but conclusion was that these observations were red herrings. But we used the knowledge gained from this part of the investigation to improve the build lab in Adeneo Embedded. We enhanced our infrastructure and upgraded tools so that it is easier for us to switch between versions and QFE levels of Windows Embedded Compact and our BSPs. Commitment   This investigation was done over a period of about 8 months, and Adeneo Embedded put a committed effort into it to solve the problems. A core team of engineers worked fulltime on it while an extended group of engineers was available to support where needed (test, build, debugging, applications,..). The problems we had to solve here were not trivial; at times it was like a wild roller coaster ride.   But as a result we have a Freescale i.MX6 Windows Embedded Compact board support package by Adeneo Embedded with significantly improved quality and optimized for this system-on-chip. This brings out the benefits to all customers running Windows Embedded Compact i.MX6 and future CPU architectures on similar ARM cores on WEC7 and WEC2013. For more information email the Adeneo Embedded Support Team at [email protected] or visit our website at http://www.adeneo-embedded.com/ General
View full article
i.MX6Q捕获原始(bayer)数据和debayer [中文翻译版] 见附件   原文链接: https://community.nxp.com/docs/DOC-345148  Graphics & Display i.MX6_All Yocto Project
View full article
The Freescale Cup 2015 EMEA Teams' List 159 teams have registered into The Freescale Cup 2015 EMEA as of 17-Nov-2014 (See attachment) Teams with team name starting with INNOV are Innovation Challenge teams Teams from countries where there is no Freescale Cup Qualification event organized are free to attend the location of their choice. Please contact Flavio Stiffan to ensure that your choice is taken into record.
View full article
Kinetis Design Studio V1.1.1 Released! Greetings, A new release V1.1.1 of KDS is available from the Download tab on http://www.freescale.com/kds V1.1.1 is a full release, and it is recommended to use this new release going forward. V1.1.1 supports Windows (7/8), Linux (32bit binaries for Ubuntu, RHE and CentOS): What's new: Linux RHE and CentOS installation (RPM) Updated KDS User Guide Updated P&E updated site handling to allow support for incremental device support Fixed IP Adddress Setup for P&E Ethernet connection devices (Cyclone MAX, TraceLink) For details, see the V1.1.1 Release Notes.   In addition to the KDS V1.1.1 release, there is an Eclipse update for Processor Expert and Kinetis SDK support. Implemented workaround for HEAP size needs of Newlib-nano GNU library Fixed include path delimiter for Linux hosts Fixed flash configuration field values for several bare project derivatives Updated board configuration templates. Details in the Update1 Release Notes.   Download this .zip file, then install it in Eclipse/KDS using the menu Help > Install New Software (the update will be available on the KDS Eclipse online update site too)   :   Please use KDS V1.1.1 with Eclipse/Processor Expert/SDK Update1 going forward. KDS V1.1.0 projects and settings can be used with V1.1.1.   Best regards, Erich General
View full article
Transfer Learning and the Importance of Datasets Transfer learning is one the most important techniques in machine learning. It gives machine learning models the ability to apply past experience to quickly and more accurately learn to solve new problems. This approach is most commonly used in natural language processing and image recognition. However, even with transfer learning, if you don't have the right dataset, you will not get very far. This application note aims to explain transfer learning and the importance of datasets in deep learning. The first part of the AN goes through the theoretical background of both topics. The second part describes a use case example based on the application from AN12603. It shows how a dataset of handwritten digits can be collected to match the input style of the handwritten digit recognition application. Afterwards, it illustrates how transfer learning can be used with a model trained on the original MNIST dataset to retrain it on the smaller custom dataset collected in the use case. In the end, the AN shows that although handwritten digit recognition is a simple task for neural networks, it can still benefit from transfer learning. Training a model from scratch is slower and yields worse accuracy, especially if a very small amount of examples is used for training. Application note URL: https://www.nxp.com/docs/en/application-note/AN12892.pdf  i.MX RT
View full article
Support SDIO-UART 8987 on mek_8q Below are the patches to support SDIO-UART 8987 M2 module on mek_8q M2 port. After applying the patches, PCIe chip can't be recognized on M2 port. Revert the patches if want to use PCIe chip. Patches are from Andy Duan. --- a/board/freescale/imx8qm_mek/imx8qm_mek.c +++ b/board/freescale/imx8qm_mek/imx8qm_mek.c @@ -373,6 +373,7 @@ int board_init(void) #if defined(CONFIG_USB) && defined(CONFIG_USB_TCPC)         setup_typec(); #endif +       sc_pm_set_resource_power_mode(-1, SC_R_BOARD_R3, SC_PM_PW_MODE_ON); #ifdef CONFIG_SNVS_SEC_SC_AUTO         { --- a/arch/arm64/boot/dts/freescale/imx8qm-mek.dts +++ b/arch/arm64/boot/dts/freescale/imx8qm-mek.dts @@ -151,6 +151,11 @@     };   + usdhc3_pwrseq: usdhc3_pwrseq { +  compatible = "mmc-pwrseq-simple"; +  reset-gpios = <&lsio_gpio1 13 GPIO_ACTIVE_LOW>; + }; +   epdev_on: fixedregulator@100 {    compatible = "regulator-fixed";    pinctrl-names = "default", "sleep"; @@ -159,8 +164,6 @@    regulator-min-microvolt = <3300000>;    regulator-max-microvolt = <3300000>;    regulator-name = "epdev_on"; -  gpio = <&lsio_gpio1 13 0>; -  enable-active-high;   };     reg_fec2_supply: fec2_nvcc { @@ -1036,6 +1039,22 @@   status = "okay";  };   +&usdhc3 { +        pinctrl-names = "default", "state_100mhz", "state_200mhz"; +        pinctrl-0 = <&pinctrl_usdhc3>,<&pinctrl_usdhc3_gpio>; +        pinctrl-1 = <&pinctrl_usdhc3>,<&pinctrl_usdhc3_gpio>; +        pinctrl-2 = <&pinctrl_usdhc3>,<&pinctrl_usdhc3_gpio>; +        bus-width = <4>; + pinctrl-assert-gpios = <&lsio_gpio4 9 GPIO_ACTIVE_HIGH>; + pinctrl-assert-gpios = <&lsio_gpio4 10 GPIO_ACTIVE_HIGH>; + mmc-pwrseq = <&usdhc3_pwrseq>; + pm-ignore-notify; + keep-power-in-suspend; + non-removable; + cap-power-off-card; +        status = "okay"; +}; +  &i2c0 {   #address-cells = <1>;   #size-cells = <0>; @@ -1540,7 +1559,6 @@    fsl,pins = <     IMX8QM_PCIE_CTRL0_WAKE_B_LSIO_GPIO4_IO28  0x04000021     IMX8QM_PCIE_CTRL0_PERST_B_LSIO_GPIO4_IO29  0x06000021 -   IMX8QM_USDHC2_RESET_B_LSIO_GPIO4_IO09   0x06000021    >;   };   @@ -1618,7 +1636,26 @@     IMX8QM_USDHC1_DATA1_CONN_USDHC1_DATA1   0x00000021     IMX8QM_USDHC1_DATA2_CONN_USDHC1_DATA2   0x00000021     IMX8QM_USDHC1_DATA3_CONN_USDHC1_DATA3   0x00000021 -   IMX8QM_USDHC1_VSELECT_CONN_USDHC1_VSELECT  0x00000021 +   IMX8QM_USDHC1_VSELECT_CONN_USDHC1_VSELECT               0x00000021 +  >; + }; + + pinctrl_usdhc3_gpio: usdhc3grpgpio { +  fsl,pins = < +   IMX8QM_USDHC2_VSELECT_LSIO_GPIO4_IO10   0x00000021 +   IMX8QM_LVDS1_I2C0_SDA_LSIO_GPIO1_IO13   0x06000021 +   IMX8QM_USDHC2_RESET_B_LSIO_GPIO4_IO09   0x06000021 +  >; + }; + + pinctrl_usdhc3: usdhc3grp { +  fsl,pins = < +   IMX8QM_USDHC2_CLK_CONN_USDHC2_CLK         0x06000041 +   IMX8QM_USDHC2_CMD_CONN_USDHC2_CMD         0x00000021 +   IMX8QM_USDHC2_DATA0_CONN_USDHC2_DATA0     0x00000021 +   IMX8QM_USDHC2_DATA1_CONN_USDHC2_DATA1     0x00000021 +   IMX8QM_USDHC2_DATA2_CONN_USDHC2_DATA2     0x00000021 +   IMX8QM_USDHC2_DATA3_CONN_USDHC2_DATA3     0x00000021    >;   };   @@ -1680,13 +1717,11 @@     pinctrl_wlreg_on: wlregongrp{    fsl,pins = < -   IMX8QM_LVDS1_I2C0_SDA_LSIO_GPIO1_IO13  0x06000000    >;   };     pinctrl_wlreg_on_sleep: wlregon_sleepgrp{    fsl,pins = < -   IMX8QM_LVDS1_I2C0_SDA_LSIO_GPIO1_IO13  0x07800000    >;   };  
View full article
How to use LPUART to RS485 on the i.MXRT1050 Recently, we often encounter customers using i.MXRT for RS485 communication. Mostly the problem of receiving and sending direction conversion in the process of using. Taking iMXRT1050 and SN65HVD11QDR as examples, The document introduces the LPUART to RS485 circuit and the method of transceiver control. The working principle is as follows: LPUART TXD: Transmit Data LPUART RXD: Receive Date LPUART RTS_B: Request To Send   The main control methods are as follows: 1  Use TXD signal line to do hardware automatic transceiver control According to the UART protocol, when the line is idle, TX is logic high. After the NOT gate, the LOW level is added to the direction control terminal, so when the UART is not  transmitting data, RS485 is in the state of receiving data. 2   Use GPIO control & LPUART_RTS More detailed information, users can refer to the link: https://www.nxp.com/docs/en/application-note/AN12679.pdf Note: Using GPIO control, software needs to judge the timing of receiving and sending. If the control is not good, it is easy to lose data. In order to control it well, the software must respond to TX FIFO "empty" interrupt, or query the sending status register, and accurately grasp the control opportunity, so as to ensure that there is no error in sending and receiving. Combined with the above methods, some customers are using the following control: Best Regards
View full article
AppWizard: Implementing a Real-Time Clock Introduction A common need for GUI applications is to implement a clock function.  Whether it be to create a clock interface for the end user's benefit, or just to time animations or other actions, implementing an accurate clock is a useful and important feature for GUI applications.  The aim of this document is to help you implement clock functions in your AppWizard project.   Methods When implementing a real-time clock, there are a couple of general methods to do so.   Use an independent timer in your MCU Using animation objects Each of these methods have their advantages and disadvantages.  If you just need a timer that doesn't require extra code and you don't require control or assurance of precision, or maybe you can't spare another timer, using an animation object (method #2) may be a good option in that application.  If your application requires an assurance of precision or requires other real-time actions to be performed that AppWizard can't control, it is best to implement an independent timer in your MCU (method #1).  Method 1:  Independent MCU Timer Implementing a timer via an independent MCU timer allows better control and guarantees the precision because it isn't a shared clock and the developer can adjust the interrupt priorities such that the timer interrupt has the highest priority.  AppWizard timing uses a common timer and then time slices activities similar to how an operating system works.  It is for this reason that implementing an independent MCU timer is best when you need control over the precision of the timer or you need other real-time actions to be triggered by this timer.  When implementing a timer using an independent MCU timer (like the RTC module), an understanding of how to interact with Text widgets is needed. Let's look at this first.   Interacting with Text Widgets Editing Text widgets occurs through the use of the emWin library API (the emWin library is the underlying code that AppWizard builds upon). The Text widget API functions are documented in the emWin Graphic Library User Guide and Reference Manual, UM3001.  Most of the Text widget API functions require a Text widget handle.  Be sure to not confuse this handle for the AppWizard ID.  Imagine a clock example where there are two Text widgets in the interface:  one for the minutes and one for the seconds.  The AppWizard IDs of these objects might be ID_TEXT_MINS and ID_TEXT_SECONDS respectively (again, these are not to be confused with the handle to the Text widget for use by emWin library functions).  The first action software should take is to obtain the handle for the Text widgets.   This can be done using the WM_GetDialogItem function.  The code to get the active window handle and the handle for the two Text widgets is shown below: activeWin = WM_GetActiveWindow(); textBoxMins = WM_GetDialogItem(activeWin, ID_TEXT_MINS); textBoxSecs = WM_GetDialogItem(activeWin, ID_TEXT_SECONDS);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Note that this function requires the handle to the parent window of the Text widget.  If your application has multiple windows or screens, you may need to be creative in how you acquire this handle, but for this example, the software can simply call the WM_GetActiveWindow function (since there is only one screen).  When to call these functions can be a bit tricky as well.  They can be called before the MainTask() function of the application is called and the application will not crash.  However, the handles won't be correct and the Text widgets will not be updated as expected.  It's recommended that these handles be initialized when the screen is initialized.  An example of how this would be done is shown below: void cbID_SCREEN_CLOCK(WM_MESSAGE * pMsg) { extern WM_HWIN activeWin; extern WM_HWIN textBoxMins; extern WM_HWIN textBoxSecs; extern WM_HWIN textBoxDbg; if(pMsg->MsgId == WM_INIT_DIALOG) { activeWin = WM_GetActiveWindow(); textBoxMins = WM_GetDialogItem(activeWin, ID_TEXT_MINS); textBoxSecs = WM_GetDialogItem(activeWin, ID_TEXT_SECONDS); textBoxDbg = WM_GetDialogItem(activeWin, ID_TEXT_DBG); } GUI_USE_PARA(pMsg); }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Once the Text widget handles have been acquired, the text can be updated using the TEXT_SetText() function or the TEXT_SetDec() function in this case, because the Text widgets are configured for decimal mode, since we want to display numbers.  An example of the code to do this is shown below.  /* TEXT_SetDec(Text Widget Handle, Value as Int, Length, Shift, Sign, Leading Spaces) */ if(TEXT_SetDec(textBoxSecs, (int)gSecs, 2, 0, 0, 0)) { /* Perform action here if necessary */ } if(TEXT_SetDec(textBoxMins, (int)gMins, 2, 0, 0, 0)) { /* Perform action here if necessary */ } ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ Method 2:  Animation Objects When implementing a real-time clock using animation objects, it is necessary to implement a loop.  This could be done outside of the AppWizard GUI (in your code) but because the timing precision can't be guaranteed, it's just as easy to implement a loop in the AppWizard GUI if you know how (it isn't very intuitive as to how to do this). Before examining the interactions to do this, let's look at the variables and objects needed to do this.  ID_VAR_SECS - This variable holds the current seconds value. ID_VAR_SECS_1 - This variable holds the next second value.  ID_TEXT_SECONDS - Text box that displays the current seconds value. ID_END_CNT - Variable that holds the value at which the seconds rolls over and increments the minute count ID_TEXT_MINS - Text box that holds the current minute count. ID_MIN_END_CNT - Variable that holds the value at which the minutes rolls over (which would also increment the hour count if the hours were implemented). ID_BUTTON_SECS - This is a hidden button that initiates actions when the seconds variable has reached the end count.  Now, here are the interactions used to implement the clock feature using animation interactions.  The heart of the loop are the interactions triggered by ID_VAR_SECS.  ID_VAR_SECS -> ID_VAR_SECS_1:  When ID_VAR_SECS changes, it needs to add one to ID_VAR_SECS_1 so that the animation will animate to one second from the current time. ID_VAR_SECS -> ID_TEXT_SECONDS:  When ID_VAR_SECS changes, it also needs to start the animation from the current value to the next second (ID_VAR_SECS_1). A very essential part of the loop is ensuring the animation restarts every time.  So ID_TEXT_SECONDS needs to change the value of ID_VAR_SECS when the animation ends. ID_VAR_SECS is changed to the current time value, ID_VAR_SECS_1. When the ID_TEXT_SECONDS animation ends, it must also decrement the ID_VAR_END_CNT variable.  This is analogous to the control variable of a "For" loop being updated. This is done using the ADDVALUE job, adding '-1' to the variable, ID_VAR_END_CNT. When ID_VAR_END_CNT changes, it updates the hidden button, ID_BUTTON_SECS, with the new value.  This is analogous to a "For" loop checking whether its control variable is still within its limits.   The interactions in group 5 are interactions that restart the loop when the seconds reach the count that we desire.  When the loop is restarted, the following actions must be taken: Set ID_VAR_SECS and ID_VAR_SECS_1 to the initial value for the next loop ('0' in this case).  Note that ID_VAR_SECS_1 MUST be set before ID_VAR_SECS.  Additionally, if the loop is to continue, ID_VAR_SECS and ID_VAR_SECS_1 must be set to the same value.   ID_TEXT_SECONDS is set to the initial value.  If this isn't done, then the text box will try to animate from the final value to the initial value and then will look "weird". ID_VAR_END_CNT is reset to its initial value (60 in this case).  ID_BUTTON_SECS is also responsible for updating the minutes values.  In this case, it's incrementing the ID_TEXT_MINS value (counting up in minutes) and decrementing the ID_VAR_MIN_END_CNT  Adjusting the time of an animation object The animation object (as well as other emWin objects) use the GUI_X_DELAY function for timing.  It is up to the host software to implement this function.  In the i.MX RT examples, the General Purpose Timer (GPT) is used for this timer.  So how the GPT is configured will affect the timing of the application and the how fast or slow the animations run. The GPT is configured in the function BOARD_InitGPT() which resides in the main source file.  The recommended way to adjust the speed of the timer is by changing the divider value to the GPT. Conclusion So we have seen two different methods of implementing a real-time clock in an AppWizard GUI application.  Those methods are: Use an independent timer in your MCU Using animation objects Using an independent timer in your MCU may be preferred as it allows for better control over the timing, can allow for real-time actions to be performed that AppWizard can't control, and provides some assurance of precision.  Using animation objects may be preferred if you just need a quick timer implementation that doesn't require you to manually add code to your project or use a second timer.   i.MXRT 101x i.MXRT 102x i.MXRT 105x i.MXRT 106x
View full article
Creating a gated timer using the FTM and Comparator Introduction What is a gated timer and why would I need one? A gated timer is a timer whose clock is enabled (or "gated") by some external signal.  This allows for a low code overhead method of synchronizing a timer with an event and/or measuring an event. This functionality is not commonly included on Freescale microcontroller devices (this functionality is only included on devices that are equipped with the upgraded TPM v2 peripheral; currently K66, K65, KL13, KL23, KL33, KL43, KL03) but can be useful in some situations.  Some applications which may find a gated timer useful include asynchronous digital sampling, pulse width duty cycle measurement, and battery charging. How do I implement a gated timer with my Kinetis FTM or TPM peripheral? To implement a true gated timer with a Kinetis device (that does not have the TPM v2 peripheral), additional hardware will be required to implement the enable/disable functionality of a gated timer.  This note will focus on two different ways (low-true and high-true) to implement a gated timer.  The method used will depend on the requirements of your application. Implementing a gated timer for Kinetis devices without the TPM v2 peripheral requires the use of a comparator and a resistive network to implement a gated functionality (NOTE:  Level shifters could be used to replace the resistive network described; however, a resistive network is likely more cost effective, and thus, is presented in this discussion).  Figure 1 below is the block diagram of how to implement a gated timer functionality.  The theory behind this configuration will be explained in later sections. Theory of Operation Comparator and resistive network implementation The comparator is the key piece to implementing this functionality. For those with little experience with comparators (or need a refresher), a comparator is represented by the following figure.  Notice that there are three terminals that will be of relevance in this application: a non-inverting input (labeled with a '+' sign), an inverting input (labeled with a '-' sign), and an output. A comparator does just what the name suggests: it compares two signals and adjusts the output based on the result of the comparison.  This is represented mathematically in the figure below. Considering the above figure, output of the comparator will be a  logic high when the non-inverting input is at a higher electric potential than the inverting input.  The output will be a logic low if the non-inverting input is at a lower electric potential than the inverting input.  The output will be unpredictable if the inputs are exactly the same (oscillations may even occur since comparators are designed to drive the output to a solid high or solid low).  This mechanism allows the clock enable functionality that is required to implement a gated timer function provided that either the non-inverting or inverting input is a clock waveform and the opposite input is a stable logic high or low (depending on the desired configuration) and neither input is ever exactly equal.  Comparator Configurations There are two basic signal configurations that an application can use to enable the clock output out of the comparator: low-true signals and high-true signals.  These two signals and some details on their implementation are explained in the following two sections.  Low-true enable A low-true enable is an enable signal that will have zero electric potential (relative to the microcontroller) or a "grounded" signal in the "active" state.  This configuration is a common implementation when using a push button or momentary switch to provide the enable signal.  When using this type of signal, you will want to connect the enable signal to the non-inverting input of the comparator, and connect the clock signal to the inverting input. The high level of the enable signal should be guaranteed to always be the highest voltage of the input clock plus the maximum input offset of the comparator. To find the maximum input offset of the comparator, consult the device specific datasheet.  See the figure below to see a graphical representation of areas where the signal will be on and off. The external hardware used should ensure that the low level of the enable signal never dips below the lowest voltage of the input clock plus the maximum input offset of the comparator. The following figure displays one possible hardware configuration that is relatively inexpensive and can satisfy these requirements. High-true enable A high-true enable is an enable signal that will have an electric potential equal to VDD of the microcontroller in the "active" state.  This configuration is commonly implemented when the enable signal is provided by an active source or another microcontroller.  When interfacing with this type of signal, you will want to connect the enable signal to the inverting input of the comparator, and connect the clock signal to the non-inverting input.  When the comparator is in the inactive state, it should be at or below the lowest voltage of the clock signal minus the maximum input offset of the comparator.  Refer to the following figure for a diagram of the "on" and "off" regions of the high true configurations. The external hardware will need to guarantee that the when the enable signal is in the active state, it does not rise above the highest voltage of the clock signal minus the maximum input offset of the comparator. The following figure displays one possible hardware configuration that is relatively inexpensive and can satisfy these requirements. Clocking Options Clocking waveform requirements will vary from application to application.  Specifying all of the possibilities is nearly impossible.  The point of this section is to inform what options are available from the Kinetis family and provide some insight as to when it might be relevant to investigate each option. The Kinetis family provides a clock output pin for most devices to allow an internal clock to be routed to a pin.  The uses for this option can vary.  In this particular scenario, it will be used to provide the source clock for the comparator clock input. Here are the most common clock output pin options across the Kinetis K series devices.  (NOTE:  If the application requires a clock frequency that the CLKOUT signal cannot provide, a separate FTM or TPM instance or another timer module can be used to generate the required clock.) In the Kinetis L series devices, the following options will be available. The clock option selected should be the slowest allowable clock for the application being designed.  This will minimize the power consumption of the application.  For applications that require high resolution, the Bus, Flash, or Flexbus clock should be selected (note that the Flexbus clock can provide an independently adjustable clock, if it is not being used in the application, as it is always running).  However, if the target application needs to be more power efficient, the LPO or MCGIRCLK should be used.  The LPO for the Kinetis devices is a fixed 1 kHz frequency and will, therefore, only be useful in applications that require millisecond resolutions. Kinetis Hardware Support Kinetis K Series MCUs Kinetis L Series MCUs Kinetis V Series MCUs
View full article
Kinetis软件开发套件(KSDK)安装指南 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 该文件描述了如何安装 KSDK,通过图像和描述逐步简单易行,因此您在安装时不会遇到问题。
View full article
Known issue: STB GUI for eCompass kits returns error when using without Adobe Flash Player + ActiveX Issue Using the STB GUI for eCompass kits RD4247MAG3110 and RD4247FXOS8700 only -- v6.1.0.1 on a machine that does not have the Adobe Flash Player ActiveX program installed may run into the following error after pressing the eCompass button: Solution Install the Adobe Flash Player + ActiveX from Adobe. Let us know if you are facing any other issues with the STB GUI v6.1.0.1. Regards, Tomas Magnetic Sensors
View full article
QorIQ T1040 Communications Processor as "Router on a Chip" See a "routing on a chip" solution on the QorIQ Processor T1040 QDS with Layer 2 switching, including Layer 2 and Layer 3 processing through the L2 switch and FMan, and detailing drivers and stacks support.       Features Integrated switching (LAN, WAN, WLAN) Firewall support with HW offload DMZ partition using NXP Embedded Hypervisor Remote administration   Featured NXP Products T1040: QorIQ T Series Quad- and Dual-Core Communications Processors Industrial
View full article
Special Offers!!! Here are some special offers from our partners from around the world: MathWorks support software for The Freescale Cup participants Stay tuned... more to come
View full article
OPENM4.rar 底层驱动源码,mdk5.0打开。 另有移植好了的ucGUI的源码。 底层驱动源码,mdk5.0打开。 另有移植好了的ucGUI的源码。
View full article
MM9Z1_638 Intelligent Battery Sensor Demo Owner: Neil Krohn NXP's MM9Z1_638 is a fully integrated battery monitoring device for mission critical automotive and industrial applications. An S12Z microcontroller, SMARTMOS analog control IC, CAN protocol module and LIN interface for communications functions are embedded into this single-package soltuion. The MM9Z1_^38 battery sensor measures key battery parameters for monitoring state of health, state of charge and state of function for early batteries as well as emerging battery applications, such as 14 V stacked cell Li-Ion, high voltage junction boxes, and 24 V truck batteries.     Features The MM9Z1_638 is a fully integrated battery monitoring device for mission critical automotive and industrial applications. An S12Z microcontroller, SMARTMOS analog control IC, CAN protocol module and LIN interface for communications functions are embedded into this single-package solution. The MM9Z1_38 battery sensor measures key battery parameters for monitoring state of health, state of charge and state of function for early batteries as well as emerging battery applications, such as 14 V stacked cell Li-Ion, high voltage junction boxes, and 24 V truck batteries. Featured NXP Products MM9Z1_638: Battery Sensor with CAN and LIN Product Features: Wide range battery current measurement; on-chip temperature measurement Four battery voltage measurements with internal resistor dividers, and up to five direct voltage measurements for use with an external resistor divider Measurement synchronization between voltage channels and current channels Five external temperature sensor inputs with internal supply for external sensors Low-power modes with low-current operation Links Freescale Concept Car   Automotive
View full article
使用 Processor Expert 在 CW 中生成代码 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 附件文档展示了如何使用 Processor Expert Driver Suit 为 CW 生成代码。您可以在幻灯片底部的注释中看到详细信息。 顺祝商祺! 卡洛斯
View full article
Interfacing PN7150 or PN7120 to Kinetis Freedom Boards with KSDK v1.3 Hello NFC community:   NXP released the new PN7150 NFC Controller chip with enhanced power output, and there is also the new Arduino compatible demokit OM5578/PN7150ARD. See more information in the next pages:   PN7150: High performance full NFC Forum-compliant controlle|NXP OM5578/PN7150ARD: Demoboards for PN7150|NXP   There is also a new PN7120 SBC kit for arduino:   http://cache.nxp.com/documents/user_manual/UM11008.pdf http://cache.nxp.com/documents/user_manual/UM11008.pdf   Due to the Arduino interface pinout, these kits can also be used with Kinetis Freedom Boards. The target of this document is to create projects to use the NFC Controller lîbrary with the PN7120 or PN7150 together with a Kinetis host. Also you will find example projects created for the FRDM-K64F and FRDM-KL43Z.     Requirements:   - Kinetis Software Development Kit v1.3. -> Software Development Kit for Kinetis MCUs|NXP - KDS v3.x with KSDK v1.3 Eclipse Update Installed -> Kinetis Design Studio Integrated Development Enviro|NXP - Kinetis SDK project generator. Available from the "Downloads" tab of KSDK webpage -> Software Development Kit for Kinetis MCUs|NXP     CREATING NEW PROJECT   NOTE: In this step-by-step procedure the FRDM-K64F is used as reference. You can follow the guide according to your own Freedom board.   1) Open the KSDK project generator. 2) Enter the KSDK v1.3 installation path, give a name to the project, select your Freedom board and click on "Advanced":     3) In the advanced settings window enable the checkboxes for:   - Include BSP files - Generate standalone project - Kinetis Design Studio toolchain - Board (confirm that your board is shown in the drop-down menu)   NOTE: The path for the newly created project is set by default inside of the KSDK v1.3 installation. For a standalone project you can change the location, just remember such path to import the project to KDS workspace in a later step.   Leave the rest of configurations as default (New project, Platform library, no RTOS) and finally click on "Advanced Generate!".     4) From Kinetis Design Studio go to File -> Import.     5) Go to General -> Existing Projects into workspace and click "Next".     6) In "select root directory" browse to the location of the platform lib for the created project. By default this path would be:   C:\nxp\KSDK_1.3.0\examples\frdmk64f\user_apps\ \lib\ksdk_platform_lib\kds\   : The name given initially to the project. : The corresponding device number (K64F12 in this case).   Make sure that the project check box is enabled and click on "Finish".     7) Select the KSDK platform library project and click on the "Hammer icon" to build it.     😎 Repeat steps 4 through 6, but this time browse to the location of the application project. In this example the path is:   C:\nxp\KSDK_1.3.0\examples\frdmk64f\user_apps\< project_name >\kds     INTEGRATING NFC CONTROLLER LIBRARY   The next steps describe how to integrate the NFC NCI library to your newly created project.   - The Arduino Interface Boards use the next pinout for communication between the OM5578/PN7150 or OM5577/PN7120 kits with the Freedom or Arduino boards:     As shown in the picture, the pinouts are similar except for the 5V connection. This leverages the enhanced output power feature of the PN7150 NFC Controller.   - We need to check the corresponding pins that will be used from the Freedom board. In this case, the connections to the FRDM-K64F board would be as next:   IMPORTANT: The pinout shown below corresponds to Rev E3 schematics of FRDM-K64F. For Rev D1 the pin used for IRQ (header location J2[2]) must be PTA0 instead of PTC12.     1) Open the file gpio_pins.c and add 2 pin configurations: 1 input pin called NFCCirqPin and 1 output pin called NFCCvenPin.   gpio_input_pin_user_config_t NFCCirqPin = {   .pinName = kGpioNFCCirq,   .config.isPullEnable = false,   .config.pullSelect = kPortPullUp,   .config.isPassiveFilterEnabled = false,   .config.interrupt = kPortIntDisabled, }; gpio_output_pin_user_config_t NFCCvenPin = {   .pinName = kGpioNFCCven,   .config.outputLogic = 1,   .config.slewRate = kPortSlowSlewRate,   .config.driveStrength = kPortLowDriveStrength, };   2) In the file gpio_pins.h add 2 extra elements to the gpio enumeration. Also add extern declarations for the 2 pins defined in the previous step.   NOTE: For FRDM-K64F the pins are PTC12 and PTC3. Select corresponding pins for your Freedom board.   extern gpio_input_pin_user_config_t NFCCirqPin; extern gpio_output_pin_user_config_t NFCCvenPin; /*! @brief Pin names */ enum _gpio_pins_pinNames {   kGpioSW2  = GPIO_MAKE_PIN(GPIOC_IDX, 6U),   kGpioSW3  = GPIO_MAKE_PIN(GPIOA_IDX, 4U),   kGpioSdhc0Cd  = GPIO_MAKE_PIN(GPIOE_IDX, 6U),   kGpioLED1     = GPIO_MAKE_PIN(GPIOE_IDX, 26U),   kGpioLED2     = GPIO_MAKE_PIN(GPIOB_IDX, 22U),   kGpioLED3     = GPIO_MAKE_PIN(GPIOB_IDX, 21U),   kGpioNFCCirq  = GPIO_MAKE_PIN(GPIOC_IDX,  12), /* GPIO for NFCC IRQ pin */   kGpioNFCCven  = GPIO_MAKE_PIN(GPIOC_IDX,  3),  /* GPIO for NFCC VEN pin */ }   3) In the file pin_mux.c define a function to configure the MUX setting of the required GPIO and I2C pins to interface with the NFC Controller.   void configure_nfcc_pins(void) {   /** I2C_SDA **/   PORT_HAL_SetMuxMode(PORTE,25u,kPortMuxAlt5);   PORT_HAL_SetOpenDrainCmd(PORTE,25u,true);   /** I2C_SCL **/   PORT_HAL_SetMuxMode(PORTE,24u,kPortMuxAlt5);   PORT_HAL_SetOpenDrainCmd(PORTE,24u,true);   /* NFCC IRQ */   PORT_HAL_SetMuxMode(PORTC,12u,kPortMuxAsGpio);   /* NFCC VEN */   PORT_HAL_SetMuxMode(PORTC,3u,kPortMuxAsGpio); }   NOTES: - Check the corresponding pins on your Freedom board. FRDM-K64F uses PTC12/PTC3 as GPIOs while PTE24/PTE25 are configured as I2C pins. For I2C pins also check the MUX number in the device's Reference Manual (e.g. PTE24/PTE25 in K64F have the I2C function in ALT5). - This function needs to be called from your project to configure the required pins. e.g. from hardware_init(). - Some Freedom boards share the I2C pins of the Arduino compatible header with an on-board I2C device (e.g. accelerometer), with SDA/SCL pull-up resistors populated already. If this is not the case for your board, make sure to place external pull-ups to  MCU VDD or enable the internal pull-ups as temporary workaround.   4) Add the prototype of the function to the header file pin_mux.h.   /* ** =================================================== **     Method :  configure_nfcc_pins */ /*! **     @brief **         Set mux configuration for I2C and GPIO pins **         to interface with the NFC Controller. */ /* ==================================================*/ void configure_nfcc_pins(void);   5) Copy the folders NfcLibrary and TML to the project folder. The file fsl_i2c_irq.c is also required. In this case the file is found in the next path:   C:\nxp\KSDK_1.3.0\examples\frdmk64f\user_apps\ \platform\drivers\src\i2c   NOTE: If the project was not created in standalone mode, just search the fsl_i2c_irq.c file from your KSDK installation.       6) Add the NfcLibrary and TML folders with all its subfolders and files to the project's tree, so the lilbrary is part of the build. Also add the file fsl_i2c_irq.c to the project. In KDS you can drag and drop folders and files to the project explorer view.       7) Add the compiler include paths for the inc folders.     😎 From the KDS preprocessor settings add or remove the next conditional compilation macros according to your functional requirements:   CARDEMU_SUPPORT: The NFC Controler host (MCU) can emulate a contactless card which can be accessed by an external Reader/Writer. P2P_SUPPORT: The host MCU can establish a 2-way communication accesing to or sending data to an external Reader/Writer. RW_SUPPORT: With this mode the host can access a remote contactless tag/card via the NFC Controller. NCI-DEBUG: If defined, all information transferred between the host MCU and the NFC Controller Interface (commands, responses, notifications, data) is echoed to console for debug purposes.     9) The file tml.h includes the macro NFCC_I2C_INSTANCE which defines the I2C module to use. For FRDM-K64F the module is I2C0. Set this macro according to your Freedom board.   /* NFC Controller I2C interface configuration */ #define NFCC_I2C_INSTANCE  0   At this point the project is ready to use the NFC Controller library and interface the Kinetis Freedom board with PN7120 or PN7150 NFC Controllers.     DEMO PROJECTS   At the end of this document you will find 2 example project packages for the FRDM-K64F and FRDM-KL43Z. Both of the projects can be used with either the OM5578/PN7150 or OM5577/PN7120 kits using the Arduino interface boards.   Each ZIP package includes 2 projects (example application and KSDK library). Unzip the package and import the projects from the resulting location.   Do not select "Copy projects into workspace" in KDS. If you do so the build will fail due to the linked source files not copied over.   The projects must be built in the next order:   1- Platform library project (FRDM-xxx_NFCNCI_Example\lib\ksdk_platform_lib\kds\ ) 2- Demo project (FRDM-xxx_NFCNCI_Example\kds)   The OpenSDA virtual COM port is used to send data to a terminal at 115200 baud. Below an explanation on how to test the different project example features.   RW mode:   - Placing a tag with a single text, URI or vCard NDEF record next to the NFC reader antenna. Examples:         P2P mode:   - Bring an android phone with NFC enabled close to the NFC controller antenna and use the "beaming" feature. In the case below the NXP home page is "beamed" from the adroid phone's explorer. After this, the NFC enabled phone will receive the "Test" NDEF record.                     CARD EMULATION mode     For this mode it is required to remove the P2P_SUPPORT macro and rebuild/reprogram the project.   - Bringing an android phone set to read a NFC tag close to the NFC controller board. The NFC enabled phone will detecta T4T tag type with the "Test" NDEF record.     I hope you can find this document useful. Any questions or doubts please let me know in the comments.   Jorge Gonzalez NXP Technical Support NFC Controller Solutions Re: Interfacing PN7150 or PN7120 to Kinetis Freedom Boards with KSDK v1.3 Hi Jorge, I ported the PN7150 to KW36, the CARDEMU works fine, but the p2p mode is not ok. The log is "WRONG DISCOVERY", I debugged it, found that the RfInterface.Interface = INTF_FRAME, I used the Huawei and Samsung phones. But  if I test with two PN7150, it is good. I'm new to NFC, could you tell me why.
View full article
Ubuntu 12.04 64-bit Precise Pangolin Host Setup for Building i.MX28 L2.6.35_MX28_SDK_10.12_SOURCE [1] [1] Overview Resources Download Ubuntu 12.04.01 Download i.MX28EVK BSP and Documents Ubuntu Host Setup Host Package Update Ubuntu Configuration PDF Sudo Priviledges Default Shell CCACHE Directory Layout Extract SDK and Documents Install BSP Sources Ubuntu Software Packages for LTIB Patching LTIB Create SD Card Using Ubuntu Host Media Booting Selection Cable Connections   Overview Freescale's i.M28EVK development kit provides a platform for running software and evaluating features of the i.MX28 processor. This document provides the details for running the Linux Board Support Package (BSP) on the Ubuntu 12.04 64-bit Precise Pangolin Host on an Intel/AMD architecture computer. The 32-bit host is not covered in this document and does have different configuration steps than described here.   An Ubuntu Linux host is used to cross-compile the BSP creating ARM images. The BSP provides a build system named Linux Target Image Builder, (LTIB),  the GNU tool suite for compiling and debugging, U-Boot boot loader, Linux kernel, and a root file system. Resources i.M28EVK- i.MX28 Evaluation Kit Web Page MCIMX28EVKJ Product Summary Page- i.MX28 Download Collateral L2.6.36_MX28_SDK_10.12_Source- BSP Source Download Linux documentation - i.MX28EVK Documentation Ubuntu 12.04.1 LTS (Precise Pangolin)- Ubuntu 12.04 Release Download Ubuntu 12.04.01 A dedicated computer running Ubuntu or a Virtual Machine, (VMware or VirtualBox), can be used for running the Host Ubuntu software. The Ubuntu image is available for downloaded from the Ubuntu site: Ubuntu 12.04.1 LTS (Precise Pangolin).   This Ubuntu host ISO was used with the md5 checksum: ubuntu-12.04.1-desktop-amd64.iso  06472ddf11382c8da1f32e9487435c3d   One way to acquire the ISO is to use zsync to download: zsync http://releases.ubuntu.com/12.04/ubuntu-12.04.1-desktop-amd64.iso.zsync  Once downloaded, installing the ISO is user preference - either a dedicated Linux PC or in a Virtual Machine.   Download i.MX28EVK BSP and Documents The BSP download is from this site L2.6.36_MX28_SDK_10.12_Source and the documents from Linux documentation that requires a free registration to specify login credentials,   436e0b8e1c7976c657d530a45f9dbd0c L2.6.35_10.12.01_SDK_source_bundle.tar.gz de0274320a17c1e989d1ef5c088973e2 L2.6.35_10.12.01_SDK_docs.tar.gz   Ubuntu Host Setup Ubuntu login credentials of User: user Password: user are used for this documents. Host Package Update Once logged in to the Ubuntu host, the existing packages are brought up to date to the latest version before installing the BSP. The Ubuntu package manager used is apt-get. $ sudo apt-get update $ sudo apt-get upgrade  01. Check all installed packages for new revisions 02. all newer packages found are installed.   Addtional packages are required for the ltib build system. Ubuntu Configuration PDF evince is the default pdf reader, another option is zathura. $ sudo apt-get install zathura Sudo Priviledges LTIB requires super user priviledges for some operations. To enable a visudo entry is added to the sudo'ers file. For more information run 'man visudo'.   $ sudo visudo  The first word, user, is the login account 'user' This can be changed to whatever login you used, or if you have groups configured you can provide a group that developers are in - refer to the man page for sudo for details. Add this line:   user ALL =NOPASSWD: /usr/bin/rpm/ /opt/freescale/ltib/usr/bin/rpm   Default Shell Ubuntu uses the default shell 'dash'. This however causes failures on bash scripting which is part of the ltib system. Change the default shell from 'dash' to 'bash'   $ sudo update-alternatives --install /bin/sh sh /bin/bash 1  CCACHE ccache provides a fast C/C++ compiler cache which is supported in the ltib system. To configure once the ccache package has been installed: $ sudo apt-get install ccache $ ccache -M 50M $ ccache -c  02. Set the cache limit to 50 Meg 03. Clear the cache folder   Directory Layout The following directory structure is used: /home/user/freescale/imx28/ |-- archive |-- L2.6.35_10.12.01_ER_source |-- L2.6.35_10.12.01_SDK_docs |-- L2.6.35_10.12.01_SDK_scripts |-- ltib |-- ubuntu-imx28-ltib-patch   The archive directory is where the BSP and documents are stored; command to create the directory: $ mkdir -p ~/freescale/imx28/archive   Extract SDK and Documents The following instructions were used to extract the contents of the Software Development Kit:   $ cd ~/freescale/imx28/archive $ tar -zxf L2.6.35_10.12.01_SDK_source_bundle.tar.gz -C ..    01. Change into the directory containing the tar ball that is compressed. 02. Extract the contents into the directory above (-C ..) the current directory -z unzip -x extract -f L2.6.35_10.12.01_SDK_source_bundle.tar.gz   $ tar -zxf L2.6.35_10.12.01_SDK_docs.tar.gz  01. Extract the contents into the directory above (-C ..) the current directory     -z unzip     -x extract     -f L2.6.35_10.12.01_SDK_docs.tar.gz this file The contents of both tar files are now in the directory /home/user/freescale/imx28. Install BSP Sources After extracting the content from the L2.6.35_10.12.01_SDK_source_bundle.tar.gz the file L2.6.35_10.12.01_SDK.source.tar.gz contains all the sources and the build system. Extract the contents and install. This will create the ltib directory which is the build system. $ tar -zxf L2.6.35_10.12.01_SDK_source.tar.gz $ cd L2.6.35_10.12.01_ER_source $ ./install  Read the license information and accept by entering YES. An installation directory is then asked for, providing:  .. which is the parent directory. The installation script copies the packages and will inform you that 'Installation complete, your ltib installation has been placed in ../ltib, to complete the installation: cd .../ltib ./ltib  HOWEVER before doing this, there are packages and patches that need to be applied to run ltib on Ubuntu 12.04.01. Ubuntu Software Packages for LTIB The following packages are required. The script pkg-setup.sh attached below has these packages which can be downloaded and executed to install. $ sh pkg-setup.sh  sudo apt-get -y install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev sudo apt-get -y install libdbus-glib-1-dev liborbit2-dev intltool sudo apt-get -y install ccache zlib1g zlib1g-dev gcc g++ libtool sudo apt-get -y install uuid-dev liblzo2-dev tcl wget libncurses5-dev sudo apt-get -y install libncursesw5-dev lib32z1 libglib2.0-dev xsltproc sudo apt-get -y install ia32-libs libc6-dev-i386 The file pkg2-setup.sh contains optional packages for development. To install, download and execute: $ sh pkg2-setup.sh Please refer to the document ltib_build_host_setup.pdf for more information on host setup. Patching LTIB The location of files from the glibc-devel and zlib Ubuntu 12.04 packages has changed from 9.0.4 Ubuntu which the original ltib was released against. To update ltib operation the following patches are implemented from the directory ~/freescale/imx28/ltib 1. The file ltib is changed at line 2387 adding the '-v' option to the rpm call OLD:     system('rpm --force-debian 2>/dev/null') == 0? NEW:     system('rpm -v --force-debian 2>/dev/null') == 0? 2. The file bin/Ltibutils.pm is updated to support glibc-devel and zlib.   glibc-devel update: Line 563 add check for /usr/lib32/libm.so 'glibc-devel' => sub {-f 'usr/lib/libm.so' || -f '/usr/lib64/libz.so' || -f '/usr/lib32/libm.so'},   zlibc update: Line 584 add /lib/x86_64-linux-gnu/libz.so* zlib => sub{my @f = (glob('/usr/lib/libz.so*'),               glob('/lib/x86_64-linux-gnu/libz.so*'),               glob('/lib/libz.so*'),   The above patches are also in the attachment 0001-patches-for-12.04-ubuntu.patch.   LTIB packages also need adjustments to correctly build on Ubuntu. The tar file below, ubuntu-imx28-ltib-patch.tgz contains all the updates. Download and extract the contents at the same directory level as your ltib source directory. $ tar -zxf ubuntu-imx28-ltib-patch.tgz ├── ltib ├── ubuntu-imx28-ltib-patch └── ubuntu-imx28-ltib-patch.tgz Change directories to ubuntu-imx28-ltib-patch and then run the install-patches.sh script. $ cd ubuntu-imx28-ltib-patch $ ./install-patches.sh   The following packages are updated: lkc mtd-utils mux_server sparse Create SD Card Using Ubuntu Host The tar file L2.6.35_10.12.01_SDK_scripts.tar.gz contains scripts for writing the images from the ltib build to a SD card. Extract the content, copy the scripts to the ltib directory, and update the mk_mx28_sd script to work with the updated fdisk command.   $ tar -zxf L2.6.35_10.12.01_SDK_scripts.tar.gz $ cd L2.6.35_10.12.01_SDK_scripts $ cp mk_hdr.sh ~/freescale/imx28/ltib $ cp mk_mx28_sd ~/freescale/imx28/ltib $ cd ~/freescale/imx28/ltib  Edit mk_mx28_sd script and add the 'u' at line 177 then the o command after. This changes cylinders to sectors.   OLD: echo "o n   NEW: echo "u o n   Once updated to create the SD card which is at /dev/sdb: $ ./mk_mx28_sd /dev/sdb  NOTE: if mounted automatically, you need to unmount for the script to work $ sudo umount /dev/sdb*      Media Booting Selection The i.MX28EVK has a boot option to execute from the SD Card in Slot 0 which is located on the bottom of the EVK. On the top of the EVK there are switches that are read during the start up process to determine what boot media to use. The SD Card in slot 0 is used for this example which requires the settings: B3/DIP1 B2/DIP2 B1/DIP3 B0/DIP4 1 0 0 1 Refer to the user guide, i.MX28_Linux_BSP_UG.pdf section 3.2.1. Boot Modes for all options. The user guide is found in the Linux documentation bundle documentation.  Refer to the next section for a picture showing the boot switch location and the SD Card Slot 0 location. Cable Connections A computer serial port is connected to the i.MX28EVK serial port. The communication setting is 115200 baud, 8 data bits, No parity, and 1 stop bit. There is NO flow control set for this port. This is typically shown as 115200, 8N1. The power supply is connected  
View full article
NXP Tech Session - Getting Started with Edgelock SE050 for Industrial View Webinar Recording View Webinar Recording SE050
View full article
Using the FRDM-KL46 Board as a USB Mouse in KDS USB Mouse in KDS   Description:   A project made in KDS using the accelerometer on a FRDM-MKL46Z256VLL4 board to control a USB mouse input. A red LED will flash while not connected as a USB mouse, and green LED will flash when it is. SW1 will right click. SW3 will left click.   Sensitivity of the mouse can be changed by altering the HIDM1_Move command in main.c   Sections of code taken from: - http://mcuoneclipse.com/2012/09/21/tutorial-accelerating-the-kl25z-freedom-board/ - http://mcuoneclipse.com/2013/08/01/using-the-frdm-kl25z-as-a-usb-mouse-device/ USB Mouse in KDS   Description:   A project made in KDS using the accelerometer on a FRDM-MKL46Z256VLL4 board to control a USB mouse input. A red LED will flash while not connected as a USB mouse, and green LED will flash when it is. SW1 will right click. SW3 will left click.   Sensitivity of the mouse can be changed by altering the HIDM1_Move command in main.c   Sections of code taken from: - http://mcuoneclipse.com/2012/09/21/tutorial-accelerating-the-kl25z-freedom-board/ - http://mcuoneclipse.com/2013/08/01/using-the-frdm-kl25z-as-a-usb-mouse-device/ General
View full article