Kinetis Design Studio Knowledge Base

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

Kinetis Design Studio Knowledge Base

Labels
  • General 92

Discussions

Sort by:
KDS V1.0.1 (beta) is using the GNU 4.8.0 toolchain, while the latest and greatest from ARM Inc. on launchpad is the 4.8.2 GCC ARM Embedded.   KDS V1.0.1 (beta) is using an older newlib nano which requires at least 400 bytes of HEAP memory. This is an issue for smaller Kinetis devices (e.g. less than 2 KByte of RAM). It is possible to switch the tool chain and libraries in KDS to the 4.8.4 (or later) from ARM/launchpad.   The following article describes the details and steps to use a different toolchain than the default one: http://mcuoneclipse.com/2014/07/11/switching-arm-gnu-tool-chain-and-libraries-in-kinetis-design-studio/ Basically it means to put the GCC ARM Embedded into a special folder inside KDS. That article explains as well the differences between the original KDS tool chain and the GCC ARM Embedded one.
View full article
When you want to start debugging with SEGGER J-Link lite debugger in Kinetis Design Studio 1.1.1 you must set properly several options otherwise the debugger behave incorrectly (it seems that debugger works but the application execution does not work - e.g. functions are not called).   When you create a new Kinetis Design Studio project (with Processor Expert), write you code and build the application you must also create a debug configuration (open the context menu of the project in the Project Exporer and select Debug As / Debug Configurations...). In the Debug Configuration window create a new debugger connection for GDB SEGGER J-Link Debugging and set the correct values for the derivative of your project (e.g. MKL25Z128 derivative on FRDM-KL25Z target board): On the Debugger tab set the device name (see the list of Supported device names)  (e.g.set value MKL25Z128xxx4 for the MKL25Z128) and uncheck the Allocate console for semihosting and SWO (it is not supported).     On the Startup tab uncheck Enable semihosting and Enable SWO.   Click on Apply to save the settings. the debugger is connection is set properly now and you should be able to debug your application (click on the Debug button). Note: You can use this option for the OpenSDA connection when the SEGGER firmware is flashed. SEGGER offers a firmware running on the Freescale OpenSDA platform which makes OpenSDA compatible to J-Link Lite (see pages https://www.segger.com/opensda.html). You can find more details about OpenSDA MSD Bootloader in the OpenSDA User’s Guide document, see http://www.freescale.com/files/32bit/doc/user_guide/OPENSDAUG.pdf
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
A new updated plugins is available from P&E with extended device support (see list at the end) for KDS V1.1.1:   NOTE: You need V1.1.1 for this update, as V1.1.0 has an issue with updating the P&E plugins, unless you apply a manual workaround. See the V1.1.0 release notes.   Use the menu Help > Install New software and use the PEmicro update site from the list: Select the updated plugin, and press 'Next' to go through the installation. At the end, you are asked to re-start KDS.     Release Note information: KDS_513_b140905 includes the following features and bug fixes:   (*) Adds device support for the following devices: (*) Add MBED/PEMICRO OpenSDA support for FRDM-K22F and FRDM-K64F boards   Kinetis - K24 Series k24fn256m12   Kinetis - KL17/KL27/KL33/43 Series kl17z32m4 kl17z64m4 kl17z128m4 kl17z256m4 kl27z32m4 kl27z64m4 kl27z128m4 kl27z256m4 kl33z128m4 kl33z256m4 kl43z128m4 kl43z256m4   Kinetis - KMx - Photon3 km14z64am5 km14z128am5 km33z64am5 km33z128am5 km34z128am5   Kinetis - KV4x kv40f64m15 kv40f128m15 kv40f256m15 kv43f64m15 kv43f128m15 kv44f64m15 kv44f128m15 kv45f128m15 kv45f256m15 kv46f128m15 kv46f256m15   Kinetis - K11/K21 - K20 512k/1Mb k11dn512am5 k11dx128am5 k11dx256am5 k21dn512am5 k21dx128am5 k21dx256am5 k21fn1m0am12 k21fx512am12   Kinetis- K02F Series: K02F128M10 K02F64M10   Kinetis- KW Series:   KW01Z128 KW21D256M5 KW21D512M5 KW22D512M5 KW24D512M5   Kinetis- K66/65 Series: K66FX1M0M18 K65FX1M0M18 K66FN2M0M18 K65FN2M0M18   Kinetis - WPR Series alpha WPR1516M2   KDS_506c_b140807 includes the following features and bug fixes:   Plugin Version 1.12.   ENGR00325552 - Includes changes to p2.inf to include both metadata and artifact repositories on the same line. ENGR00325553 - Specify IP issue for Ethernet P&E interfaces (Cyclone MAX, Tracelink) is addressed. Adds support for MBED Bootloader 2.1 on FRDM-K22F and FRDM-K64F boards.       Happy Updating 🙂
View full article
In most of Freescale MCUs, there is only one Flash on chip.  When executes Flash programming we need copy Flash programming routine from Flash to RAM then execute it from RAM.  The reason is that when writing MCU Flash, program is also reading instruction from same Flash, but Flash can’t perform reading and writing parallel. So executing the flash programming routine from RAM can avoid Flash read/write conflict.   In Cotex M0+ core kinetis, Platform Control Register (MCM_PLACR) is added. The MCM_PLACR register selects the arbitration policy for the crossbar masters and configures the flash memory controller. A useful bit I am going to talk about is bit 16 ESFC: Enable Stalling Flash Controller. When this bit enabled, it can stall flash controller when flash is busy.  Setting ESFC bit can well-balance time sequence of Flash reading and writing – when writing Flash, reading Flash instruction can wait, and vice versa. Using ESFC bit can make our flash programming easier. Thus one Flash can write itself, which is not possible for other one Flash MCU without ESFC bit control.   Currently MCM_PLACR is supported in below chips with Cotex M0+ core embedded: MKE02/04/06 SKEA MKL02/04/05/14/15/16/17/24/25/26/27/33/34/36/43/46 MKM13/14/32/33/34/38 MKV10 MKW01     I didn’t find any official Flash Programming demo code on ESFC bit usage so far. So I made sample code under Codewarrior10.6 and KDS2.0 respectively. The demo codes are for MKL25, but the method is available for all Cotex M0+ MCU I listed above. It’s easy to port the flash programming code to other Cotex M0+ chip. Here are porting steps for both KDS and CW environment: - Create new project with project wizard with default setting to create a new project - Copy flash_kinetis_m0.c and flash_kinetis_m0.h to project Source code folder - Include the specific MCU header file in  "flash_kinetis_m0.h", for example  #include "MKL25Z4.h" - Include "flash_kinetis_m0.h" to the related source file:  #include "flash_kinetis_m0.h”   Enjoy Flash Programming!
View full article
Hello community!   Attached is a document that explains how to use Kinetis Design Studio to debug both a bootloader and application at the same time, this will be done using GDB commands to specify an additional symbol file to be used in the debug session.   The bootloader used for this example is the project for the FRDM-K64F board provided in the KBOOT 1.2.0 named freedom_bootloader and the application is a bareboard led demo that was adapted to work with this bootloader by following the steps described in this document:   https://community.freescale.com/docs/DOC-256669   The document was created using the MK64FN1M0VLL12 MCU like the one in the FRDM-K64F board, but the same principles are applicable to any Kinetis MCU.   Software versions The steps described in this document are valid for the following versions of the software tools: KDS v3.2.0 KBOOT v1.2.0     Contents      1. Overview and concepts. 1.1 Kinetis Bootloader. 1.2 GDB Server.      2. Flashing Bootloader and Application. 2.1 Flashing freedom_bootloader project. 2.2 Loading demo application using the Kinetis Updater. 2.3 Flashing demo application and bootloader using the P&E advanced programming options.      3. Debugging Bootloader and Application. 3.1 Debugging bootloader and demo application projects using the P&E interface. 3.2 Debugging bootloader and demo application projects using the Segger interface.      4. Conclusion.      Appendix A - References.     I hope you can benefit from this post, if you have questions please let me know.   Best Regards! Carlos Mendoza Original Attachment has been moved to: K64F12_Led_Demo.zip
View full article
- This document introduces how to develop a simple CAN module application on KDS, it is suitable for the beginners to start using the KDS and Processor Expert, and it mainly focus on how to developing a CAN Loopback application, how to use the “Typical Usage” of “help on component”. - About the Sending or Receiving data demo(with interrupt or polling) we can find on  the "Typical Usage" of "help on component" . - Pay attention that , in the Typical Usage code , the Transfer Message ID is 0x123u, while in the CAN_LDD default configuration , the Receive Message ID is 0x7FF, they are should be same . So we should change one of them (In standard frame format, the admissible range is from 0x00 to 0x7FF; in extended format, the range is from 0x00 to 0x1FFFFFFF ), on my project , I change the TX ID from 0x123u to 0x7FFu on the code, about the detail information, please look at the document and application project.   This application hardware is TWR-K21F120M board, software is KDS v3.2.0 .
View full article
(NOTE: this document gets constantly updated with new information)   =========================================================================== Release Notes: Kinetis Design Studio (KDS) V1.0.1 Beta Date: 06-June-2014 ===========================================================================   Content: 1) What's New 2) Devices Supported 3) Known Issues and Workarounds   Freescale Community Forum: https://community.freescale.com/community/kinetis-design-studio   =========================================================================== 1) What's New =========================================================================== Kinetis Design Studio is a complimentary, free of charge and unlimited Eclipse based tool chain with GNU gcc and GNU gdb for the Freescale Kinetis devices. As debug connections, OpenOCD/CMSIS-DAP, P&E Multilink and Segger J-Link are supported.   A pre-release of the V1.0 beta has been used at the Freescale Technology Forum (FTF) 2014, and based on this feedback, several things have been improved: Installer: Backslash has been removed from KSDK_PATH variable. An additional variable is created (KSDK_PATH_1_0_0_BETA). Installer: Processor Expert CDE (Component Development Environment) is now installed too. Installer: fixed issue with intstallation into a path with spaces. Installer: The installation dialog dealing with removing old versions of KDS has been reworded to clarify that it offers users the opportunity to search for and remove old versions, not that it has already detected old versions on the system already. Installer: The working directory used by shortcuts created on Windows is now the KDS eclipse/ directory. This allows workspaces to be positioned relative to the installation. Processor Expert: an updated version of Processor Expert has been incorporated. Project Creation: Bare projects are now created with proper *.S assembly file extension. Project Creation: Kinetis SDK __START, __HEAP_SIZE and __STACK_SIZE preprocessor symbols are now generated, and include path settings have been extended. Project Creation: Projects for M4 cores with floating point unit have the hardware floating point options set in the compiler settings. Debugging: Updated (v4.84c) version of Segger debug tools which fixes a "Move to Line" GDB issue seen with previous versions. Eclipse: A new release of the GNU ARM Eclipse plugins (http://gnuarmeclipse.livius.net/blog) has been incorporated. This includes fixes for the following issues: On Windows the "Allocate console for OpenOCD" checkbox, that must always be checked, can no longer be modified. The GNU LD Error parser is now enabled by default. Previously errors and warnings from the linker didn't appear in the Problems view. Eclipse: The name of the default workspace has been changed to "workspace.kds". Eclipse: The list of available update sites now includes the P&E Micro update site. OpenOCD: In its default configuration OpenOCD will now always write a known-safe value to the Flash Configuration Field (FCF). This is designed to prevent users from inadvertently locking their devices by programming them with a broken executable. This safety feature can be disabled with the "fcf_write_enable" command, and re-enabled with "fcf_write_disable". These commands may only be used after the kinetis flash bank has been defined. OpenOCD: The part-specific OpenOCD configuration files included in previous releases have been deprecated. They have been replaced by a single configuration file for all kinetis parts: kinetis.cfg. This unified file also uses a faster adapter speed of 1000 Khz. Toolchain: Previous versions of the linker emitted a warning "cannot find entry symbol", when the specified entry point of the program could not be found. This warning has been promoted to an error by default. A pair of options, --warn-missing-entry --error-missing-entry, have been added to allow users to control this behaviour.   IMPORTANT: the KDS V1.0.1 beta installation comes with an installation of the beta Kinetis SDK. For KDS V1.0 GA (General Availability Release), the Kinetis SDK will be a separate installation/zip file, and therefore projects created with the KDS V1.0.1 beta will likely not work with that future Kinetis SDK version without modifictions (e.g. updating path settings).   =========================================================================== 2) Devices Supported =========================================================================== Processor Expert projects: - All Kinetis ARM Cortex-M0+ and Cortex-M4(F) devices supported by Processor Expert.   Kinetis SDK projects: - K64F (MK64FN1M0VMD12 only)   Bare Projects (no SDK and no Processor Expert projects) - K64F, KL25Z   =========================================================================== 3) Known Issues and Workarounds =========================================================================== Installation ISSUE: Users of the KDS v1.0 (FTF) may have an old KSDK_PATH "User" environment variable set. The updated installer only modifies system environment variables. WORKAROUND: Users should remove any stale "User" KSDK_PATH environment variables. ISSUE: When Kinetis Design Studio is installed in a read-only directory, for example Program Files, the Eclipse configuration is stored in a user-specific area. If the user has other versions of KDS, or other Eclipse-based products, using that same configuration area they may be prompted to perform an update when they launch Eclipse. For the components that don't provide a public update site this update will fail, however KDS should still be fully functional; the update can safely be skipped. WORKAROUND: Use the default installation path proposed by the installer. ISSUE: Installing on Linux, if you already have Segger drivers installed, you might receive an error like "dpkg: error processing kinetis-design-studio_1.0.1-1_i386.deb (--install): trying to overwrite '/etc/udev/rules.d/99-jlink.rules' which is alos in package jlink 4.78.7". WORKAROUND: make sure that you install as root. Uninstall the existing j-link drivers before running the KDS installer.   Project Creation ISSUE: For bare projects (no SDK, no Processor Expert), the project is with a linker file for the KL25Z. WORKAROUND: Change/replace the linker file with a linker file matching the device (e.g. copy from a Processor Expert project). ISSUE: Converting and Importing CodeWarrior for MCU projects to KDS as outlined in the QuickStart might result into projects which do not build. As the libraries for KDS are different (EWL), the cannot be automatically mapped to the GNU libraries. WORKAROUND: Update the projects settings manually after project import. ISSUE: Migrating existing CodeWarrior projects with multiple build targets can result in an error message Cannot run program "": Launching failed. The CodeWarrior Migration Assistant only converts the active build configuration. Other build configurations will be partially converted. WORKAROUND: This can be fixed by manually editing the Builder Settings tab in the C/C++ Build properties: Uncheck "use default build command" and replace ${cross_make} with make. ISSUE: After creating a project for MK64 devices that uses both Processor Expert and KSDK users may see build errors: "No valid CPU defined" fsl_sim_features.h. WORKAROUND: This can be worked around by adding a pre-processor definition supported by fsl_sim_features.h to the Projects C Compiler pre-processor settings. For FRDM-K64F make sure the following two symbols are defined in tehe Preprocessor settings of the compiler: "CPU_MK64FN1M0VLQ12" and "CPU_MK64FN1M0VMD12". ISSUE: For Kinetis SDK projects (both only SDK and SDK+PEx), global variables and library does not get properly initialized. A hard fault or undefined global variables are the possible result. This is caused by skipping some initialization code in the startup code. WORKAROUND: In the project settings, under Cross ARM GNU Assembler > Preprocessor, delete the "__START=main" and add __NO_INIT_DATA_BSS to the defines.   Processor Expert ISSUE: Using the AsynchroSerial component causes an error about missing SIM_PDD_SetClockSourceUART0(). (see Missing function SIM_PDD_SetClockSourceUART0 in KDS 1.0.1). WORKAROUND: See workaround in Re: Re: Missing function SIM_PDD_SetClockSourceUART0 in KDS 1.0.1 ISSUE: Processor Expert projects cause a rebuild of the project even if no changes are made. The issue is for example that after opening a project, the Processor Expert .pe (XML) file gets changed, causing a rebuild of the whole project. WORKAROUND: none.   Building ISSUE: ISSUE: In the problems view, after creating or opening a project, the messages "arm-none-eabi-gcc" not found in PATH appears. WORKAROUND: Ignore/delete these errors, as they come from the Eclipse indexer/parser, and they do not affect functionality. The messages will disappear as well if the project is built. Alternately the Problems view can be configured not to show errors from the Scanner: Select "Configure contents" from the Problems view menu, then uncheck the "Show all items" checkbox in the top left, and the "C/C++ Scanner Discovery Problem" checkbox in the types list. ISSUE: The Kinetis SDK comes with projects configured for the GNU ARM Embedded Toolchain which is different from the toolchain used in KDS. So the KDS make file projects cannot be used without modifications with KDS. WORKAROUND: Create a KDS project and add the SDK files to it. ISSUE: Building a Processor Expert project reports duing linking "arm-none-eabi/bin/ld.exe: cannot find entry symbol Reset_Handler". The likely reason is that the project sources for the CPU component including the vector table has not been generated properly. WORKAROUND: Enforce generation of the vector table and the linker file. Go the to 'Build' properties tab of the CPU component and e.g. change the stack size of heap size, then regenerate the code and build again.   Debugging ISSUE: Clicking on the 'bug' (or 'debug') toolbar icon shows a dialog named "Launch DEbug Configuration Selection", and debugging fails from there. WORKAROUND: select the debug configuration from the list behind the small triangle drop down in the 'debug' toolbar icon. ISSUE: When trying to start an OpenOCD debug session from within Eclipse, if the underlying OpenOCD tool fails to start, the Eclipse process manager may appear to hang or may fail with an uninformative error message. Possible causes of OpenOCD failing to start include a board not being connected, a board running the wrong OpenSDA application, or bad options being passed to OpenOCD. Running the command line tool: <KDS_INSTALL_DIR>/openocd/bin/openocd.exe may provide more informative output. WORKAROUND: Make sure the board is properly connected and powered. ISSUE: In some cases it is possible that with using OpenOCD and CMSIS-DAP it can lock the K64F chip on the board, so the CMSIS-DAP is not able to access it any more. You need a P&E Multilink or Segger cable to regain access to the chip. WORKAROUND: Make sure you use the lastest CMSIS-DAP release as it migh have fixed that issue. Use the P&E or Segger debug firmware to debug the board. Steps to load the new firmware: a) Power the FRDM-K64F board with the OpenSDA USB port and hold the reset button while powering the board b) Release the reset button, the board enumerates as BOOTLOADER device, the green LED is blinking. c) Copy the DEBUG_K64F_MBED_PEMICRO_V108.BIN file to the BOOTLOADER device. The green LED will blink fast. c) Repower the board normally: the green LED will be always on. ISSUE: If the PATH variable has double semicolons (;;) or a semicolon at the end, launching gdb debugger might fail. The it is possible that the gdb debugger specified with ${cross_prefix}gdb${cross_suffix} is not found. An error message with "Error while launching command: gdb --version" is shown. WORKAROUND: The likely reason for this issue is a double semicolon in the PATH environment variable, or a semicolon at the end of the variable, see  https://bugs.eclipse.org/bugs/show_bug.cgi?id=389823. If a double semicolon or one at the end is present in your PATH, remove it. If this does not help: In the launch configuration settings, instead using ${cross_prefix}gdb${cross_suffix}, point directly to the GDB executable, e.g. "C:\Freescale\KDS_1.0\toolchain\bin\arm-none-eabi-gdb.exe". ISSUE: The Quick Start Guide (installed in the layout, not the one in this community) states that no OpenOCD debug configuration is required, however "-f kinetis.cfg" must be specified in the other options box. WORKAROUND: specify "-f kinetis.cfg" in the other options box. ISSUE: The current versions of the mbed CMSIS-DAP image sometimes exhibit meta-stability. This manifests as "CMSIS-DAP Write Error (0x04)" and "Polling target kinetis.cpu failed" messages being emitted by OpenOCD. A possible cause is an invalid program being flashed to the device. WORKAROUND: Use another debug technology (P&E Multilink, Segger J-Link) to flash a valid program to the device. ISSUE: When creating a bare project (no KSDK and no Processor Expert) for MK64 devices, programs may not reach main when debugging. This is caused by the the COP watchdog triggering a reset. WORKAROUND: To work around this issue disable the watchdog in __init_hardware, as demonstrated by Processor Expert projects. See Disabling Watchdog for 'Bare' Projects ISSUE: 'Disconnect' from a running target debug session does not work as expected (e.g. halts the target). WORKAROUND: use this as 'Other options' in the debug configuration: -f kinetis.cfg -c "kinetis.cpu configure -event gdb-detach {   resume }"     =========================================================================== 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. ===========================================================================
View full article
Sometimes I only want to download a binary (.s19, .hex, .elf) without the need for the project and sources of it. With the command line version of GDB you can do this, but there is as well a way in KDS to do this more interactively: Flash to File...   From the Run menu, select 'Flash from file...':   Then configure your connection (see KDS Debug Configurations (OpenOCD, P&E, Segger)). Beside of the settings in the Debugger Tab (which depends on the used debug interface (P&E, Segger, OpenOCD, see note1 below), you need to specify in the 'Main' tab two things: The name of the binary (e.g. elf file) A project name (see note2 below)     Note1: there is a current issue in KDS v1.0.1beta that P&E is not listed as Debugging Connection. This is expected to be fixed in KDS V1.1 (GA).   Note2: While the project is not really necessary, there is the issue in KDS v1.0.1beta that without a project name, you will get an error. So if you start with a new/empty workspace, you need to create a 'dummy' project first and to provide this as a project name.   Happy Flashing 🙂
View full article
Hello KDS users!   Nowadays assembly language is being eradicated for embedded systems, and other alternatives such as C/C++ are widely used.   However we know sometimes it becomes necessary to get to "the bones" of our MCU, even from a C project, and play directly with its registers and status flags. Some use cases are:   - Startup code - Bootloaders - Time critical routines - Benchmarking   It is common to include assembly code using the "__asm()" style. But what if I want to use my C variables in the assembly code? or if I want to call an assembly subroutine from a C project? We can do this in Kinetis Design Studio, which comes with GCC tools preinstalled.   The attached document is an overview and explanation of this extended assembly feature. Also I am including a pair of example projects developed in KDS v1.1.1, for the KL25Z128 and K60DN512 devices.   Thanks to Abigail Inzunza Lopez, who helped with this.   I hope you find this useful !
View full article
In KDS and Codewarrior for MCU GCC build, linker will initialize RAM after reset, the enter main function. However in some application,  User doesn’t want linker initialize data section. A typical case is when in a bootloader+application combined project, the two program need share the same RAM memory - user application writes data to a shared RAM then invoke bootloader by software reset,  bootloader can read the exact data out. The data in shared RAM are not being overwritten by bootloader linker initialization.This article will introduce two methods about how to add uninitialized data section to GCC build.   Method 1. Use NOLOAD keyword in linker file: NOLOAD : The section should be marked as not loadable, so that it will not be loaded into memory when the program is run. For example in below section .buffram and .bss2 are addressed as “NOLOAD” and doesn’t need to be loaded when the program starts to run. For detail, see article on MCU on Eclipse: http://mcuoneclipse.com/2014/04/19/gnu-linker-can-you-not-initialize-my-variable/   Method 2. Use  pointer in C code for uninitialized RAM. This method doesn’t use NOLOAD. Here are the steps to utilize it: Step1: don’t define uninitialized RAM in linker file. Step2: in C file, use point to access the uninitialized address.   For detail, see attached document with demo listed.
View full article
Hello community!   This document explains how to link the CMSIS-DSP library to a KSDK 2.x project in KDS.   The steps described in the document were done using the MK64FN1M0VLL12 MCU like the one in the FRDM-K64F board, but the same principles are applicable to any Kinetis MCU.     Software versions The steps described in this document are valid for the following versions of the software tools: KDS v3.2.0 KSDK v2.x     Contents   1. Glossary. 2. Overview and concepts.      2.1 CMSIS - Cortex Microcontroller Software Interface Standard.           2.1.1 CMSIS Components. 3. DSP example application.      3.1 Creating KSDK 2.x Project.      3.2 Linking CMSIS-DSP Library.      3.2 Importing DSP example source files. Appendix A - References.     I hope you can benefit from this post, if you have questions please let me know.   Best Regards! Carlos Mendoza
View full article
USB Mouse in KDS   Description:   A project made in KDS using the accelerometer on a FRDM-KL25Z128M4 board to control a USB mouse input. The LED will flash red while not connected as a USB mouse, and flash green when it is. The reset button will left click.   Sensitivity of the mouse can be changed by altering the HIDM1_Move command in main.c Reset button can be changed from left to right click by altering comments in main.c   Sections of code taken from: - http://mcuoneclipse.com/2012/09/21/tutorial-accelerating-the-kl25z-freedom-board/ - http://mcuoneclipse.com/2013/08/01/using-the-frdm-kl25z-as-a-usb-mouse-device/
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
Hi everybody,   this time you will find in the attached document the required settings to build a C++ project using KDS3.0 and MQX for KSDK1.2.   For information about creating a simple C MQX RTOS for KSDK1.2 project please see the following document. How To: Create a New MQX RTOS for KSDK Project in KDS   For information about creating a simple C FreeRTOS for KSDK1.2 project please see the following document. How to: Create a New FreeRTOS for KSDK1.2 Project in KDS3.0   Best regards, Carlos
View full article
USB Keyboard in KDS   Description:   A project made in KDS using the FRDM-KL25Z128M4 board as a USB keyboard input. The LED will flash red while not connected as a USB keyboard, and flash green when it is. The reset button will press the print screen button. The reset button can be configured to press any possible key as long as they are correctly #defined. Use http://www.usb.org/developers/devclass_docs/Hut1_11.pdf as a reference for keys. Strings may also be output, see the commented out H1DK1_SendStr call in main.c for an example.   Sections of code taken from http://mcuoneclipse.com/2013/06/30/using-the-frdm-kl25z-as-usb-keyboard/
View full article
The project attached is a simple bare metal project for the FRDM-KL25 using the new Kinetis Design Studio. All the information about KDS can be found in:   Kinetis Design Studio Kinetis Design Studio Integrated Development Environment (IDE)   The project configures the board to run in PEE mode at 48 MHz. UART0, which is connected to the SDA virtual serial port, is used in Interrupt mode.   The application echoes what is written in the terminal and when the letter r, g or b is entered the RGBleds change respectively (red, green or blue).   I hope this project can be useful.   Best regards.
View full article
Greetings, I have created a multi-part tutorial how to use the WS2812B (aka Adafruit NeoPixel) LED stripes and boards with the FRDM-K64F board:   Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 1: Hardware Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 2: Software Tools Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 3: Concepts Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 4: Timer Tutorial: Adafruit WS2812B NeoPixels with the Freescale FRDM-K64F Board – Part 5: DMA The tutorials go though the hardware setup, Kinetis Design Studio, debugging the first project, using the Kinetis SDK, how to set up the Flex Timer Module (FTM) and how to use the Kinetis eDMA to generate the timing and bitstream to drive the WS2812B LED stripes.   I hope you find this useful, and you learn from this for your next design.   Happy Kinetising 🙂
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
KDS V1.0.1 (beta) with FRDM-KL25Z board which has P&E OpenSDA as firmware loaded. Steps shown with creating the project, creating debug configuration for connection and device, then debugging it.
View full article