Kinetis Microcontrollers Knowledge Base

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

Kinetis Microcontrollers Knowledge Base

Discussions

Sort by:
DFU_PC_demo_source_code.zip
View full article
To do: In this exercise, you realize a windscreen wiper with the Tower. The LEDs simulate the moving wiper by running from left to right and back again. The user interface is simple: With pushbutton1, the time delay interval is increased in steps of 1 second starting from 5 seconds delay down to 1 second and further to continuous wiping. With pushbutton2 the delay is decreased in the same way. If the delay is decreased, the wiper should start immediately, because right now there is a need for wiping. This is not true for increasing the delay. In this case, wait till the current delay time is over, set the new delay. In technical terms: Use asynchronous interval reset for decrease and synchronous reset for increase. Use active wait loops instead of the timer in this Kinetis exercise. Hint: Have you already switched a case? Result: TWR_K60_wiper_poll.zip
View full article
Gracias a la excelente respuesta por parte de los concursantes, les informamos que daremos a conocer los proyectos finalistas el próximo martes 26 de Noviembre de 2013, a través de la comunidad Freescale y redes sociales; recibimos proyectos con gran potencial que aún están siendo evaluados por nuestros jueces. A continuación te compartimos los criterios a evaluar: • Alineación con las tendencias del futuro (Salud y Seguridad, Efecto Net,Going Green) • Creatividad • Innovación • Utilidad de la aplicación • Beneficio ambiental potencial para el uso del producto. Los finalistas seleccionados tendrán la oportunidad de presentar su prototipo en el evento Freescale Cup 2013 el día 7 de Diciembre de 2013 en el Tecnológico de Monterrey, Campus Guadalajara; donde el proyecto ganador será elegido por los asistentes al evento, a través de la comunidad Freescale y redes sociales. Recuerda que el ganador viajará con todos los gastos pagados al Freescale Technology Forum (FTF) en Dallas, Texas. Mantente atento el próximo martes 26 de Noviembre de 2013 y descubre los proyectos finalistas, tú puedes ser uno de ellos.
View full article
To do: Same as exercise 5 but now with interrupts.   In this exercise, you realize a windscreen wiper with the Tower. The LEDs simulate the moving wiper by running from left to right and back again. The user interface is simple: With pushbutton1, the time delay interval is increased in steps of 1 second starting from 5 seconds delay down to 1 second and further to continuous wiping. With pushbutton2 the delay is decreased in the same way. If the delay is decreased, the wiper should start immediately, because right now there is a need for wiping. This is not true for increasing the delay. In this case, wait till the current delay time is over, set the new delay. In technical terms: Use asynchronous interval reset for decrease and synchronous reset for increase.   Use the timer and the port interrupts for the pushbuttons in this Kinetis exercise.   Result: TWR_K60_wiper_int.zip Original Attachment has been moved to: TWR_K60_wiper_int.zip
View full article
To do: Implement a program that lets the 4 LEDs on the Tower walk like this: * a single LED from left to right, * then the two left ones, the two right ones, * the two outside and at least the two LEDs in the middle. For easy observing write a wait routine, called 'delay (unsigned int ms)', of about 1 second without using any library functions. The processor will start with the standard frequency of 20...25 MHz. Estimate the time, that a loop needs to realize the time. Hint: Do not forget to stop the Watchdog Module at the beginning. Result:TWR_K60_Lauflicht.zip  including a readme with the compiler options
View full article
This sample is to use two FRDM-KL02Z to testing the I2C.  By working at 400KHz baud rate, some customer may found the I2C_SDA will generating a dig when failing edge of the I2C_CLK.  Actually it should related with I2C port layout and the question is why this happen and how to get rid of the dig? The truth is I2C pins are open drain, so no one actually drives a high value. The high value is only there because of a pullup resistor on the lines. For the case to connect two of FRDM-KL02Z using the I2C0_SCL and I2C0_SDA lines that are available on J7, these lines are also used for connecting to the inertial sensor that is on the board, and there are 4.7K pullups on both lines. Problem is that there are 4.7K pullups on the lines on both boards, so the pullups are weaker than intended. So customer should remove the pullup resistors from one of the two boards that should help. We even recommend customer might need to replace the 4.7K pullups with an even stronger pullup though when they have more devices on the I2C bus that are all adding loading.
View full article
using the TAD tool
View full article
Using a MK70FN1M0VMJ15 processor with MII and ADC2_SE16 enabled. Also using Codewarrior 10.6 and MQX4.022. Anytime I initialize the ADC2_SE16 the webserver stops working. I have delayed the initialization of the ADC2_SE16 and found that webserver works fine till initialization. I have also noticed that when the ADC2_SE16 is initialized first the webserver never gets link active. My question is that even though these are different ports and no pin is shared could the possibly be affecting each other? Hi Lee: I have been looking for information related to this problem but at this moment I have not find anything, In this case I would like to know if you are using a development board from Freescale or if you are using a custom board? Have a nice day, Perla Moncada ----------------------------------------------------------------------------------------------------------------------- Note: If this post answers your question, please click the Correct Answer button. Thank you! ----------------------------------------------------------------------------------------------------------------------- It is a custom board, with MII setup instead of RMII. I am concerned that it may be a chip issue, and have no real way to test that possibility with the Development board. This document was generated from the following discussion: 
View full article
For Jorge_Gonzalez Subject: MKE04 interrupt latency in Kinetis microcontrollers This is the code I was using to measure interrupt latency. David Hollinrake
View full article
Some customers asked about whether MCU-Link-Pro can be used to debug KEA devices. MCU-Link-Pro normally works as a CMSIS-DAP debug probe. Since KEA devices are based on Arm Cortex-M cores, there is no fundamental issue from the MCU architecture side. However, another important point is whether the development environment supports the debug interface. KEA's IDE   For KEA devices, S32 Design Studio for ARM v2.2 and CodeWarrior classis v11.1 are commonly used development environments. When creating a KEA project in S32 Design Studio, the available debug interfaces include: GDB PEMicro Debugging Interface SEGGER Debugging Interface As shown below, MCU-Link/CMSIS-DAP is not available as a debugger option. Figure 1. Debugger options in S32 Design Studio Similarly, in CodeWarrior, the available connections include P&E, OpenSDA, and SEGGER J-Link, but MCU-Link/CMSIS-DAP is not provided as a direct connection option. Figure 2. Debug connection options in CodeWarrior Therefore, MCU-Link Pro cannot be directly used in its default CMSIS-DAP mode with the configurations shown above.   Using MCU-Link Pro in J-Link Mode   The solution is quite simple. MCU-Link-Pro supports SEGGER J-Link firmware. After switching MCU-Link-Pro to J-Link firmware, the probe can be used through the SEGGER debug interface provided by S32 Design Studio or CodeWarrior. Please note that this option is available for MCU-Link Pro only. The standard MCU-Link does not support J-Link firmware.   The setup becomes:   S32 Design Studio / CodeWarrior   |   SEGGER J-Link   |   MCU-Link Pro   (J-Link firmware)   |   SWD   |   KEA MCU     In S32 Design Studio, select: Segger Debugging Interface In CodeWarrior, select: Segger J-Link / J-Trace / SWO (SWD based) Then the MCU-Link-Pro can be used as a J-Link probe to connect to the KEA target. One More Benefit of MCU-Link Pro   In addition to debugging, MCU-Link Pro also provides current and power measurement capabilities. This can be useful when debugging low-power applications or checking the target's power consumption, making MCU-Link-Pro more than just a programming and debug probe.   Conclusion   Although the default CMSIS-DAP interface of MCU-Link Pro is not directly available in the KEA configurations shown in S32 Design Studio and CodeWarrior, there is a straightforward workaround: Switch MCU-Link Pro to J-Link firmware and use the SEGGER debug interface in the IDE. This provides a practical way to use MCU-Link Pro for KEA development while also keeping access to MCU-Link Pro features such as current measurement.   Reference: MCU-Link Pro User Manual
View full article
Zephyr Hands-on: Adding MCUboot Support to FRDM-KE15Z   Secure Boot Enablement and Validation for Kinetis Using Zephyr Sysbuild Objective: Extend the existing Zephyr support for FRDM-KE15Z with the Flash partition and SRAM configuration required by MCUboot, and verify the complete build, flash, and boot process.  1. Background   With the implementation of the EU Cyber Resilience Act (CRA), software security and vulnerability management are becoming increasingly important for embedded products. For products that need firmware updates to address security vulnerabilities, having a reliable and verifiable software update mechanism is essential.  The CRA does not require products to use a specific bootloader. However, it emphasizes cybersecurity by design, vulnerability handling throughout the product support period, and the delivery of necessary security updates. Therefore, adding secure firmware update capabilities to existing MCU-based products is becoming an increasingly common requirement in real-world projects.  MCUboot is an open-source secure bootloader with well-established integration in Zephyr. This makes it a practical option for implementing secure firmware update capabilities. In this article, we use the NXP FRDM-KE15Z as an example to demonstrate how to add MCUboot support to an existing Zephyr board.  2. Why Zephyr + MCUboot?   For earlier Kinetis MCUs, traditional solutions commonly rely on a ROM bootloader or secondary bootloader. These solutions typically focus on firmware download and programming, for example, downloading firmware to the MCU through a serial interface using blhost.  When the requirement expands to secure firmware updates, additional considerations are introduced, including: Image signing Image verification Primary and secondary image slots Image management during firmware updates If MCUboot is ported completely from scratch, additional work is also required for MCU support, Flash drivers, linker scripts, and board-specific adaptation.  Using Zephyr simplifies this process because: Zephyr already integrates MCUboot and can build both MCUboot and the application through Sysbuild. FRDM-KE15Z is already supported upstream by Zephyr with the board target frdm_ke15z. Basic MCU, Flash, UART, and board-level support is already available. Only the memory layout and configuration required by MCUboot need to be added.  Therefore, this is not a full MCUboot port from scratch. Instead, it is a relatively small board-level adaptation based on the existing Zephyr board support.  3. Adding MCUboot Support to FRDM-KE15Z   By default, the FRDM-KE15Z Devicetree does not define the Flash partitions required by MCUboot. At minimum, MCUboot requires the following regions in Zephyr: boot_partition : stores MCUboot slot0_partition : primary image slot1_partition : secondary image  3.1 Specify the Application Code Partition Modify boards/nxp/frdm_ke15z/frdm_ke15z.dts. Add zephyr,code-partition to the chosen node and map the application to slot0_partition: chosen { zephyr,sram = &sram_all; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; zephyr,console = &lpuart1; zephyr,shell-uart = &lpuart1; zephyr,crc = &crc; };   3.2 Reorganize the 256 KB Flash The Flash partitions are configured as follows: &flash0 { partitions { compatible = "fixed-partitions"; #address-cells = <1>; #size-cells = <1>; boot_partition: partition@0 { label = "mcuboot"; reg = <0x00000000 DT_SIZE_K(44)>; }; slot0_partition: partition@b000 { label = "image-0"; reg = <0x0000b000 DT_SIZE_K(100)>; }; slot1_partition: partition@24000 { label = "image-1"; reg = <0x00024000 DT_SIZE_K(100)>; }; storage_partition: partition@3d000 { label = "storage"; reg = <0x0003d000 DT_SIZE_K(12)>; }; }; };   The Flash layout used in this test is: Region Start Address Size Purpose boot_partition 0x00000000 44 KB MCUboot slot0_partition 0x0000B000 100 KB Primary Image slot1_partition 0x00024000 100 KB Secondary Image storage_partition 0x0003D000 12 KB Storage   The four regions use the complete 256 KB Flash while maintaining 2 KB Flash sector alignment.  3.3 Combine SRAML and SRAMU After configuring the Flash partitions, MCUboot reports insufficient RAM during the linking stage. The MKE15Z256 provides 32 KB SRAM, but the original Device tree divides it into: SRAML: 0x1FFFE000, 8 KB SRAMU: 0x20000000, 24 KB By default, zephyr,sram points only to the 24 KB SRAMU region.  Because these two SRAM regions are contiguous in the address space, they are combined into a single 32 KB SRAM region for this test: /delete-node/ &sram_l; /delete-node/ &sram_u; / { sram_all: memory@1fffe000 { compatible = "mmio-sram"; reg = <0x1fffe000 DT_SIZE_K(32)>; }; };   Then update zephyr,sram in the chosen node: zephyr,sram = &sram_all;   4. Building MCUboot + Application   For validation, the standard Zephyr hello_world sample is used as the test application. With Sysbuild, MCUboot and the application can be built together using: west build -p always -b frdm_ke15z --sysbuild samples/hello_world -- \ -DSB_CONFIG_BOOTLOADER_MCUBOOT=y   "SB_CONFIG_BOOTLOADER_MCUBOOT=y" enables MCUboot as part of the Sysbuild configuration. During the build process, the following output appears:   image.py: sign the payload This indicates that the application image has been signed for MCUboot.  Figure 1. MCUboot and hello_world build successfully   5. Flashing and Runtime Verification   After the build completes, simply run: west flash Sysbuild manages the MCUboot and application build domains, and flashing is performed using the default LinkServer runner for FRDM-KE15Z. Figure 2. west flash log   After flashing, reset the board and monitor the serial output at 115200 baud. MCUboot reports:   chainload address offset: 0xb000 It then jumps to the first image slot. 0xB000 is exactly the start address of slot0_partition. The application subsequently prints: Hello World! This confirms that MCUboot successfully boots and chainloads the signed application image from the primary slot. Figure 3. Serial output showing MCUboot booting the signed hello_world application   6. Conclusion   For Kinetis MCUs without an existing MCUboot example, porting MCUboot completely from scratch can require considerable low-level adaptation. However, for devices that are already supported by Zephyr, the existing MCU, Flash, and board support can be reused. The remaining work can then focus mainly on the Flash and SRAM configuration required by MCUboot.  In this article, MCUboot support was successfully added to FRDM-KE15Z, including: MCUboot Flash partition configuration SRAM layout adjustment Building MCUboot and the application together using Sysbuild Application image signing Flashing with "west flash" Booting MCUboot and successfully chainloading the signed application This experiment focuses on basic MCUboot integration, image building, and the boot flow. For a production implementation, additional security considerations are required, including signing key management, firmware update transport, image confirmation and rollback policies, and the overall secure update process.   References   Cyber Resilience Act (CRA): Requirements, Deadlines & Penalties Zephyr: FRDM-KE15Z Board Documentation Zephyr: Sysbuild Zephyr: MCUboot with Sysbuild Sample MCUboot: Building and Using MCUboot with Zephyr Zephyr GitHub: FRDM-KE15Z Board Sources
View full article