Kinetis Software Development Kit Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinetis Software Development Kit Knowledge Base

Labels
  • General 62

Discussions

Hello KSDK friends:   This time I want to share with the community a project using FatFs and the SDHC + I2C drivers provided with the Kinetis SDK platform. This is a baremetal project with no RTOS.   If you are a follower of colleague Erich Styger's MCU_on_Eclipse blog, then you might be familiar with the demo application, which consists of a data logger to store the accelerometer values of a FRDM-K64F on-board FXOS8700CQ (accelerometer/magnetometer) to a Micro SD Card.   The difference is that this demo project is implemented with KSDK v1.2 platform, using the next components:   - FatFs: Generic File System used in embedded systems. - SDHC peripheral driver: To handle the SD Card commands. - SD Card driver: Part of the KSDK composite drivers. - I2C peripheral driver: Used to communicate with the on-board FXOS8700CQ. - other peripheral drivers and systems: Clock System, GPIO driver, etc.   2 attachments are included with this post:   1) Demo project for KDS (created with KDS v3.0.0). 2) Document with a detailed description of how the project was created.   If when importing the project KDS asks you to add compiler search paths, just select "No". Paths are already configured.   IMPORTANT: The project can be placed in any location, but the next conditions must be met before building the project:   - Build the K64F KSDK platform library KDS project. The "Debug" build configuration is used. If not familiar with this, please refer to "Getting Started with Kinetis SDK (KSDK) v.1.2.pdf" in KSDK doc folder: C:\Freescale\KSDK_1.2.0\doc.   - Check that the build variable {KSDK_PATH} is pointing to your KSDK v1.2 installation (Project -> Properties -> C/C++ Build -> Build Variables):       RUNNING THE DEMO   1- Load the application to the FRDM-K64F. 2- Connect the PC to the FRDM-K64F OpenSDA micro USB port. 3- Open a terminal software and connect to the OpenSDA Virtual COM port. Configure the terminal for a baud of 115200. 4- Reset the board. You will see this message:     5- Insert micro SD Card. Now terminal should look like this:     6-  Accelerometer values will start to be printed to terminal and logged to SD Card each second.   A safe remove mechanism is implemented. Press SW3 in FRDM-K64F until you see the message shown below:     Keep SW3 pressed until SD Card is removed.   7- Now with a PC you can open the file LOG_DATA.txt:     The file can also be opened by a software such as Excel to graph the results:     I hope you like this demo!   Regards. Jorge Gonzalez
View full article
This patch adds Segment LCD (SLCD) examples for the Kinetis Tower boards with the TWRPI-SLCD module.  It reuses the SLCD driver included in the "Kinetis SDK 1.2.0 Standalone for KL33Z for the FRDM-KL43Z" , and ports the example to boards using the TWRPI-SLCD module.    The patch was written for KSDK v1.2.0, found at www.freescale.com/KSDK.  To install the patch, unzip to the KSDK installation directory, by default it is C:\Freescale\KSDK_1.2.0.  Only the Debug Build Configurations in the libraries and example applications were updated for these examples.  The Release Build Configurations will need to be updated before using.  The boards supported with these examples are:   TWR-KL46Z48M   TWR-KL43Z48M   TWR-KL46Z48M board example is provided with a project for Kinetis Development Studio (KDS) toolchain, and tested with KDS v3.0.0.  The path for this example is at  \KSDK_1.2.0\examples\twrkl46z48m\demo_apps\slcd_low_power_demo\kds.  The example also includes the KDS .WSD working set file.  When this is imported to KDS, it imports both the platform library and example application.  The example is written to display time on the TWRPI-SLCD, and will display mm:ss.   TWR-KL43Z48M board example is provided with a project for Kinetis Development Studio (KDS) toolchain, and tested with KDS v3.0.0.  The path for this example is at \KSDK_1.2.0\examples\twrkl43z48m\demo_apps\slcd_low_power_demo\kds.  The example also includes the KDS .WSD working set file.  When this is imported to KDS, it imports both the platform library and example application.  The example is written to display time on the TWRPI-SLCD, and will display mm:ss.
View full article
Hardware and software configuration: FRDM-K22F, SCH-28164 REV D OpenSDA: J-Link firmware KDS 3.0 with SDK 1.2.0 Eclipse update installed KSDK 1.2 provides an Eclipse update for those who want to use the Kinetis SDK with Eclipse and Processor Expert. and with this update , users may find MSD Class component has been supported, and there is a simple USB mass storage demo available directly in this PEx USB component, so that customers may easily build this demo and develop their own application based on that. Here I will start to illustrate how to implement this demo step by step. As FRDM-K22F is used in this test, so I directly choose this board and make the following configuration: After above steps, we have a PEx project with some pre-installed components as shown below: clockMan1 components has 6 configurations , and one of it is for USB application, you may set it as the init configuration right now, or it would be set automatically when you add the USB MSD components. Now I find the MSD component from KSDK 1.2 and add it to my project: This component will add 4 more reference components into this project, and we only have to configure the component "fsl_debug_console" to get rid of the error mark. For FRDM-K22 board, UART1 is used as the debug console, and PTE0 and PTE1 are used as the TXD and RXD, so I set up this components as below: The simple MSD demo is a RAM disk demo, and it is disabled by default, so we have to enable it in the fsl_usb_device_msd_class component, and the demo code will be automatically added into the project afterwards: and then set the correct PID and VID information in the component of fsl_usb_descriptors. so far looks like all components are configured correctly , but if we directly download this application, we will have an enumeration issue like below: This is due to USB descriptors are placed to Flash memory area by default . You know , USB descriptors contain constant values so storing them in flash would leave more RAM for user application. The highlighted option in the following figure determines this . but USB module in Kinetis doesn't have the permission for flash out of reset, so we still have something to do before going ahead. There are several solutions for it, the most easiest way is setting the above option to "no", but we may do it in a PEx-like way by using the "Init_FMC" component. Please note USB is the M4 of K22's crossbar-lite. so we give it the "read only" permission. Init_FMC() is placed in Peripherals_Init() which is called right before  Components_Init() where USB_Class_MSC_Init () is in, so it guarantees USB have the flash access permission before it starts up. Now the demo can work well with the PC host, just as shown below: So far only HID and MSD Class components are supported, and if you go through a similar process as above, you may easily implement a HID demo by yourself. Here I attach both the MSD and HID mouse demo for your reference. Hope that helps,
View full article
For installation standalone KSDK packages please follow these instructions:   Go to www.freescale.com/ksdk and click to download Is needed to be signed in After that is seen standalone package for FRDM-KL43Z and KL33Z Agree with Software Terms and Conditions Choose installation package according to platform Save file and install it After installation, final folder appears at C:\Freescale\KSDK1.2.0_KL33Z_1.0.0 and Eclipse update - import package to KDS from C:\Freescale\KSDK1.2.0_KL33Z_1.0.0\tools\eclipse_update   Eclipse Update In KDS choose Install New Software Click Add Choose Archive Choose the Eclipse Update zip file located at C:\Freescale\KSDK1.2.0_KL33Z_1.0.0\tools\eclipse_update Select update for KL33Z and KL43Z Accept terms of the license agreement   🙂 Enjoy!
View full article
Just today release new KSDK version 1.2. and KDS 3.0! Download here   For more details please visit our websites Software Development Kit for Kinetis MCUs|Freescale and Kinetis Design Studio Integrated Development |Freescale   What´s new   Added device family support:   MK10D10 MK66F18 MKL34Z4 MK11DA5 MKL02Z4 MKL36Z4 MK20D10 MKL14Z4 MKL43Z4 MK21DA5 MKL15Z4 MKV40F15 MK21FA12 MKL16Z4 MKV43F15 MK26F18 MKL17Z4 MKV44F15 MK30D10 MKL17Z644 MKV45F15 MK40D10 MKL24Z4 MKV46F15 MK50D10 MKL25Z4 MKW01Z4 MK51D10 MKL26Z4 MKW21D5 MK52D10 MKL27Z4 MKW22D5 MK53D10 MKL27Z644 MKW24D5 MK65F18 MKL33Z4 MK24F12 MK63F12   Added Peripheral support: AOI ENC FLEXBUS FLEXIO LMEM VREF XBAR PWM   Documentation   Kinetis SDK v.1.2.0 Release Notes http://cache.freescale.com/files/soft_dev_tools/doc/support_info/KSDK120RN.pdf?fsrch=1 Kinetis SDK v.1.2 API Reference Manual http://cache.freescale.com/files/soft_dev_tools/doc/support_info/KSDK12APIRM.pdf?fsrch=1 Kinetis SDK v.1.2 Demo Applications User's Guide http://cache.freescale.com/files/soft_dev_tools/doc/support_info/KSDK12DEMOUG.pdf?fsrch=1 Getting Started with Kinetis SDK (KSDK) v.1.2 http://cache.freescale.com/files/soft_dev_tools/doc/support_info/KSDK12GSUG.pdf?fsrch=1 MQX™ RTOS for Kinetis SDK 1.2.0 Release Notes http://cache.freescale.com/files/soft_dev_tools/doc/support_info/MQXKSDK120RN.pdf?fsrch=1   Porting an MQX RTOS Application to MQX RTOS for Kinetis SDK http://www.freescale.com/files/soft_dev_tools/doc/support_info/MQXKSDKPUG.pdf   for KDS 3.0. please don´t forget visit New Kinetis Design Studio V3.0.0 available   Enjoy! Iva
View full article
I created easy tutorial for UART KSDK blocking demo which works as echo. The demo works with KSDK 1.1. and is created for KDS 2.0.   Because it could be problem if was used this pin by this reason was chosen UART 3, which is available to use and is routed to PTC16,PTC17 connection on Arduino header for this case is use ALT3 function (PTC16, PTC17)   Final output from terminal Physical connection between FRDM-K64F and USB to Serial Converter The unzipped folder must be located in example folder at C:\Freescale\KSDK_1.1.0\demos\
View full article
This video shows how to use Processor Expert to configure the KSDK GPIO Peripheral Driver with the component fsl_gpio in Kinetis Design Studio. The steps show how to blink the red and blue LEDs while reading the SW2 button input of a FRDM-K64F. The procedure can be replicated for any KSDK supported board and also with PE Driver Suite. Enjoy!
View full article
Hello KSDK community:   The Kinetis Software Development Kit is intended to ease evaluation, prototyping and development with Kinetis MCUs. Apart from the Peripheral Drivers, HAL layer, System Services, RTOS abstraction and software stacks, KSDK implements a robust hardware interrupt mechanism.   The attached document is intended to explain the interrupt handling mechanism of KSDK platform and how to use it for baremetal KSDK or "MQX for KSDK" projects. Some of the topics covered are:   >> Interrupt manager >> Installing vector table in Flash or RAM >> Interrupt priorities >> Peripheral IRQ files (fsl_<peripheral>_irq.c) >> Installing, defining or registering ISRs >> Callbacks >> MQX hardware interrupts system >> Interrupts and callbacks with Processor Expert   The last chapter explains the considerations of interrupt handling when using Kinetis Design Studio in 4 different cases:   1) KSDK baremetal project 2) KSDK baremetal + Processor Expert project 3) MQX for KSDK project 4) MQX for KSDK + Processor Expert project   I hope this document is useful for all of you who have already adopted KSDK as development solution.     /*** UPDATE July 1, 2015 ***/   Document updated for KSDK v1.2 and KDS v3.0.0     Regards! Jorge Gonzalez
View full article
The tutorial shows how to toggle LED with KSDK 1.1.0 in KDS 2.0 and Processor Expert using a Timer Output for FRDM-KL03Z. Guide is prepared for red LED which is connected to Timer/PWM Module 0 (TPM0), channel 1. Create new project Create new project in KDS 2.0 with KSDK 1.1.0 Type the project name, choose board. e.g. FRDM-KL03Z, mark off options Kinetis SDK and Processor Expert Now, the structure looks like this: Set Processor Expert Settings Now, go to Components Library, find fsl_tpm component and by double click add the component to Component View. Rename the component tpmTmr:fsl_tpm to e.g. RedLed. Double click on RedLed:fsl_tpm in Components View and see Component Inspector Follow these steps: Set frequency and duty cycle. Debug configuration DONE!
View full article
Because of proliferating questions to “how can I work with copy of KSDK example” or “I am not successful with creation new MQX project with SDK, what I do wrong?”   I decided to do this this short step by step tutorial.   To do this procedure is needed the script, which creates Anthony Huereca and bat file created by me. Thanks to it is possible to create copy of any example which is based on KSDK. This script allows to work with real copy of KSDK example, which is choosen. It can be called like working copy. It is possible to edit any example and  build on this demo user´s own application. It is also much easier than e.g. creating new MQX project, which is quite lengthy process – always must think of correct settings paths, including libraries etc. In this situation is everything copyied (compiler settings, linker, preprocessor…) First of all is describe the utilization of the script. The script renames the original name of the demo to new one. So, user gets full-fledged copy. The main essence of the matter is that the script must be in location with other examples. I hope it helps a lot of us. Iva
View full article
Hi all Kinetis lovers,   Freescale has launched the Kinetis SDK and I believe this is a great opportunity for us to start our new applications using these drivers. The information contained on this post will show you how to use the SPI drivers based on simple master and slave examples.   The examples attached here were developed for KDS IDE using KSDK. To build and run the example you may need to consider the following: Install KSDK: You need to have  KSDK v1.1.0 installed on your machine. You can find it HERE. Build the KSDK library and import the examples: In the KSDK install folder go to the doc folder and look for the Getting Started with Kinetis SDK (KSDK) document. Follow the instructions of the section 5 Run a demo using Kinetis Design Studio IDE. To know how to build and import projects. If you have further question you may find useful information in this posts: OpenSDAv2 Complete information for the OpenSDA v2. Writing my first KSDK1.2 Application in KDS3.0 - Hello World and Toggle LED with GPIO Interrupt excellent post from colleague Carlos_Musich   I hope you can benefit from this post.   If you have questions please let me know   If this post was useful for you do not hesitate to click the Like button.   Best Regards, Adrian Sanchez Cano Technical Support Engineer  
View full article
Recently one of our customers reported an issue when he tried to run "dspi_edma_demo" with KSDK 1.0 on K22F freedom board. He connected SPI signals between master and slave according to the demo user guide on freedom board, but the demo was not working.   I reproduced the issue on freedom and found this is due to incorrect documentation in demo user guide.   The connection table shown in demo user guide for K22F freedom board is as follows. This is not correct.   It should be the following table instead.   Master Connects to Slave Signal Pin Name Board Location Pin Name Board Location SS PTD0 J6 Pin 8 -> PTD4 J2 Pin 6 SCK PTD1 J6 Pin 5 -> PTD5 J2 Pin 12 Data Out PTD2 J6 Pin 6 -> PTD7 J2 Pin 10 Data In PTD3 J6 Pin7 -> PTD6 J2 Pin 8   Also, the associated pin mux configuration in pin_mux.c file should be changed from the original workaround one in red to the original commented one.   void pin_mux_SPI(uint32_t instance)   {     switch(instance) {       case 0:                             /* SPI0 */         /* PORTD_PCR0 */         PORT_HAL_SetMuxMode(g_portBaseAddr[3],0u,kPortMuxAlt2);         //PORT_HAL_SetMuxMode(g_portBaseAddr[2],4u,kPortMuxAlt2);   /*** Temporary work around until next board spin. ***/         /* PORTD_PCR3 */         PORT_HAL_SetMuxMode(g_portBaseAddr[3],3u,kPortMuxAlt2);         //PORT_HAL_SetMuxMode(g_portBaseAddr[2],5u,kPortMuxAlt2);   /*** Temporary work around until next board spin. ***/         /* PORTD_PCR1 */         PORT_HAL_SetMuxMode(g_portBaseAddr[3],1u,kPortMuxAlt2);         //PORT_HAL_SetMuxMode(g_portBaseAddr[2],6u,kPortMuxAlt2);   /*** Temporary work around until next board spin. ***/         /* PORTD_PCR2 */         PORT_HAL_SetMuxMode(g_portBaseAddr[3],2u,kPortMuxAlt2);         //PORT_HAL_SetMuxMode(g_portBaseAddr[2],7u,kPortMuxAlt2);   /*** Temporary work around until next board spin. ***/         break;   }   }  
View full article
The latest Kinetis SDK 1.1.0 supported HID bi-directional communication, the new API USB_Class_HID_Recv_Data() can be used to receive data from USB HOST. But without demo and test tool, customer still has no idea about how to enstablish such kind of communication in their application. I create a simple demo derived from existed hid_keyboard project, together with basic endpoint read/write test by Bus Hound. The demo is built and tested on my FRDM-K64F and can be port to other USB Kinetis device as well. Working steps: 1) Unzip attached code and project to C:\Freescale\KSDK_1.1.0\usb\example\device\hid folder. 2) Compile project (IAR) and download to FRDM-K64F via CMSIS-DAP debugger. 3) Open Bus hound, enter "Devices" table and uncheck all box and check "auto select hot plugged devices". 4) Plug USB cable and connects to PC, will found the device is checked in bus hound device tree. 5) Double click device, and select OUT endpoint to send 16 bytes to device. 6) Observe the g_OUT_ep_buf[]'s change in firmware (Demostrate receive function only)
View full article
Hi all,   Please find attached the new version of this document using KDS3.0 and KSDK1.2.0.   For more information about using Interrupts please see the following document from Jorge_Gonzalez Interrupt handling with KSDK and Kinetis Design Studio   For information about creating a new KSDK project with MQX please see the following document. How To: Create a New MQX RTOS for KSDK Project in KDS   For information about creating a new C++ project in MQX for KSDK1.2 please see the following document. How to Create a C++ Project Using MQX RTOS for KSDK1.2   For information about getting started with FreeRTOS and KSDK1.2 see the following document. How to: Create a New FreeRTOS for KSDS1.2 Project in KDS3.0     I hope it is useful.   Regards, Carlos Technical Support Engineer
View full article
Kinetis SDK 1.1.0 is now officially released! You can download it via the big "Download" button on the KSDK website at http://freescale.com/ksdk   There are Windows and Linux 32-bit and 64-bit installers available. KSDK 1.1 will install in a new directory, which by default is C:\Freescale\KSDK_1.1.0, and will not interfere with previous installations of KSDK except to (optionally) update the Windows KSDK_PATH variable used by Kinetis Design Studio.   A high-level overview of what's new in KSDK 1.1 can be found in the Kinetis SDK 1.1 Release Notes but the most significant changes are: Additional devices supported Atollic TRUEStudio 5.2 is now supported Driver, HAL, and Platform Updates   There were also some other notable changes: GCC Make System Directory layout CMSIS-DAP/OpenOCD debug configurations now provided by default for KDS MQX for KSDK now included as option in the KSDK installer MQX Kernel 5.0.1 now supports lightweight configuration option   Details: 1)      Additional Devices The following devices are supported by Kinetis SDK 1.1 FRDM-K22F FRDM-K22F-K02 * FRDM-K22F-K02 64 * FRDM-K64F FRDM-KL03Z FRDM-KL46Z TWR-K22F120M TWR-K22F120M-K02 * TWR-K24F120M TWR-K60D100M TWR-K64F120M TWR-KV10Z75M TWR-KV31F120M TWR-KV31F120M-KV30 *   * These boards do not physically exist, but you can use the associated board to develop code for the subset devices listed. So for instance, if you're interested in the K02 device, use the FRDM-K22F for evaluation but use the K02 libraries provided to write code which will run on the K22F since it is a superset device.   2)      Atollic TRUEStudio 5.2 support   3)      Driver, HAL, and Platform Updates The HAL, Driver, and Platform code was updated with additional features, bug fixes, and enhancements. Several new peripherals are also supported which are listed in the Kinetis SDK 1.1 Release Notes . The Kinetis SDK v.1.1 API Reference Manual.pdf contains the latest KSDK API, and look at the updated demo projects for how to use the updated features like the power manager. There is now also the option to copy or not copy the vector table from ROM to RAM based on the linker file configuration using the ‘__ram_vector_table__’  argument in your IDE linker settings.   4)      GCC Make Changes Compiling with GCC now uses CMAKE.  Details on how to setup your system for compiling with GCC can be found in the GCC section of the <KSDK_path>/doc/Getting Started with Kinetis SDK (KSDK).pdf document. If you have "C:\MinGW\msys\x.x\bin" in your PATH variable (as required by KSDK 1.0.0), remove it to ensure that the new GCC build system works correctly.   5)      Directory Layout The HAL, Driver, and platform directory layout was slightly changed so that all the include files are now in a single directory instead of separate directories. This makes it simpler to add the include path into projects, and can also improve library compile times (by up to 50%). The KSDK platform library has also been slightly renamed to libksdk_platform.a   6)      CMSIS-DAP Debug Configuration OpenOCD debug configurations in Kinetis Design Studio are now provided by default for boards that use OpenSDAv2. OpenOCD makes use of the CMSIS-DAP debug protocol.   7)      MQX for KSDK Installer The Kinetis SDK 1.1 installer now includes options to install full MQX for KSDK support. The installation screen has also made it clearer during installation on how to select this option. There will no longer be a separate MQX for KSDK installer like there was for KSDK 1.0.   😎       MQX 5.0.1 Kernel Support of MQX Lite configuration and new example application rtos/mqx/examples/. There are provided options for creating tasks from statically allocated memory and application can define these tasks before MQX RTOS starts (using create_task() API). More changes are detailed in the MQX Release Notes in <KSDK_Path>/rtos/mqx/doc/Freescale MQX RTOS for Kinetis SDK Release Notes.pdf   This is just a high level overview of the changes, and should make developing applications using Kinetis SDK easier than ever.
View full article
This document will cover some of the most commonly asked questions about Kinetis Software Development Kit (Kinetis SDK). Anything requiring more in-depth discussion/explanation will be put in a separate thread. All new questions should go into their own thread as well. The variable KSDK_PATH is mentioned in several answers. This is the path into which Kinetis SDK was installed. With the current 1.2 release of Kinetis SDK, this would be equivalent to C:\Freescale\KSDK_1.2.0     What is the Kinetis Software Development Kit? Kinetis SDK is a free software framework that was created to make it easier for developers to create applications for Freescale’s line of Kinetis microcontrollers. It ensures there’s a common and thoroughly tested software framework for Kinetis devices that you can then use to build your application on top of. Let Kinetis SDK provide the basic startup code and drivers, so that you can spend more time creating your specific application code.   The two most significant features of Kinetis SDK are: Hardware Abstraction Layer (HAL) – A common API used to abstract hardware accesses into functional accesses Peripheral Drivers – High-level drivers that make use of the HAL API to implement higher level functionality for common peripheral use cases.   Additionally there are several other features: System Services – Code for utilizing specific Kinetis features which includes a clock manager, low-power manager, hardware timer, and interrupt manager ARM CMSIS Core and DSP standard libraries CMSIS compliant register header files Sample code for accessing accelerometers and audio codecs on Freescale evaluation boards Stacks and middleware for USB, Ethernet, and filesystems. Many examples and demo code to showcase how to use Kinetis SDK   This sounds great! Where can I download it and find more documentation and information? http://freescale.com/ksdk   How do I get started using Kinetis SDK? First read the Kinetis SDK 1.2 release notes to learn about the software. You will also want to check to make sure your Kinetis device is supported by Kinetis SDK. If you don't see your device in the KSDK 1.2 release notes, check to see if one of the stand-alone releases available includes it.   Once you’ve selected the appropriate installer for your device, either the mainline or one of the stand-alone releases, install it on your computer. The default path for the mainline Kinetis SDK 1.2 is C:\Freescale\KSDK_1.2.0 You will also need to install one of the compilers that Kinetis SDK supports. Kinetis Design Studio 3.0 IAR Embedded Workbench for ARM 7.40.2 MDK-ARM Microcontroller Development Kit (Keil) 5.14 ARM GCC 4.8.3 Atollic TrueSTUDIO for ARM 5.3 If you are not sure, we recommend starting with Kinetis Design Studio since it is free and also runs on Linux.   Then read the Getting Started with Kinetis SDK (KSDK) v1.2.pdf document. It can also be found in <KSDK_PATH>/doc. It will have details about Kinetis SDK and there will be a section for getting up and going with your particular IDE to run the hello_world demo application. Note that you will need to compile the Kinetis SDK platform library first before you can compile the demos.   You can then run one of the other demo applications included with Kinetis SDK to see examples of how to use the HAL and Driver APIs.   If you are using Kinetis Design Studio, also make sure to follow the directions in Appendix A of this document to update Kinetis Design Studio to work with Kinetis SDK: https://community.freescale.com/docs/DOC-102612   How do I run the demo projects that are included with Kinetis SDK? First read the Getting Started with Kinetis SDK (KSDK) v1.2.pdf document. You will need to import and compile the KSDK platform library, and then import and compile the particular demo project.   Where can I find specific instructions on a particular demo? For details on a specific demo, including any board jumper settings and to check if the demo will run on your particular board, refer to the Kinetis SDK v1.2 Demo Applications User's Guide.pdf found in the <KSDK_PATH>/doc folder.   How does Kinetis SDK fit in with other Freescale enablement? Kinetis SDK is a key component going forward in all Freescale Kinetis enablement. It replaces the bare-metal sample code examples. Freescale’s MQX RTOS will now use KSDK drivers for supported devices, instead of the classic MQX-specific drivers. And it will use the KSDK startup and board support code.   Processor Expert, a GUI tool for software configuration and code generation, now uses the KSDK HAL and Drivers to implement its code for KSDK supported devices. And the mbed platform also uses Kinetis SDK underneath for devices supported by Kinetis SDK.   Kinetis SDK Details:   What exactly am I getting when I download and install Kinetis SDK? The default installation path for KSDK 1.2 is at C:\Freescale\KSDK_1.2.0   Inside that directory, you’ll find the full source code for the various KSDK components (HAL, drivers, system services, header files, etc) as well as demos, documentation, and higher level stacks like our USB stack, lwIP, FatFS, and various RTOS kernels.   Some of the key directories are: examples – SDK examples and demos doc - Documentation lib – SDK libraries projects, and where the compiled library .a files are generated platform – SDK driver and HAL source code, linker files, and startup code   Section 5 of the Kinetis SDK v1.2 release notes lists the different components and where they are located in the Kinetis SDK directory structure.   What Kinetis devices/boards are supported by Kinetis SDK? In KSDK 1.2, the following boards are supported: FRDM-K22F FRDM-K64F FRDM-KL02Z FRDM-KL03Z FRDM-KL27Z FRDM-KL43Z FRDM-KL25Z FRDM-KL26Z FRDM-KL46Z FRDM-KW24 MRB-KW019032xx TWR-K21D50M TWR-K21F120M TWR-K22F120M TWR-K24F120M TWR-K60D100M TWR-K64F120M TWR-K65F180M TWR-KL43Z48M TWR-KV10Z75M TWR-KV31F120M TWR-KV46F150M TWR-KW24D512 USB-KW24D512   Kinetis SDK also supports many of the subfamiles that these boards support . So for instance, if you're interested in the K02 device, use the FRDM-K22F for evaluation but use the K02 libraries provided to write code which will run on the K22F since it is a superset device. The subset devices supported are all listed in the Release Notes.   The KSDK 1.2 release can be found at http://freescale.com/ksdk   Which version of Kinetis SDK do I install? I see that there are Mainline and Standalone Releases. What's the difference? If the device you are interested in is listed in the previous question, download the Mainline release appropriate for your computer (Windows/Linux/Mac).   If your device is listed as a Standalone install, you just need to use that Standalone installer. These are releases for new devices that did not make into KSDK 1.2 but will be rolled into later releases. Note that installing "Kinetis SDK Mainline 1.2" is not a pre-requisite as these truly are 'standalone' releases and include all the standard KSDK features and code: KL33Z for the FRDM-KL43Z   These standalone releases can be found under the Downloads tab on the KSDK website. You may need to select "All Downloads" to see them.   How do I determine if my particular Kinetis device is supported by Kinetis SDK and which board it is associated with? Section 4, “Supported Development Systems”, of the Kinetis SDK release notes lists the specific Kinetis devices that are supported by that release of Kinetis SDK. The table can also be used to determine which evaluation board is associated with your particular Kinetis device. Each of the stand-alone releases will also have their own table like this in their release notes.   When will device XYZ be supported by KSDK? Most new Kinetis devices will launch with Kinetis SDK support. Support for some older Kinetis devices will be added over time in new releases. Those older devices selected for porting will be announced on the Community once a release date is confirmed. In the meantime, use the bare-metal sample code and MQX support already available for those legacy devices.   I don’t see my device in either the Kinetis SDK 1.2 release or the stand-alone releases. Can I just port Kinetis SDK to my device? There are several key components that would be missing to do a port to a different family, like header files and start up files, and thus it is discouraged and is not supported by Freescale. Support for some older Kinetis devices is being added in future releases, and most Kinetis devices released in the future will have Kinetis SDK support at launch.   What compilers are supported by Kinetis SDK? In Kinetis SDK 1.2 the following compilers are supported: Kinetis Design Studio 3.0 IAR Embedded Workbench for ARM 7.40.2 MDK-ARM Microcontroller Development Kit (Keil) 5.14 ARM GCC 4.8.3 Atollic TrueSTUDIO for ARM 5.3   Kinetis Design Studio and ARM GCC are code sized unlimited and will also run on Linux. If you do not already have a preferred compiler, we recommend starting with Kinetis Design Studio.   What exactly is the HAL? The Hardware Abstraction Layer (HAL) creates an abstraction layer for hardware accesses.  For example, instead of digging into a reference manual to figure out which bit in which register bit is used to enable the UART transmit feature, you can just call UART_HAL_EnableTransmitter(…). The HAL is stateless and is intended to cover the entire hardware functionality.   Where is the source code for the HAL? You can find the source for the HAL at <KSDK_PATH>\platform\hal.   For a good example of how the HAL is implemented, look at the <KSDK_PATH>\platform\hal\src\dspi\fsl_dspi_hal.c and <KSDK_PATH>\platform\hal\inc\fsl_dspi_hal.h files. Notice how most of the HAL API is just macros for accessing the SPI registers, or else simple functions for calculating the baud rate and other simple features like that.   Is there a library for the HAL that I can pull into my project? There is a device and compiler specific library available that you can pull into your own custom project at <KSDK_PATH>\lib\ksdk_hal_lib.   You will need to compile the library first as KSDK does not come with pre-compiled libraries.   What are the peripheral drivers? The peripheral drivers are built on top of the HAL to provide a set of easy-to-use interfaces to handle high-level data and stateful transactions. They cover the most common use-cases, but may need to be optimized for your particular application.   Where is the source code for the drivers? You can find the source for the KSDK drivers at <KSDK_PATH>\platform\drivers.   For a good example, take a look at <KSDK_PATH>\platform\drivers\src\dspi\fsl_dspi_master_driver.c. You can see how the driver API is implemented by making calls to the HAL API and using structures defined by the SPI driver.   Is there a library I can pull into my project to use the drivers? The KSDK Platform library contains both the drivers and the HAL. This is the library most of the KSDK demo projects pull in. Device and compiler specific project files for this library can be found at <KSDK_PATH>\lib\ksdk_platform_lib   You will need to compile the library first as KSDK does not come with pre-compiled libraries.   Where are the HAL and Driver APIs documented? The Kinetis SDK API Reference Manual describes all the HAL and Driver APIs, and it can be found in the <KSDK_PATH>/doc folder.   How do I create my own Kinetis SDK application? The easiest way is to copy an already existing project. However if you are using Kinetis Design Studio, you can also create one from scratch using the New Project Wizard.   To copy an already existing demo project, see this thread: Create new KSDK Projects   To create a totally new project with Kinetis Design Studio, see this thread: Writing my first KSDK Application in KDS - Hello World and GPIO Interrupt   To create a MQX project that works with Kinetis SDK, see this thread: How To: Create a New MQX RTOS for KSDK Project in KDS   A full featured KSDK project creation tool is under development and should be released in Q2 2015.   Where can I find information on the Kinetis SDK low power manager? See this thread: Low Power Application Using the SDK (Note: The demo was created for KSDK 1.0)   What changed between KSDK 1.0 and KSDK 1.1? See this thread: KSDK 1.1 Release   What changed between KSDK 1.1 and KSDK 1.2? See this thread: New KSDK 1.2. is available!   Can I install a new version, or standalone version, of KSDK without it affecting my already existing version? Yes. Each new release of KSDK, including standalone releases, will be installed into a unique directory. The only thing to be aware of is the (optional) update the global Windows KSDK_PATH variable used by Kinetis Design Studio. See Appendix B of this document: Writing my first KSDK Application in KDS - Hello World and GPIO Interrupt   Do I need to recompile the platform library every time I change my demo application? After the initial compilation, you will only need to recompile the platform library for your device if you change something in the HAL, Drivers, or other source code that makes up the platform library. The platform project is included as part of the workspace when opening up a demo as a convenience for that initial compile. If you only change the code for the demo application, you do not have to recompile the platform library every time.   Is there training available for Kinetis SDK? There are some presentations at the Designing with Freescale event webpage: http://www.freescale.com/webapp/Download?colCode=DWF14_AMF_SDS_T0127 http://www.freescale.com/webapp/Download?colCode=DWF14_AMF_SDS_T0805   Also make sure to read through the Kinetis SDK 1.2 Release Notes as there is a lot of very useful information in there as you get started using Kinetis SDK.   Many more app notes and community posts are being created to further showcase how to use Kinetis SDK.   RTOS:   Does Kinetis SDK supports RTOSs? Yes. Several different RTOS kernels can be ran on top of Kinetis SDK. This was done to solve the biggest trouble of porting a particular RTOS to a new device, in that new drivers and startup code needs to be developed. Kinetis SDK provides that solution, so that the RTOS kernel features can sit on top of Kinetis SDK.   What RTOS kernels are supported with Kinetis SDK? Freescale MQX FreeRTOS Micrium uCOSII Micrium uCOSIII   How do I get these RTOSs with Kinetis SDK? Starting with Kinetis SDK 1.2, all the RTOSs are included by default with the installation.   If using Kinetis SDK 1.1, during installation process, there will be a screen asking if you would like to install 'Kinetis SDK Basic', 'KSDK+MQX', or 'KSDK+RTOS Kernels'. If you are only interested in MQX, use the middle option. If you are interested in other RTOS kernels (including MQX) select the last option which will take you to a new screen to select which RTOSes you are interested in.   If using Kinetis SDK 1.0, you must select the "Custom" option during installation to select a RTOS kernel.   Why don’t I have an <KSDK_PATH>/rtos folder? Where are the RTOS kernels at? See the above answer. You will need to run the KSDK installer again, select to modify the installation, and this time select an RTOS install option.   What else do I get when selecting the MQX RTOS option? When selecting the MQX RTOS option, the MQX RTCS Ethernet stack and MQX MFS Filesystem stack will be installed as well. These are more fully featured stacks than the 'lwIP' and 'FatFS' stacks provided by default with Kinetis SDK. These RTCS and MFS stacks require MQX to run, and full source code is provided.   What is the difference between MQX for KSDK and 'classic' MQX 4.2? MQX for KSDK is the future of MQX, and it was developed to leverage Kinetis SDK features like startup code and drivers. The biggest difference is the drivers, as MQX for KSDK uses the KSDK drivers which are significantly different than the classic MQX drivers. The startup code is also different as MQX for KSDK relies on the KSDK startup files. However the kernel API and how to you start and manipulate tasks, semaphores, events, etc, are the same between the two versions.   A full porting guide between classic MQX and MQX for KSDK is now available.   How can I learn how to create a new MQX for KSDK project for Kinetis Design Studio? A tutorial can be found here   Where can I find more information on MQX for KSDK? http://freescale.com/mqx/ksdk Beta version of MQX RTOS for Kinetis SDK - Now Available MQX with KSDK and Processor Expert   What is the OSA? The Operating System Abstraction (OSA) layer is an optional feature that allows a user application to use the same API regardless of which RTOS is being used. This can be used to make code more portable. An example of this can be found in the <KSDK_PATH>/demos/i2c_rtos demo, which uses almost the exact same source code to do a demo using I2C communication when using baremetal, MQX, FreeRTOS,  uCOSII, or uCOSIII.   Do I have to use the OSA? No, it is optional. You can always call the particular RTOS API directly. For example, if you were using the MQX kernel, you have the option to call either the OSA API call for a time delay (OSA_TimeDelay) or the MQX API call (_time_delay).   You can see how the OSA layer implements the OSA_TimeDelay() function for MQX by opening the file <KSDK_PATH>\platform\osa\src\fsl_os_abstraction_mqx.c, and on line 662 you’ll see that all the OSA is doing is calling MQX’s own _time_delay() API.   Note that some drivers make use of the bare-metal OSA implementation for certain functionality (like delays or semaphores).   USB:   What USB stack is included with Kinetis SDK? The USB stack is developed by Freescale and is a continuation of the 5.0 Beta bare-metal stack. The stack in Kinetis SDK has more features, and Kinetis SDK is where USB development work will be focused in the future.   You may also see it referenced as the “Unified USB stack” since this same USB stack is used by both bare-metal KSDK and by MQX for KSDK. This makes it simpler to add RTOS support to an already existing USB application.   What classes does the Kinetis SDK USB stack support? It supports Audio, CDC, HID, MSD, and PHDC classes in both Host and Device modes. Some composite class support is also provided.   How do I compile a USB demo? There are two libraries that need to be compiled before a USB demo will compile properly. Host or Device USB Library at <KSDK_PATH>\usb\usb_core\<host or device>\build\<compiler>\<board>\ KSDK Platform library at <KSDK_PATH>\lib\ksdk_platform_lib\   Then one of the USB demos can be compiled at <KSDK_PATH>\usb\example\<host or device>\<class>\<example project>   Troubleshooting:   I’m seeing an error about missing a missing ksdk_platform_lib.a or libksdk_platform.a file when I try to compile a demo There are two common cases where this happens:   1) You must first compile the KSDK platform library for your device. The project files for the library are found in <KSDK_PATH>/lib/ksdk_platform_lib/<compiler>/<device>/   2) Make sure the KSDK platform library you compiled is for the same target (Debug or Release) as the demo you are trying to compile. The Debug target has no optimization. The Release target uses full optimization.   Why is the “Kinetis SDK” checkbox unavailable when creating a new project in Kinetis Design Studio using the ‘Kinetis Design Studio Project’ Wizard? This checkbox is only selectable if the device you selected on the previous screen is supported by Kinetis SDK.   Also make sure to follow the directions in Appendix A of this document to update Kinetis Design Studio to work with Kinetis SDK. You will need to update KDS with the KSDK 1.2 file to get the boards supported by KSDK 1.2 in the project wizard: Writing my first KSDK Application in KDS - Hello World and GPIO Interrupt   I’m trying to use a driver and keep falling into the default ISR in startup_<mcu>.s Make sure to include an interrupt handler for the peripheral you’re using inside your project. By default, all the peripheral IRQ handlers go into a default handler that does an infinite branch. The easiest way to fix this issue is to add the C:\Freescale\KSDK_1.2.0\platform\drivers\src\<drivername>\fsl_<drivername>_irq.c file inside your project.   How do I change the default interrupt priority for a driver? Use the CMSIS NVIC_SetPriority function.  As an example from the i2c_rtos demo: NVIC_SetPriority(I2C0_IRQn, 6U);   I’m using a FRDM-KL03 and none of the KDS projects work Due to the small RAM size of the KL03, the default toolchain in Kinetis Design Studio needs to be swapped out for the ARM GCC toolchain. Instructions are in the appendix of the “Kinetis SDK Freescale Freedom FRDM-KL03Z Platform User’s Guide.pdf” found in the KSDK KL03 installation inside the /doc folder.   I'm using IAR and I get the following error when I try to compile: Fatal Error[LMS001]: License Check failed. Use the IAR License Manager to resolve the problem. Found no license for ARM EW.MISRAC[LicenceCheck:2.13.4.627,RMS 8.5.0.0021, Feature ARM.EW.MISRAC, Version 1.05]. The specified license feature is needed to enable MISRA-C support. This error occurs because the IAR projects are setup by default to enable MISRA-C checking, as KSDK is MISRA compliant. However the evaluation version of IAR doesn't support MISRA checking. To work-around this issue, right click on the project name that is giving the error, and select "Options...". Then under the "General Options" category, scroll over to the the tab on the far right that says "MISRA-C 2004". Then uncheck the box that says "Enable MISRA_C"   I'm seeing errors when using the SPI driver. What is the difference between the DSPI and SPI drivers? See this thread   The I2C_RTOS demo isn't compiling properly. It says it is missing libksdk_platform_mqx.a (or some other library). What libraries do I need to compile for the I2C RTOS demo? See this thread   I don't see any terminal output when using the power_manager_demo demo. You need to adjust the baud rate of the terminal to 9600 due to some clock speed limitations necessary for this demo. See the \doc\Kinetis SDK v.1.2 Demo Applications User's Guide.pdf for more details.   I don't see any terminal output when using some of the FRDM-KL03 demos. The following KL03 demos use a baud rate of 9600 due to some clock speed limitations necessary for those particular demos: flash_demo lptmr_demo power_manager_demo rtc_func See the \doc\Kinetis SDK v.1.2 Demo Applications User's Guide.pdf for more details.   I’m seeing odd compile errors in Kinetis SDK, what could be going on? If using KSDK 1.0 or KSDK 1.1, double check that the KSDK_PATH environment variable in Windows is pointing to the current installation of Kinetis SDK you’re trying to use. KSDK 1.2 does not make use of this environmental variable anymore. For details see Appendix B of this document Writing my first KSDK Application in KDS - Hello World and GPIO Interrupt   Where can I find a document of known issues? Known issues can be found in the Kinetis SDK 1.2 Release Notes.   Additional issues found after the Kinetis SDK release can be found in the Kinetis SDK Software Errata document, if one is needed, on the “Documents” tab of the KSDK webpage.   Updated Jun-2015 for KSDK 1.2 Release.
View full article
Hello Kinetis users!   I thought this would be the best place to share this code.  Attached is an example of how to use the power manager in the 1.0.0 release of the Kinetis SDK.  It is essentially the legacy low power demo ported to the SDK.  Now, the SDK doesn't provide functions to de-initialize the pins so some of it is a little messy, but it should still help to show you how to use the power manager and how to get in and out of low power modes.    The supported platforms are:   FRDM-K22F FRDM-K64F TWR-K22F120M TWR-K64F120M TWR-KV31F120M   To install the demo, simply unzip the file to the "demos" folder of your SDK installation.  All of the links in the demo are relative so you shouldn't have any trouble.  However, if you do experience any issues, please let me know so that I can correct the issues.    To run the demo, simply build and download the application (a guide of how to do this is provided in the device specific User's Guide in your SDK installation).  Then perform a power-on reset (you always want to do that when working with low power applications) and connect a terminal utility with the following settings:   - 19200 baud rate - 8 data bits - No parity - 1 stop bit - No flow control   Then follow the on-screen instructions.    As a reminder to those wishing to understand low power operations and the Kinetis devices a little more, we do have an Application Note out there to help explain low power operations:  AN4503 Power Management for Kinetis and ColdFire+ MCUs.  This Application Note is in the process of being updated with Kinetis SDK information and is scheduled to be re-published sometime this year.    Enjoy! Chris
View full article
Hi everybody,   You can find the new version of this document using KDS2.0 and KSDK1.1.0 is in the following link: Writing my first KSDK1.2 Application in KDS3.0 - Hello World and Toggle LED with GPIO Interrupt   Best regards, Carlos Technical Support Engineer
View full article
At the moment the best way to create a new KSDK example project is copying one of the existing projects in the /demos folder and renaming all the files and text to the new name. I've created a simple script that does all the work for you.   To run, just place the .exe or Perl script in the C:\Freescale\KSDK_1.0.0\demos folder and run. By default it'll copy the "hello_world" project to a new directory, and change all the "hello_world" text and files names to your new project name. Pretty straight forward, but much easier and less prone to error than doing it by hand. I've attached both the Perl source and a .exe created from that perl script. There is a command line option to specify the project to be copied, but by default it uses the hello_world one.   Hope you find it useful!
View full article
Hello Kinetis world! Kinetis SDK is here to stay and with it there are good opportunities ahead, such as coding flexibility, portability, RTOS enablement, projects scalability and more. Right now this is a brand new solution introduced by Freescale, so a lot of tutorials, How-To's and demo codes are coming, in addition to those already in the KSDK installation. I wanted to share an example project developed with KSDK v1.0.0 and KDS v1.1.1, which uses a simple driver to communicate to an I2C EEPROM memory using a FRDM-K64F board. The driver is focused and was tested with a 256 Kbit memory (24xx256), but it should be compatible with the 64Kbit, 128 Kbit, 256 Kbit and 512 Kbit versions. This demo project demonstrates how to use the APIs of the KSDK I2C Master Driver. The connections are as next: Please notice this is not intended to be a robust driver for I2C EEPROMs. Instead consider it a basic demo code, but with time we could improve it. The attached pdf is an overview/explanation of the example, while the zip folder contains the project for Kinetis Design Studio v1.1.1. :smileyalert: Before the project can be successfully compiled, you need to have installed KSDK v1.0.0 (www.freescale.com/ksdk) and have the FRDM-K64F platform library already built. For instructions on how to build the platform library you can refer to Appendix A of the next document in KSDK installation folder: C:\Freescale\KSDK_1.0.0\doc\Kinetis SDK K64 User's Guide.pdf :smileyinfo: NOTE: Disregard IAR and Keil instructions and refer to KDS part. Importing and compiling the example project with KDS      1) Unzip the package. It is recommended to place it into your KDS workspace, but it can be located at any place.      2) From KDS go to File -> Import -> General -> Existing Projects into Workspace.      3) Check "Select root directory" and click on "Browse" to search for the location of the unzipped folder. Then click OK.      4) Mark the check box for "I2C_EEPROM_K64" and click on "Finish".      5) Go to Project -> Build Project or simply click on the hammer icon. Build process should finish with no errors. The project provides a default Debug Configuration to use with the Segger J-Link emulator firmware v2.0 installed in the FRDM-K64F. If you wish to use a different connection please refer to the next link: https://community.freescale.com/docs/DOC-101845 I hope you like this demo. Many thanks and credits to abigailinzunza, for her valuable help developing this project. Regards! Jorge Gonzalez
View full article