Kinetis Design Studio Knowledge Base

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

Kinetis Design Studio Knowledge Base

Labels

Discussions

Sort by:
This is an update to Kinetis Design Studio V3.0.0 which updates it to version V3.1.0. You need KDS V3.0.0 installed in order to install this update. This update includes as well a Processor Expert for Kinetis V3.0.2 update. It is an online update through the Eclipse update mechanism.   Note: the updates are available for offline installation as well from the download section on www.nxp.com/kds   This update fixes a know issue with the dependency to the GNU ARM Eclipse plugins described in Unable to Debug after KDS Update .   Online Update To install the update from the Eclipse update site, the preferred method is to use the menu Help > Check for Updates As this lists many other updates which might cause conflicts, make sure you only select the Kinetis Design Studio 3.1.0 update: Install the update, then in a second update you can install the other KDS updates. Here again, do not select other 3rd party updates as this might cause conflicts: Then go through the installation process.   An alternative method is to use Help > Install New Software and use the following Eclipse Update site: http://freescale.com/lgfiles/updates/Eclipse/KDS (Note: this is an Eclipse update site, not usable for a web browser)     Then select "Kinetis Design Studio 3.1.0" update from the list (shown for Windows host below): Next it will inform about the actions taken. A Somnium portion of the IDE will be removed and replaced: Press 'Next' and go through the update process.   Offline Update The update is available as zip archive which can be downloaded once and then used for an offline installation, pointing to the zip archive as update site.   Go to Kinetis Design Studio Integrated Development |NXP  and click 'Download' in the Download tab:   Select the KDS 3.0.0 for the host you are using: Select the "Kinetis Design Studio 3.1.0" update (screenshot shown for Mac OS X) and download it: In Kinetis Design Studio V3.0, use the menu Help > Install New Software and point to the downloaded file to install it.   For details additional, see the attached release notes.
View full article
Greetings, attached is the material of the Kinetis Design Studio (KDS) hands-on training held at FTF 2014 in Dallas. It was using the V1.0 pre-beta version of the tools. There will be some changes for the final V1.0 beta coming out early in May, but is very close to the upcoming beta.   Erich Original Attachment has been moved to: Lab_1.zip
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
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
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
Greetings, the new release of Kinetis Design Studio V2.0.0 has been released and is available on the web (http://www.freescale.com/kds).   V2.0.0 is a new full release, supporting Windows (7/8 (both 32 and 64bit) and Linux (64bit binaries for Ubuntu, RHE and CentOS) from the download tab: Kinetis Design Studio Integrated Development |Freescale (current description says 32bit for Linux, but it is really 64bit, this should be fixed soon).   What's new: Support for 64bit Linux with 64bit binaries. Improved NPW (New Project Wizard) which automatically creates debugger launch configurations for OpenOCD, P&E and Segger. Automatic device filtering in the NPW. Greatly improved Kinetis SDK support with automatically adding compiler include paths for new Kinetis SDK component and files. Updated P&E and Segger debug connections Built-in support for the upcoming Kinetis SDK v1.1 release Updated Processor Expert (V10.4.2) Many bug fixes and other improvements Details in the Kinetis Design Studio V2.0.0 release notes (Documentation Tab). As with the previous V1.1.0 release, new device support and Kinetis SDK support is added through the SDK Eclipse update, present in the Kinetis SDK. See the release notes for details.   There is no need to uninstall V1.1.1, as V2.0.0 can be installed in parallel, and projects are compatible. Moving to V2.0.0 is highly recommended for Linux users and anyone using the Kinetis SDK.   Best regards, Erich Styger
View full article
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
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
  Hello Freedom community users Bheema has posted on the Element14 community a very clear tutorial (accessible following the link below) to create from scratch a basic project example for the FRDM-K64 with Kinetis Design Studio (KDS). Freescale Freedom development platform: [FRDM-K... | element14 I strongly recommend you to start following those steps to properly setup the tool and the OpenSDAv2 interface embedded in the new Freedom and TWR boards. Happy Programming Greg
View full article
The Kinetis Bootloader(KBOOT) v2 is now available on www.nxp.com/kboot webpage, it supports building bootloader image on KDS v3.2  IDE. About how to use the KBOOT to load a user's application on kinetis MCU please refer to the DOC”Kinetis Bootloader Demo Application User’s Guide”(It is under the KBOOT install package: NXP_Kinetis_Bootloader_2_0_0\doc).   When using KDS build the bootloader image, there is one point need to be paid attention: the image size in debug mode build is over 0xa000(the 0xa000 is user's application start address). That is to say , if we download the debug build image to mcu, can’t use it . So this doc povides the correct way to use the KBOOT on KDS, the problem shows in FRDM-K64 and FRDM-K22 boards, on other chips , if they also have the out of range problem, the correct method is the same .   How to correctly use the KBOOT v2 on KDS ? Please check this DOC on attachment !
View full article
NOTE: the screenshots below are for KDS V1.0.1-beta!   After creating a new debug configuration is simple: Select either 'GDB OpenOCD Debugging', 'GDB PEMicro Interface Debugging' or 'GDB SEGGER J-Link Debugging' and use the 'new' button: Verify the project and application settings:   After that, there are a few settings to be checked or set, depending on your connection.   OpenOCD with CMSIS-DAP Make sure '-f kinetis.cfg' is specified as 'Other Options':   P&E with OpenSDA or Multilink Select your Interface, Port and Device Name:   Segger J-Link Make sure you use the correct device name (link to Segger web page (scroll there down!) lists all supported devices). OpenSDAv1 and OpenSDAv2 is using SWD. Disable SWO if not supported by your connection:
View full article
The FRDM-K64F board comes with the mbed CMSIS-DAP firmware installed by default. CMSIS-DAP can be used with KDS using OpenOCD. There are two alternative firmware files available for the FRDM-K64F (which runs OpenSDAv2 (which is different from the previous OpenSDAv1)): P&E OpenSDAv2 which emulates a P&E OpenSDA/Multilink Segger OpenSDAv2 which emulates a Segger J-Link   The Segger firmware is available on the Segger home page (see Segger J-Link Firmware for OpenSDAv2 | MCU on Eclipse). The P&E firmware has not been released at the P&E web site yet, but is available attached to this document.   To install the firmware: Unpack the .bin file from the zip archive. Power the board with the OpenSDA USB port with the reset button pressed Release the reset button, the green LED shall blink. Copy the .bin file to the BOOTLOADER device, wait until the green LED flashes fast Re-power the board Now you have your new P&E or Segger firmware loaded. In KDS use the P&E GDB server and select OpenSDA. For Segger select J-link. See KDS Debug Configurations (OpenOCD, P&E, Segger) for details.
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
(NOTE: this document gets constantly updated with new information) =============================================================================== Release Notes and News: Kinetis Design Studio V1.1.0 Version Date: 05-Aug-2014 ===============================================================================   Greetings, The Kinetis Design Studio is a complimentary (free of charge) IDE and tool chain to develop, build and debug embedded applications for Freescale Kinetis Devices. It is based on open source software including Eclipse, GNU compiler and GDB Debugger. The Kinetis Design Studio is offered for free, and support for it is provided through this Freescale Kinetis Design Studio Community Forum.   Setup Files and Installation The software can be downloaded from the download section here: Kinetis Design Studio Integrated Development |Freescale. Currently, installation files are provided for Windows 7/8 (.exe) and Ubuntu 32-bit (.deb). NOTE: Installation files for RedHat/Centos (.rpm) have not been released yet, but we expect either a workaround or a fix shortly. NOTE: To have the full device support (e.g. KV31 devices) and Kintetis SDK support, you have to install the Kinetis SDK and install the KDS Eclipse update in <sdk installation>\tools\eclipse_update.   Documentation and Release Notes The documentation page on http://www.freescale.com/kds hosts several documents: Fact Sheet: Information about Kinetis Design Studio User Guide: Installation and Setup, first steps with Kinetis Design Studio Porting Guide: How to port applications from CodeWarrior to Kinetis Design Studio. Release Notes: Information about device support, known issues and workarounds. As the information and release notes are constantly updated, an update of the infomation is provided in the "Release Note Update" section below. Migrating from KDS V1.0.1 (Beta) to KDS V1.1.0 If you have the beta version installed, there is no need to uninstall it. Uninstall it once you migrated everything from the beta to the V1.1.0. If you have a workspace or projects from the beta version, it is recommended that you start with a new workspace (do not share a workspace between different versions!). You should be able to migrate 'normal' projects easily. However, Kinetis SDK projects will not be able to be migrated easily, because there has been a lot of changes. If you are migrating a Kinetis SDK project, then the best advice is to create a new project with KDS V1.1.0 and then move your own files over.   Release Note Updates and News This section contains updates and news after publication of the release notes: 05-Aug-14: Installation for RedHat/Centos 32-bit: the installation files are on hold right now. Watch for an annoucement in this community forum. 05-Aug-14: OpenOCD for FRDM-K22F board: KDS does not support OpenOCD for the K22F on these boards yet. Instead, a Segger (see FRDM-K22F: Debugging with Segger J-Link OpenSDAv2.1 Firmwarehttp://www.segger.com/opensda.html) or P&E debug application can be used until there will be an OpenOCD update for KDS. Watch for an announcement in this community forum.   Thanks for using the Kinetis Design Studio!   =========================================================================== Freescale, the Freescale logo, Kinetis, Processor Expert are trademarks of Freescale Semiconductor, Inc., Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their respective owners. ARM is the registered trademark of ARM Limited. (c) 2014 Freescale Semiconductor, Inc. ===========================================================================   Freescale Community Forum: https://community.freescale.com/community/kinetis-design-studio
View full article
This document explains how you can debug the FRDM-K22F board with the Segger J-Link OpenSDAv2.1 Firmware and the Kinetis Design Studio V1.1.0.   Applicable to: OpenSDAv2.1 boards (FRDM-K22F for now) Kinetis Design Studio V1.1.0     Outline The FRDM-K22F board (FRDM-K22F|Freedom Development Board|Kinetis|Freescale) comes with OpenSDAv2.1 programmed on it, and has the CMSIS-DAP debug firmware on it by default. (see 'Technical Details' at the end about the OpenSDA differences)   OpenOCD with CMSIS-DAP for FRDM-K22F is not supported in KDS V1.1.0. Trying to debug the FRDM-K22F board with KDS V1.1.0 and OpenOCD/CMSIS-DAP results in an error in the Console View and is currently not possible, until OpenSDA gets updated (see Kinetis Design Studio V1.1.0: Release Notes and News).   One solution is to use the Segger J-Link OpenSDAv2.1 firmware to debug the board. (Another solution is to use the P&E Multilink OpenSDAv2.1 firmware, see FRDM-K22F: Debugging with P&E OpenSDAv2.1 Firmware)   Installation of Segger J-Link OpenSDA V2.1 Firmware You need to install the Segger J-Link OpenSDAv2.1 firmware on the board, and you only need to do this once (unless you change the firmware again).   Go to SEGGER - The Embedded Experts - OpenSDA / OpenSDA V2 and download the OpenSDA V2.1 firmware (zip file) Unzip the firmware file (JLink-OpenSDA_v2_1.bin) in the zip file to your harddisk. Power the board/Plug in the USB cable with the OpenSDA USB port, while having the Reset/SW1 pressed. The device should enumerate BOOTLOADER: device on your host. You are now in bootloader mode. Copy the Segger .bin file to that BOOTLOADER device. Wait a few seconds to complete the operation. Unplug the board, and now power it normally (without SW1 pressed) The board should now show up as J-Link device and with a virtual COM port: You are ready to use to debug the FRDM-K22F as if you would do with a Segger J-Link 🙂   Debugging with Segger J-Link OpenSDAv2.1 Create a new debug/launch configuration: Select your project, then use the menu Run > Debug Configurations. Use the 'new' Icon to create a new configuration for your application and project (Main tab):   Specify MK22FN512xxx12 as your device name, and make sure 'SWD' is selected:   Have SWO disabled:   That's it. Now you can debug your application with Segger J-Link OpenSDA V2.1 firmware on the board :-). You can use the 'Debug' button in the launch configuration: Or use the debug icon drop-down list:   Happy Debugging 🙂 Technical Details There are so far three versions of the OpenSDA available: OpenSDAv1.0: this one is on all the FRDM boards like FRDM-KL25Z, FRDM-KL26Z, FRDM-KL46Z, FRDM-K20, ... (prior FRDM-K64F). The bootloader on these boards is protected and cannot be erased and supports P&E, Segger and CMSIS-DAP debug applications (*.sda). OpenSDAv2.0: This version was released at FTF 2014 with the FRDM-K64F board. This is an open source bootloader, and the bootloader can be replaced by the user. It supports *.bin files and P&E, Segger and CMSIS-DAP debug applications. OpenSDAv2.1: This version is released with the FRDM-K22F board. It is the same as The debug circuit on the board is the same for all OpenSDA versions (Kinetis K20 microcontroller): the difference is what bootloader is programmed on the K20: the bootloader on the OpenSDAv1.0 cannot be erased/changed. The bootloader on OpenSDAv2.x can be erased/changed, and the difference between the OpenSDAv2.0 and v2.1 is the address where the debug application starts: for OpenSDAv2.0 it expects the application at address 0x5000, while OpenSDAv2.1 expects the application to start at address 0x8000.   See also: OpenSDAv2
View full article
When starting a new project, in many cases it is helpful to start from an existing project and copy it.  Here are some methods to do this when starting with the Kinetis Software Development Kit (KSDK).  This example is done with KSDK v1.3.0, and the toolchain Kinetis Design Studio (KDS) v3.2.0, using the KSDK hello_world demo for the FRDM-KL03Z board.   There is a handy tool called KSDK Project Generator, which is useful for starting a new KSDK project, or cloning some KSDK example projects.  But sometimes it is still preferred to copy an existing project.   KDS is built on the Eclipse IDE.  And Eclipse provides the ability to copy a project within the Project Explorer view.  To do this, right-click the project in the Projects View to copy, and select Copy.  And then the project can be pasted in the Project Explorer.   When pasting the project, Eclipse defaults to creating the copied project in your workspace directory.   Using the default location like this works for simpler projects, where the needed files are self-contained in the project directory.  But with a KSDK example project, this default location will typically lead to errors in the copied project, see screenshot below.  The reason is because the KSDK example projects use project-relative paths to find the source files and libraries used by the project.  These paths are relative from the original KDS project directory.  After copying to a new location like this, the needed files are no longer in the same relative location from the new KDS project directory.  In a new location like this, all the paths in the project settings will need to be updated from the new location to build.   So another option when copying the project is to place the new project under the same parent directory of the original project.  That way, all the project-relative paths are the same.  For example, the hello_world KDS project directory used here is located by default at C:\Freescale\KSDK_1.3.0\examples\frdmkl03z\demo_apps\hello_world\kds.  This time, the new project will be copied to the same parent directory, using C:\Freescale\KSDK_1.3.0\examples\frdmkl03z\demo_apps\hello_world\Copied_hello_world_frdmkl03z.  Using this location, the copied project builds without errors.   If it is preferred to move the new project somewhere other than the parent directory of the original project, then the paths in the new project settings need to be updated.  Here are the typical project settings within KDS that need to be changed based on the new project directory location:   C Compiler Includes settings for all the header files in KSDK:   Linker settings for the linker command file location:   Linker settings for KSDK library locations:
View full article
After we released the "Kinetis Bootloader to Update Multiple Devices in a Network for Cortex-M4" (Kinetis Bootloader to Update Multiple Devices in a Network for Cortex-M4 ), many customers want to port it to FRDM-K64 board, so here I share it.   - This bootloader is based on KDSv3.2. -About the detail introduce and user guide, please refer to:    https://community.nxp.com/docs/DOC-328365 - There also some points when porting, please check the attachment. - I attached the project source code. And also two user application projects.   Customers can refer to the application and user guide to configure your application project. - The GUI is the same with bootloader for k22, we do not change anything.   BR Alice
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
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