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:
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
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
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
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
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
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
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
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
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
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
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
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
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
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
FRDM-K64F is an ultra-low-cost development platform for Kinetis K64, K63, and K24 MCUs. this board is already widely used among Freescale customers. http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-K64F   The FRDM-K64F platform features OpenSDAv2, the Freescale open source hardware embedded serial and debug adapter running an open source bootloader. This circuit offers several options for serial communication, flash programming, and run-control debugging. User who works with KDS3.0 can choose J-Link interface, P&E OpenSDA interface, or Mbed interface.  For each of the option, user need update debugger firmware first. I will introduce each of them one by one.     All the related driver and firmware are enclosed in this article as attachment.
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
This document explains how you can debug the FRDM-K22F board with the P&E 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 P&E OpenSDAv2.1 firmware to debug the board. (Another solution is to use the Segger J-Link OpenSDAv2.1 firmware, see FRDM-K22F: Debugging with Segger J-Link OpenSDAv2.1 Firmware)   Update KDS from P&E Update Web Site For KDS V1.1.0, you need to install an update throught an Eclipse update. The update is from www.pemicro.com/eclipse/updates within the Install New Updates dialog under the Eclipse Help menu. !!!! Please note that there is a known issue in KDS V1.1.0 which requires  to remove and add a link to P&E's update site in order for installation procedure to work in KDS v1.02. Please see description below: Issue: The default P&E update site included in KDS v1.02 (PEMicro - http://www.pemicro.com/eclipse/updates)  will not allow a user to properly update the P&E plugin on a freshly installed KDS 1.02 layout. Workaround:  a. Remove the PEMicro - http://www.pemicro.com/eclipse/updates update site from the list of available update sites. Use the menu Help > Perferences > Install/Updates > Available Software Sites and Remove the PEMicro entry: b. Exit the KDS Eclipse IDE and restart it from the command line with the  -clean parameter. On Windows start Eclipes from the cmd.exe (DOS shell) with the -clean parameter: c. In Eclipse, add the PEMicro - http://www.pemicro.com/eclipse/updates update site. Use the menu Help > Install New Software and press the Add button: d) Enter http://www.pemicro.com/eclipse/updates as update Location and press OK: e) Then update from P&E's website:   Installation of P&E OpenSDA V2.1 Firmware You need to install the P&E OpenSDAv2.1 firmware on the board, and you only need to do this once (unless you change the firmware again).   Go to http://www.pemicro.com/opensda/ and download the OpenSDA Firmware Apps file (zip file) (requires registration at P&E) Unzip the firmware files to a folder on 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 the correct firmware file (DEBUG-FRDM-K22F_Pemicro_v108b_for_OpenSDA_v2.1.bin) to the 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 OpenSDA device, a virtual COM port and as PEMicro OpenSDA Debug Driver: You are ready to use to debug the FRDM-K22F as if you would use a P&E Multilink 🙂   Debugging with P&E 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):   In the Debugger tab, specify OpenSDA Embedded Debug as Interface, select the OpenSDA device as Port, and select the K22FN512M12 as device, and make sure 'SWD' is selected:   That's it. Now you can debug your application with P&E 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: And then I'm debugging the FRDM-K22 with the P&E OpenSDAv2.1: 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
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
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