Kinetis Design Studio Knowledge Base

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

Kinetis Design Studio Knowledge Base

Labels
  • General 92

Discussions

Sort by:
Greetings, a new release of Kinetis Design Studio (KDS) is available: the version v3.2.0!   The KDS v3.2.0 is an update with includes all existing updates to the v3.0.0 release. So instead downloading and installing v3.0.0 and then apply all updates, it is recommended that you use the v3.2.0 version instead. There is no need to uninstall an existing KDS v3.0.0: the new v3.2.0 is installed in a separate directory and can be used side-by-side with the previous version.   Main benefits of v3.2.0 are: Includes all previous updates in a single installation image, no need to download 3.0.0 and apply updates which can be problematic depending on the order updates are applied Fixes known issue with GNU ARM Eclipse updates which affects debugging with OpenOCD and Segger J-Link Fixes known issue with launching KDS on Mac OS X 10.11 (El Capitan) Includes the latest GNU ARM Eclipse build utilities to overcome the Windows 8192 command line character limit Updated P&E and Segger drivers Includes the "Project of Project" plugin Includes the Kinetis SDK v2.x Project Wizard Includes bare project support for KM1 and KM3 devices   Using KDS v3.2.0 instead of using KDS v3.0.0 with the updates is recommended. KDS v3.0.0 can be kept installed and does not need to be removed. Do *not* install KDS v3.2.0 over an existing KDS installation!   Download the Installer Go to Kinetis Design Studio Integrated Development |NXP Under the Downloads tab, click the button to Download the software Select the host operating system for which you want to download the installer: You need to agree on the license agreement Download the Installer and release notes which contain additional installation instructions: Install the software and consult the release notes for additional installation instructions. Release notes are attached to this document too.   Links Kinetis Design Studio Download Page: Kinetis Design Studio Integrated Development |NXP
View full article
This document provides guidance for relocating Code and Data within the MCU memory map. As part of this process it explains how create new memory segments and sections by editing the GCC Linker File (.ld) for Kinetis Architectures.   Contents:   1.- Introduction 2.- Preliminary Backgrounds 3.- Linker File (.ld) Overview 4.- Relocating Code 4.1.- Prerequisites 4.2.- Relocating Code in ROM 4.3.- Relocating Code in RAM 4.4.- Relocating Code in a Specific RAM address 4.5.- Relocating Code in External RAM 5.- Relocating Data 6.- Linker File for RAM Project   Best Regards, Carlos Mendoza Technical Support Engineer
View full article
A new Kinetis SDK has been released Jan 29th 2016. This document shows the steps how to use the SDK with Kinetis Design Studio v3.0.0. Unlike previous SDK's, with the SDK v2.0 it only needs a generic 'new project wizard' inside KDS.   Downloading a Kinetis SDK Package Go to Welcome to Kinetis Expert | Kinetis Expert Login with your user NXP name/account Click on 'Build an SDK' button If this is your first configuration: select board/processor you want to use Customize the SDK version, toolchain and Host OS Build the SDK Check the Software vault and download the file Unpack the downloaded archive file to a folder (recommended into c:\nxp (e.g. (c:\nxp\SDK_v2.0-K64F) or into /nxp on other systems) The above steps are in the attached video 'Kinetis SDK V2.0 Configuration Generation.mp4'   Installing Kinetis SDK v2.0 New Project Wizard in Kinetis Design Studio Start Kinetis Design Studio Select Menu Help > Install New Software Select KDS Update site (Freescale KDS Update Site - http://freescale.com/lgfiles/updates/Eclipse/KDS) Install the New Kinetis SDK 2.x Project Wizard See attached video 'Installing KSDK v2.0 Project Wizard in KDS.wmv'   For offline installation: the wizard can be downloaded from the https://www.nxp.com/kds web site under the Kinetis Design Studio V3.0.0 downloads, e.g. for Windows it is here:   Creating and Debugging KSDK V2.0 Project Use menu File > New > Kinetis SDK 2.x Project Select/Browse SDK to be used Provide project name Select device/board Select driver set and RTOS Press Finish Build Project Debug Project Steps are shown in the attached video 'Create build and debug Kinetis SDK v2.0 project.wmv'   Links: Kinetis SDK: Welcome to Kinetis Expert | Kinetis Expert Kinetis Design Studio: Kinetis Design Studio Integrated Development |NXP
View full article
For those of you interested in starting up designs with K64 and KDS here you will find basic baremetal examples with detailed step by step guides explaining which registers to configure, they also include Reference Manual extracts to make it easier to understand and learn how to do so for those unfamiliar with Kinetis devices.   The rar files include document and code example. I hope all  you find them useful.     K64F-GPIO K64F-Interurpt K64F-UART K64F-ADC K64F-PWM
View full article
In most cases, there is no debug interface for user to update the application or fix bugs , so user can use Bootloader. Bootloader is a small program put into a device that allows user using communication interfaces to upgrade application , such as use UART , I2C , USB, CAN and so on. This application describe a bootloader based on the TRK-KEA128 board with CAN interface. The bootlaoder and user application code are written in separate projects , user can program the bootloader with tools such as J-Link ,Multilink, then boot the application file through CAN. The bootloader and application code are all provided , user can porting it to their own board of KEA/KE chips.   Pay attention to that, if your board is TRK-KEA128 Rev D, you need give a low signal to STB of PC33901 chip to set it in Normal mode:     GPIOB_PDDR |= (1<<16);     GPIOB_PCOR = (1<<16); In other old version boards , for example Rev C, the STB have been connected to ground , so we needn't configure it .     IDE: Kinetis Design Sturio v3.2 Hardware: TRK-KEA128   About the detail code and introduction of this bootloader, please check the attachment .   Thanks for my colleague Jennie Zhang and  Kerry Zhou . Welcome your valuable advice .   Best  Regards! Alice    
View full article
Greetings, the new Kinetis Design Studio V3.0.0 is available in the download section of the Freescale web: http://www.freescale.com/kds Kinetis Design Studio is free of charge and unlimited.   What's New New Eclipse Luna 4.4 IDE Added Mac OS X (10.10, "Yosemite") host operating system support with Segger J-Link. Added CMSIS-SVD Peripheral Register viewer. New 'Welcome' view New GNU ARM Embedded (launchpad) toolchain, reducing memory footprint especially for small devices. New upgrade/migration assistant to migrate projects to V3.0.0. Updated and extended Segger and P&E debugging support: attach to running target, semihosting and advanced flash programming features. New Processor Expert V3.0 with multiple repository support and simplified Kinetis SDK usage and ability to generate projects for IAR and Keil. Updated New Project Wizard (NPW) for simpler project creation. Updated GNU ARM Eclipse plugins, multiple tool chain configurations. Aligned and optimized for Kinetis SDK v1.2 New Device Support: see attached release notes (Rev 1).   Additional Kinetis SDK Device Support For full/additional device support: Download the Kinetis SDK v1.2 from Software Development Kit for Kinetis MCUs|Freescale Install the Kinetis SDK Add Kinetis SDK v1.2 to KDS: Use the menu Help > Install New Software and use C:\Freescale\KSDK_1.2.0\tools\eclipse_update\KSDK_1.2.0_Eclipse_Update (KSDK path on windows)   See https://community.freescale.com/docs/DOC-103698 for additional details, especially about porting KDS v2.0.0 projects to the GNU ARM Embedded (launchpad) tools.   Screenshots of new features   Mac OS X support:   New Workspace Welcome view:   Kinetis SDK selection in New Project Wizard:   Ability to generate Processor Expert (Microcontroller Driver Suite) external projects for IAR and Keil:     Eclipse Luna 4.4, e.g. Split Editor Views:   Processor Expert V3.0 and multiple component repositories:   Upgrade assistant to migrate projects from KDS V1.x/V2.0.0 to V3.0.0:   Multiple tool chain configurations:   Peripheral Register Viewer:   JTAG Daisy Chaining:   Advanced Flash Programming Options: Attach to running target:   And finally, for the 'lovers of the dark side' :-): Eclipse Luna 'Dark' style:   Enjoy 🙂
View full article
Hello community!   Attached is a document that shows two methods of merging a user application and bootloader in a single file so it can be downloaded into the microcontroller at once and reduce manufacturing time and cost.   1. Merging applications using linker commands. 2. Merging applications using the P&E Advanced Flash Programming options.   I hope you can benefit from this post, if you have questions please let me know.   Best Regards! Carlos Mendoza
View full article
Hello community!   Attached is a document that explains how to use Kinetis Design Studio to debug both a bootloader and application at the same time, this will be done using GDB commands to specify an additional symbol file to be used in the debug session.   The bootloader used for this example is the project for the FRDM-K64F board provided in the KBOOT 1.2.0 named freedom_bootloader and the application is a bareboard led demo that was adapted to work with this bootloader by following the steps described in this document:   https://community.freescale.com/docs/DOC-256669   The document was created using the MK64FN1M0VLL12 MCU like the one in the FRDM-K64F board, but the same principles are applicable to any Kinetis MCU.   Software versions The steps described in this document are valid for the following versions of the software tools: KDS v3.2.0 KBOOT v1.2.0     Contents      1. Overview and concepts. 1.1 Kinetis Bootloader. 1.2 GDB Server.      2. Flashing Bootloader and Application. 2.1 Flashing freedom_bootloader project. 2.2 Loading demo application using the Kinetis Updater. 2.3 Flashing demo application and bootloader using the P&E advanced programming options.      3. Debugging Bootloader and Application. 3.1 Debugging bootloader and demo application projects using the P&E interface. 3.2 Debugging bootloader and demo application projects using the Segger interface.      4. Conclusion.      Appendix A - References.     I hope you can benefit from this post, if you have questions please let me know.   Best Regards! Carlos Mendoza Original Attachment has been moved to: K64F12_Led_Demo.zip
View full article
Hello KDS users!   Nowadays assembly language is being eradicated for embedded systems, and other alternatives such as C/C++ are widely used.   However we know sometimes it becomes necessary to get to "the bones" of our MCU, even from a C project, and play directly with its registers and status flags. Some use cases are:   - Startup code - Bootloaders - Time critical routines - Benchmarking   It is common to include assembly code using the "__asm()" style. But what if I want to use my C variables in the assembly code? or if I want to call an assembly subroutine from a C project? We can do this in Kinetis Design Studio, which comes with GCC tools preinstalled.   The attached document is an overview and explanation of this extended assembly feature. Also I am including a pair of example projects developed in KDS v1.1.1, for the KL25Z128 and K60DN512 devices.   Thanks to Abigail Inzunza Lopez, who helped with this.   I hope you find this useful !
View full article
Overview: - this plugin provides KSDK documents at hand - web based documents are opened in KDS - PDF based documents are opened in your PDF viewer Installation: 1) Be sure that you closed KDS 3.0.0 ! 2) Copy KSDKDocPlugin_1.0.0.alpha.jar to your KDS plugins folder, ex.: c:\Freescale\KDS_3.0.0\eclipse\plugins\ 3) Run KDS 3.0.0 4) Now you can see KSDK 1.3.0 Documents menu next to the Run menu   Known issues: - KSDK must me installed at c:\Freescale\KSDK_1.3.0 (need to do path configuration for documents)     I hope that you enjoy this plugin. All comments are welcome!   Michal
View full article
Outline How to start debugging with the GDB debugging in KDS. If you are coming from CodeWarrior, then debugging with KDS is somewhat different because of the nature of GDB, and because the debug configuration panels look different.   This document uses FRDM-K64F board (Freescale Freedom Development Platform) Kinetis Design Studio V1.1.0.(Kinetis Design Studio Integrated Development) Screenshots from Windows 7 host (but things are very similar to any other host supported)   Creating Debug Configuration In order to debug, a debug configuration needs to be created. It is assumed that you already have compiled/linked your project at this time.   In order to have most fields of the debug configuration pre-populated, select the project in the Project Explorer view:   Select the menu Run > Debug Configuration: Alternatively, the debug icon drop down list can be used: Kinetis Design Studio supports three different debugging connections: GDB OpenOCD Debugging: this uses the OpenOCD to CMSIS-DAP debug protocol, available with OpenSDAv2.0 (FRDM-K64F) or OpenSDAv2.1 (FRDM-K22F) GDB PEMicro Interface Debugging: this can be used for any P&E device (Multilink, or OSJAT/OpenSDA P&E firmware on a Freescale board) GDB SEGGER J-Link Debugging: this can be used with any Segger device (J-Link, or OpenSDA J-Link firmware on a Freescale board) Once the configuration is created, I recommend to name it according t Double click on one of the entries to create a new configuration for it. Instead double clicking you can use the 'New' icon as well: What I recommend is to name the debug configuration. So I know later which configuration is for what. What I'm using is <project name><connection> like below: Another thing I highly recommend is to save the debug configuration as file in the project (.launch). This allows sharing or passing the debug configuration with the project files. To do this, I have 'Shared file' enabled: That way the launch configuration files are stored in the project:   Then I need to fill out the fields for the debug configuration. The details are listed in DS Debug Configurations (OpenOCD, P&E, Segger), and listed here again:   For OpenOCD, use "-f kinetis.cfg" which is the same for all Kinetis devices:   For P&E: select the interface, port and device:   For Segger, specify device name, interface (use JTAG only if you know the debug header supports JTAG. If in doubt, choose SWD): SWO (Single Wire Output) is an extra pin to SWD/JTAG, and currently not supported on FRDM boards. So I disable that option for my FRDM boards, as otherwise the debugger will complain later about it:   Debugging and Debug Icon To Debug, one way is to use the 'Debug' button from the Debug Configuration dialog: You have to do this at least once. Once you have done that, then you can use the drop down of the Debug icon: Just pressing the 'Debug' Icon is in general NOT recommended if it does not show in the tooltip a launch configuration: And if you get the dialog below: DO NOT select either gdbserver or remote gdb/mi: it does not work that way 😞 Press Cancel, and select it from the list, or select it from the 'Debug Configurations...' dialog:   Although KDS V1.1.0 has improved in this area, it is possible that it will show you a selection of launch/debug configurations (then you are ok to choose one): The recommended way is to use the drop down list and to select the desired debug/launch configuration:     Trouble Shooting If debugging does not work, here are a few trouble shooting tips:   Settings: verify that your launch configuration settiings are ok. That you are debugging the correct board with the correct connection (P&E, OpenOCD, Segger).   Power: Verify that your board has power and connected with the correct USB port on the board.   Not Debugging Twice: Make sure that you are *not* debugging the same application board twice, or you will get this: Because the board is already running a debug session: Always terminate an existing debug session before starting a new one: Kill any Zombies: the gdb client and server are usually terminated after a debug session. After terminating a debug session, verify that these services are *not* present any more in your task manager (Windows): arm-none-eabi-gdb.exe: this is the ARM GDB client, needed for the OpenOCD, Segger and P&E servers listed below openocd.exe: this is the OpenOCD GDB server pegdbserver_console.exe: this is the P&E GDB Server JLinkGDBServerCL.exe: this is the Segger GDB Server If you see multiple zombies/instances like this: kill them:   Links KDS Debug Configurations (OpenOCD, P&E, Segger) FRDM-K22F: Debugging with P&E OpenSDAv2.1 Firmware FRDM-K22F: Debugging with Segger J-Link OpenSDAv2.1 Firmware OpenSDAv2 FRDM-K64F | MCU on Eclipse Creating New Eclipse Debug Configuration | MCU on Eclipse
View full article
This document summarizes how to use printf() to print string to Console and UART in KDS2.0 .   Printing string to Console and UART both includes three conditions: Processor Expert project, KSDK project and bareboard project.   Refer to this document, we can use the printf() in KDS with any project conveniently.
View full article
This tutorial describes how to build a project from command-line, using the GCC build tools included in the Kinetis Design Studio (KDS) tool from NXP.  KDS uses open-source components including the Eclipse IDE and GCC build tools.  The Eclipse IDE can be configured to automatically create make files for the project.  After KDS creates these make files, they can be used to build the project from the command-line, without using the KDS IDE.  This tutorial uses an example for the Kinetis KE04Z microcontroller (MCU), using the FRDM-KE04Z development board.  The following software is used in these tutorial steps: Microsoft Windows 7 64-bit Kinetis Design Studio (KDS) v3.2.0 FRDM-KEXX Driver Library Package v1.3
View full article
This SD card bootloader demo offers to user a way how to using SD card to update existing firmware. The two project of attachment are the demo code create by CodeWarrior 10.6 and KDS 3.0 . The document of attachment is the application note of the bootloader, you can find the detailed description about the bootloader.   It is easy to be used:      -Hardware: TWR-K60F120      -Software: CodeWarrior 10.6 or KDS 3.0        Getting started :      - Change the name of user application binary file to “app_0x10000_1.bin”, then copy and paste it on SD card;      - Insert the SD card into the TWR-K60F120 board;      - Build and flash “bootloader_sd_k60120m” to the board;      - Press the SW1 button, at the same time, press once the RESET button, thus it will update the user application to the flash.      - Again, only press the RESET button, it will directly run the user application.     Best Regards! Alice
View full article
Kinetis Design Studio Q: What is the idea of KDS? A: It is a basic, complimentary, free development tool with no code size restrictions, for editing, compiling and debugging for all Kinetis MCUs. It is based on stock Eclipse (Kepler), includes GNU gcc build tools and GNU gdb debugging tools and Processor Expert. Q: Where is Kinetis Design Studio available for download? A: Kinetis Design Studio downloads are hosted on http://www.freescale.com/kds. Watch out for Announcments in this forum for new releases and updates.   KDS and CodeWarrior Q: What is the difference between KDS and CodeWarrior? A: KDS is unlimited, and the debugger is using open source GDB instead of a proprietary debugger engine. KDS only supports Kinetis, while CodeWarrior supports other architectures including ColdFire, ColdFire+, DSC, Qorivva, PX, RS08, S08 and S12Z. CodeWarrior will maintain the current support of Kinetis devices, while new Kinetis devices will be rolled into KDS. Q: Can I import CodeWarrior projects? A: Yes and no. CodeWarrior uses a different compiler (Launchpad GNU ARM gcc), while KDS is using a different version with different libraries. The build tool panels are similar, but not the same (KDS is using the open Source GNU ARM Eclipse plugins, while CodeWarrior uses an earlier and modified variant of that). As such, the compiler and project settings are similar, but not compatible. Moreover, the libraries (EWL in CodeWarrior, newlib and nano in KDS) are completely different. There is a migration assistant feature in KDS (see the KDS Quickstart Guide) which helps with some of the migrations settings. But it might be a cleaner approach just to create a new project with the new project wizard, and then add the CodeWarrior source files to the new KDS project instead.   Installation Q: Which host operating systems are supported? A: Windows 7 and 8 (both 32bit and 64bit), Linux (Ubuntu, RedHat, Centos) are supported. Mac OS X will be supported later to the end of this year. Q: The RPM Linux installation file has the *.i686.rpm extension, does this mean that it is a 64bit installation? A: No, it means that it runs on ix86, where i686 as a more recent version than the (old) i386. Both Linux packages for KDS (_i386.deb, .i686.prm) are 32bit packages. A 64bit package would be x86_64. Q: The binaries for Linux are 32bit, where are the 64bit binaries? A: In this version, only 32bit binaries are supported. We plan to provide 64bit binaries later this year. Q: In the custom setup of the installer, I do not see Processor Expert listed? Does this mean I have to install it separately? A: Processor Expert is included in the installation, and not optional (it is always installed). If you install KDS, then Processor Expert is installed in KDS as well, so no need to install it separately. Q: After installation of KDS, do I need to download and install the Kinetis SDK? B: Yes, this is a separate download and installer from http://www.freescale.com/ksdk. Additionally, you need to install the Eclipse update from the <sdk>\tools\eclipse_update for full board and SDK support in KDS.   Processor Expert Q: How can I add my own interrupt vector? A: Use the menu Run > Debug Configurations and see Creating New Eclipse Debug Configuration | MCU on Eclipse Q: I want to use the RESET or NMI pin as a user button. How can I do this? A: see Pin Muxing: Using the NMI Pin as GPIO Pin | MCU on Eclipse and Using the Reset Button on the Freedom Board as User Button | MCU on Eclipse. Q: How can I switch from the new 'tab' view to the 'table' view in the component inspector? A: Use the small triangle in the view to deselect the 'Tabs View', see Processor Expert (Driver Suite/Plugins/KDS) V10.4 with new Component Inspector | MCU on Eclipse   RTOS Q: I have downloaded MQX v4.1, but there are no KDS projects or KDS wizards included? A: MQX Kernel Awareness is supported in KDS V1.1.0 or later, and it is installed with the menu Help > Install New Software and use the KDS Eclipse Update Site (http://freescale.com/lgfiles/updates/Eclipse/KDS).   Building Q: How to build a S19 or binary file to be used with the mbed bootloader (OpenSDAv2) on the FRDM-K64F board? A: See Binary Files for the mbed Bootloader with Eclipse and GNU ARM Eclipse Plugins | MCU on Eclipse Q: How can I print the code and data size of my application? A: There is an option in the build tools to print the size, see Printing Code Size Information in Eclipse | MCU on Eclipse Q: I get a compiler error that 'asm' is not recognized? A: By default the compiler settings are for C99, and there the 'asm' keyword is not recognized. Either change it to __asm (with two underscores) or change the compiler settings to use GNU ISO 90 (see First experence with KDS (Beta) with FRDM-K64F) Q: I want to use the latest GCC ARM Embedded (launchpad) tools and libraries, and not the version in KDS. How can I use KDS with the a different ARM toolchain and libraries? A: This article describes how to swap/change the tool chain: Switching ARM GNU Tool Chain and Libraries in Kinetis Design Studio | MCU on Eclipse Q: How to print to a physial serial port with printf() on the K64F? A: You need to implement application hooks, see printf() and scanf() with GNU ARM Libraries | MCU on Eclipse and UART printf() for the FRDM-K64F Board and Kinetis Design Studio | MCU on Eclipse.   Debugging Q: Which debugging probes are supported? A: KDS supports P&E Multilinks (including P&E OpenSDAv1), Segger J-Link (OpenSDAv1 and OpenSDAv2) and OpenOCD with CMSIS-DAP (both OpenSDAv1 and OpenSDAv2). Q: What is the difference between OpenSDAv1 and OpenSDAv2? A: OpenSDAv1 (see OpenSDA on the Freedom KL25Z Board | MCU on Eclipse) is present on boards released prior the FRDM-K64F120M (e.g. the FRDM-KL25Z and other Freedom boards), and support *.SDA firmware files. OpenSDAv2 is based on an open source mbed bootloader, is installed by default e.g. on the FRDM-K64F board, and loads *.BIN firmware files. Q: How can I use the Segger OpenSDAv2 on my FRDM-K64F board? A: You need to download the firmware from Segger.com and load it on the board, see Segger J-Link Firmware for OpenSDAv2 | MCU on Eclipse. Q: How can I create a new debug configuration? A: See the steps outlined in Creating New Eclipse Debug Configuration | MCU on Eclipse Q: I cannot see global variables in the Variables View? A: In KDS (Eclipse Kepler) you need to use the Expressions View, see Variable Debugging with Eclipse Kepler | MCU on Eclipse Q: I only see core registers in the Registers View? A: Yes, peripheral registers are not yet supported in this version. But there is a plugin described here you can use with KDS: How to Add Register Details View in Eclipse | MCU on Eclipse Q: I'm using FreeRTOS, how to debug with Kernel Awareness so I see the tasks, stack size, etc? A: Download and install the additional FreeRTOS plugin as outlined in DIY Free Toolchain for Kinetis: Part 5 – FreeRTOS Eclipse Kernel Awareness with GDB | MCU on Eclipse. Q: My FRDM-K64F OpenSDAv2 (red) LED is always on, and I cannot debug or connect to my board. How can I recover? A: See the steps outlined in Recovering FRDM-K64F mbed Board | MCU on Eclipse Q: How can I share my debug configuration or to store it as a file in my project? A: See http://mcuoneclipse.com/2014/03/15/sharing-debug-configuration-with-eclipse/ Q: By default, the variables (e.g. in the registers view) are shown in decimal format. How to change the default to Hexadecimal format? A: See Debugging Variables in Hexadecimal with Eclipse | MCU on Eclipse Q: What device name can I specify in the Segger debug configuration? A: There is a link which points to all the devices supported by Segger in the launc configuration panel, see GNU ARM Eclipse & Segger J-Link Device Name Settings | MCU on Eclipse Q: How can I set a watchpoint on a variable in memory or on an address in memory? A: See C/C++ Watchpoints with Eclipse Kepler | MCU on Eclipse Q: How can I use printf() with semihosting? A: See Semihosting with Kinetis Design Studio | MCU on Eclipse Q: How to preserve memory ranges so that not everything gets erased on the target while downloading? A: For P&E GDB Server connection, see Preserving Memory Ranges with Eclipse and P&E GDB Server | MCU on Eclipse.
View full article
Introduction Up and including to version 2.0.0, the Kinetis Design Studio (KDS) is using a custom GNU toolchain built by SOMNIUM Technologies, referred here as 'legacy'. That toolchain is built from the Free Software Foundation (FSF) source base, with a few minor modifications. Starting with v3.0.0, KDS will use the unmodified GNU Tools for ARM Embedded (launchpad, GCC ARM Embedded in Launchpad) toolchain (4.8-2014-q3-update : Series 4.8 : GCC ARM Embedded release), referred here as 'launchpad'. Projects created with KDS v3.0.0 will use the 'launchpad' tools by default. The reasons for 4.8-2014-q3 instead of using the later 4.9 release is because of stability and smaller footprint of 4.8 applications.   Outline This document outlines what are the differences between the 'legacy' and 'launchpad' toolchain, and what is needed to port existing 'legacy' projects to the 'launchpad' ones. It is already possible to use the 'launchpad' tools with KDS v2.0.0 today (see Switching ARM GNU Tool Chain and Libraries in Kinetis Design Studio | MCU on Eclipse), therefore the information in this document can be applied to KDS v2.0.0 to with using the 'launchpad' toolchain.   KDS Upgrade Assistant Kinetis Design Studio V3.0.0 comes with a migration assistant to migrate projects to the GCC ARM Embedded (launchpad) tools. The migration assistant is accessible from the menu Project > KDS Upgrade Assistant: This opens a dialog with the currently open projects in the workspace:   NOTE: if the Upgrade Assistant does not list your project, then you still can do the manual steps as listed below (changing the linker flags).   Select the project(s) you want to migrate and press Next. In the next dialog you can configure the details of the conversion, then press Finish: A report will be generated in each project directory:   Migration of KDS Projects To migrate an existing 'legacy' project to a 'launchpad' project, usually only the linker settings need to be changed. For this go into the project properties, and check the 'Other linker flags' settings of the Linker. The table below shows the difference between the two: Legacy 'Other linker flags' Launchpad 'Other linker flags' <none> -specs=nosys.specs -nanolibc -specs=nano.specs -specs=nosys.specs   For example this project is a legacy project using the newlib-nano library: To use it with the 'launchpad' toolchain, use -specs=nano.specs -specs=nosys.specs as shown below: With this, normally projects are converted from the 'legacy' to the 'launchpad' toolchain.   NOTE: after switching toolchains, delete all intermediate or object files (e.g. delete the Debug/Output folder inside the project. Mixing object files or libraries from different toolchains and compilers will likely cause problems.   Now your project should compile fine. However, if you face a problem about wrong Thumb mode, see the following subsection.   Wrong or missing Thumb mode If getting errors like      Error: selected processor does not support Thumb mode      error: interrupt Service Routines cannot be coded in Thumb mode This means that the project settings do not properly pass the processor to the compiler. That problem mainly occurs with Kinetis SDK projects, and with Cortex-M0+ (Kinetis-L) projects. As explained in the next section, the launchpad tools by default use the ARM, not the thumb mode. The solution is to add      -mcpu=cortex-m0plus for these Kinetis-L projects to the compiler 'Other target flags'.   The following sections provide more detailed information about the differences.     Differences Both the 'launchpad' and the 'legacy' toolchains are GNU toolchains, and largely compatible. However there are notable differences between the two toolchains:   legacy launchpad GNU Binaries Microsoft 32bit binaries, Linux 64bit binaries Microsoft 32bit binaries, Linux 32bit binaries(1) GNU binutils 2.32.2 2.23.2.20140731(*) GCC 4.8.0(*) 4.8.4 (ARM/embedded-4_8-branch) NewLib 1.19.0(*) 2.1.0(*) Newlib-nano 1.0(*) 2.1 GDB 7.6(2) 7.6.0.20140731-cvs(2) ARM Mode Thumb ARM (non-Thumb) (*) Modified. (1) See next section about running 32bit GNU tools on 64bit Linux. (2) The legacy GDB has Python support, while this is not present in the launchpad 4.8-2014-q3 build. Python support has been added by ARM in 4.9-Q4-2014 release.   Launchpad 32bit Binaries to run on 64bit Linux Because the 'launchpad' tools are 32bit binaries on Linux only, this can cause issues on 64bit Linux systems (e.g. Ubuntu 14.04 64bit) if the needed 32bit support libraries are not installed. A usual error message is that arm-none-eabi-gcc could not be found, even if that file is present, because the system does not know how to run it. This is because the 'launchpad' tools are built as 32bit binaries, an the compatibility package needs to be installed. See http://gnuarmeclipse.livius.net/blog/toolchain-install/ how to install the necessary compatibility libraries for Linux.   ARM Default Mode The default options for the 'legacy' toolchain produce code for the ARM Cortex-M0+ (Thumb mode), while the 'launchpad' tools default to the 'ARM' mode (non-Thumb). Therefore it is important that the command line options -mthumb with the appropriate -mcpu= or -march= options are used if using the tools in command line only mode. If using the GNU ARM Eclipse plugins, then no changes are needed as these options are set in the project already:     Default Libraries and Options The GNU compiler driver and linker is using default pre-built libraries in certain sub directories. These directories contain a default set of libraries, based on the compiler and architecture options specified during the build and link phase. Using linker options like -L to include a specific library or using options like -nostdlib or similar have an effect which libraries in which subdirectory are used. The library folder location is in <KDS_Installation_PATH>\toolchain\arm-none-eabi\lib   The following table lists the specific options used for both the legacy tools and launchpad tools to link for a specific architecture and floating point ABI used: Target Legacy Options Legacy Subdir Launchpad Options Launchpad Subdir ARM Cortex-M0+ <default> <default> -mthumb -march=armv6s-m armv6-m ARM Cortex-M4 -mcpu=cortex-m4 m4 -mthumb -march=armv7e-m armv7e-m ARM Cortex-M4F -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 m4/fp/v4-sp-d16 -mthumb -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 armv7e-m/fpu ARM Cortex-M4F with softfp ABI -mcpu=cortex-m4 m4 -mthumb -march=armv7e-m -mfloat-abi=softfp -mfpu=fpv4-sp-d16 arm7e-m/softfp   Newlib-nano Both the legacy and the launchpad toolchain include the newlib-nano library, a standard library more optimized for embedded devices than the normal newlib one. The option to select the newlib-nano library is different: Newlib-nano for Legacy Newlib-nano for Launchpad -nanolibc --specs=nano.specs   Application _start() The startup code needs to call the _start() function of the library which then calls the main() function. The _start() function in the library is responsible to initialize the library and prepare it to be used by the application. In order to do this, the library needs to have the __stack symbol defined in the linker file which points to the top of stack. For this, the __stack symbol needs to be defined in the linker file as in the example below: /* Highest address of the user mode stack */ _estack = 0x20000000;    /* end of m_data */ __SP_INIT = _estack; __stack = _estack;   Semihosting The legacy library has semihosting included in the libraries, and users can use _isatty() and _write() to overwrite the existing semihosting hooks. With the launchpad tools semihosting is enabled with the -specs=rdimon.specs linker option, and users can implement their own hooks with _sbrk(), _write(), _close(), _fstat(), _isatty(), _lseek() and _read(). To completely disable semihosting, the options -specs=nosys.specs can be passed to the linker.   Application Exit Function The legacy library includes a default implementation of _exit(), while the launchpad tools do not include this. Using the -specs=nosys.specs linker option will ensure that the linker does not complain about the missing _exit() function.   Summary A typical legacy Kinetis Design Studio (KDS) V2.0.0 project can be easily migrated to the launchpad toolchain with adding -specs=nosys.specs linker option and replacing the -nanolibc legacy option with -specs=nano.specs linker option.   Links Kinetis Design Studio: Kinetis Design Studio Integrated Development |Freescale GNU Tools for ARM Embedded: GCC ARM Embedded in Launchpad Q3 2014 GNU Tools for ARM Embedded Release: 4.8-2014-q3-update : Series 4.8 : GCC ARM Embedded Blog article about how to switch KDS toolchain: Switching ARM GNU Tool Chain and Libraries in Kinetis Design Studio | MCU on Eclipse GNU ARM Eclipse plugin website and blog by Liviu: Welcome to the GNU ARM Eclipse plug-ins! | GNU ARM Eclipse Article by Liviu how to install toolchain: http://gnuarmeclipse.livius.net/blog/toolchain-install/
View full article
Configuration used:                 Hardware :              TWR-K60D100M                                                 P&E Multilink Universal rev B                 Software:                CW for MCU V10.6                                                 KDS V1.1.1   Attached you will find 3 docs explaining step by step how to import a MCU V10.6 projects under KDS1.1.1   1- Porting sample MCU V10.6 project to KDS V1.1.1 2- Porting sample Processor Expert MCU V10.6 project to KDS V1.1.1 3- Porting sample MQX MCU V10.6 project to KDS V1.1.1   If you see problem or mistake, don't hesitate to contact me.     Another project: 4- Porting Example delivered on MCU V10.6 to KDS V1.1.1 (example_mcu_KDS.zip)         + How to solve the "Program "gcc" not found in PATH" message       Other problems linked to the vector table moving MCU to KDS 3.0.0:  I am attempting to port a project from CodeWarrior 10 to KDS 3.0.   I was porting from CodeWarrior 10 to KDS 3.0. After fixing all the coding differences I ran into a runtime problem. The code kept restarting. In comparing the C startup file provided by KDS and CodeWarrior I found that CodeWarrior was turning off the WatchDog and setting the Interrupt Vector Table address, KDS was not doing this. I copied the relevant CodeWarrior code to the SystemInit() function in the system_MK20D7.c file. This disabled the WatchDog, but left me with the problem of the code restarting whenever the an interrupt was generated. I finally figured out that the problem was with the line of code that was attempting to re-locate the Vector table address. Although the code appears to work for CodeWarrior it is totally bogus fro KDS. Removing the line solved the problem. After renaming all my interrupt handlers to the KDS naming convention everything now works as it should.
View full article
This is the third video of four KDS v3.0.0 videos. The videos shall guide you through installation and using the Kinetis SDK with a FRDM board.   Overview: Debug configurations Building for debug Stepping through source code Inspecting variables Setting breakpoints Disassembly, memory and registers   List of all four videos: Kinetis Design Studio Videos, Part 1: Installation of KDS and Kinetis SDK Kinetis Design Studio Videos, Part 2: Installation of OpenSDA Firmware on Freedom Board Kinetis Design Studio Videos, Part 3: Debugging with Kinetis Design Studio Kinetis Design Studio Videos, Part 4: Using Processor Expert in KDS
View full article
This is the third video of four KDS v3.0.0 videos. The videos shall guide you through installation and using the Kinetis SDK with a FRDM board.   Overview: Overview of Processor Expert and Kinetis SDK Creating a Processor Expert project Adding and configuring devices Generating code Building and running the application   List of all four videos: Kinetis Design Studio Videos, Part 1: Installation of KDS and Kinetis SDK Kinetis Design Studio Videos, Part 2: Installation of OpenSDA Firmware on Freedom Board Kinetis Design Studio Videos, Part 3: Debugging with Kinetis Design Studio Kinetis Design Studio Videos, Part 4: Using Processor Expert in KDS
View full article
Hello community!   Attached is a document that introduces the usage of version control using SVN and Kinetis Design Studio.     Contents: 2. Overview and concepts      2.1 VisualSVN Server      2.2 TortoiseSVN 3. Installation instructions      3.1 Installing VisualSVN Server      3.2 Installing SVN Eclipse plugins      3.3 Installing TortoiseSVN 4. Using version control      4.1 Creating new repository in VisualSVN      4.2 Putting a project under SVN Control      4.3 Checking out a project from SVN      4.4 Synchronizing changes 5. Conclusion Appendix A - References       You can find more detailed information about version control on the following post created by our colleague Erich Styger:   Version Control with Processor Expert Projects | MCU on Eclipse   And on this document that explains how to use Git and KDS:   FTF-DES-F1149.pdf   I hope you can benefit from this post, if you have questions please let me know.   Best Regards! Carlos Mendoza
View full article