Quick Start Guide FRDM-KL25Z Freescale Freedom Development Platform for the Kinetis L Series KL25 Family Preliminary Document Final version will be available September 25th Quick Start Guide Get to know the FRDM-KL25Z Freescale KL25Z128VLK4 3,3V LDO Jumper J4 KL25 USB Connector Touch Pad Slider Reset Switch OpenSDA USB Connector Freescale MMA8451Q Accelerometer 8MHz Oscillator Preliminary RGB LED Arduino I/O Header FRDM-KL25Z Hardware Features FRDM-KL25Z is a low-cost evaluation and development platform to demonstrate the capability of the Kinetis-L family of MCUs, ARM(R) CortexTM-M0+ based and targeting energy-efficient applications. The Freescale Freedom development platform is form-factor compatible with popular third-party hardware designed to work with ArduinoTM and Arduino-compatible boards, providing engineers the "freedom" to connect to a broader range of expansion boards to achieve even greater technological breakthroughs. FRDM-KL25Z Hardware Features * Easy access to MCU I/O with a tri-color LED * Touch-sensing interface with a touch pad slider * Battery-ready, low-power operation * Power-measurement access points * I2C to Low-g sensor * Standard-based form factor with expansion board options * Built-in debug interface for flash programming, run-control and monitoring Preliminary Quick Start Guide Step-by-Step Installation Instructions This quick start guide is designed to provide step-by-step guidelines to get you ready to develop your applications using the FRDM-KL25Z within minutes. Before connecting the hardware 1. Download and install Windows USB Driver OpenSDA Support from P&E Micro Systems v11_120720 or later, at http://www.pemicro.com/opensda 2. Download and extract FRDMKL25Z_v1.00 zip file or later, available HERE on E14 Community 3. During manufacturing OpenSDA MSD Application was already preloaded in the board, so when you will connect for the first time FRDM-KL25Z a "Freescale MSD USB Device" will be detected and the right driver should automatically installed by Windows, then an "OpenSDA - CDC Serial Port" will be detected by Windows and might request a driver file available in the "Windows Device Driver" folder from the FRDM-KL25Z_v1.00 zip file. NOTE : During the installation some warning messages concerning Windows compatibility might appear, just click on "Continue" Preliminary Getting Started with OpenSDA MSD Flash Programmer NOTE : FRDM-KL25Z were already preprogrammed in factory with OpenSDA MSD Flash Programmer application so you can move directly to step 4. 1. Enter FRDM-KL25Z in Bootloader mode using the following procedure: * Unplug the USB cable if attached * Press and hold the RESET/Bootloader button * Plug in a USB cable from a USB Host to the OpenSDA USB port * Release the RESET/Bootloader button * A new removable drive should now be visible with a volume label of "BOOTLOADER" 3. Load the OpenSDA MSD Flash Programmer application using the following steps: * Drag/drop or copy/paste the application file MSD-FREEDOM-KL25Z.SDA available in the "SDA application" folder from the FRDM-KL25Z_v1.00 zip file to the "BOOTLOADER" drive * Unplug the USB cable and plug it in again * A new removable drive should now be visible with a volume label of "FRDM-KL25Z" 4. Use the MSD Flash Programmer as below: * Drag/drop or copy/paste an s-record (commonly a .s19 or .srec) precompiled demo file available in the "S-RECORD project examples" folder from the FRDM-KL25Z_v1.00 zip file to the "FRDM-KL25Z" drive. * If programming is successful, the embedded application will begin execution automatically. * Unplug and re-attach the USB cable to program another embedded application. Preliminary Quick Start Guide 5. List of the S-RECORD project example available and description : * blinky-blue.srec RGB LED is blinking blue * blinky_green.srec RGB LED is blinking green * blinky_red.srec RGB LED is blinking red * blinly_rgb.srec RGB LED is blinking blue, then green, then red ... * changing_rgb.srec RGB LED is lighting in blue, then green, then red ... * accelero_I2C_rgb.srec RGB LED changes color according to inclination detected by the accelerometer embedded in FRDM-KL25Z and connected through the I2C to the MCU * touch_blinky_blue.srec RGB LED blinking frequency is defined by the touch sensor slider Preliminary Getting Started with IAR Embedded Workbench for ARM 1. Download and install IAR Embedded Workbench for ARM V6.4.20 or later, 30-day evaluation license: http://www.iar.com/en/Products/IAR-Embedded-Workbench/ARM/ 2. Load the OpenSDA Debug Application using the following steps: * Enter FRDM-KL25Z in Bootloader mode using procedure 2-1 * Drag/drop or copy/paste the application file DEBUG-APP.SDA available in the "SDA application" folder from the FRDM-KL25Z_v1.00 zip file to the "BOOTLOADER" drive * Unplug the USB cable and plug it in again * Windows should detect three new devices including "PeMicro OpenSDA Debug driver" and "OpenSDA - CDC Serial Port" and install automatically the right driver * Check in Windows device manager that Jungo/PEMicro OpenSDA Debug Driver and Ports (COM & LPT)/OpenSDA-CDC Serial Port were correctly detected Preliminary Quick Start Guide 3. Patch IAR EW for ARM V6.4.20 or later, to make it compatible with OpenSDA Debug * Copy the content of the folder "development tool patches\IAR_patch_v110\patch" from the FRDM-KL25Z_v1.00 zip file in the directory [Embedded Workbench path]\arm\bin\ 4. Run IAR EW for ARM V6.4.20 or Later and build the project * Run IAR Embedded Workbench V6.4.20 or later, by selecting it from the Windows Start menu * Select File, Open and Workspace * Select blinky.eww available in the "Project Example\build\iar\blinky" folder from the FRDM-KL25Z_v1.00 zip file then Open * Right click on Blinky freedom - FLASH_128KB (top left box) then Select Options - General Options, Target, SELECT Core "Cortex-M0+" - C/C++ Compiler, List, DESELECT options "Output list file" & "Output assembler file" - Assembler, List, DESELECT option "Output list file" - Debugger, Setup, SELECT Driver "PE micro" - Debugger, Download, Select then "FlashKLxx128K.board" and "Open" - PE micro / Setup, SELECT P&E Hardware Interface Type "Tracelink - USB" - PE micro / Setup, CHANGE JTAG/SWD speed value with 500kHz, then press "OK" * Select Project then "Clean" * Select Project and "Rebuild All" or press NOTE : During the compilation some warning messages may appear Preliminary 4. Start the Debug Environment of IAR EW for ARM V6.4.20 or later * Press Download and Debug * A PEMICRO Connection Manager window will appear, SELECT the Interface "OpenSDA Embedded Tower Debug" then press "Connect (Reset)" * Start the debug session selecting Debug, Go or pressing * Demo of changing_rgb should start and RGB LED change of color * Press Break button to pause the demo * Press Stop Button to stop the debug session and go back to Project Edition Mode Preliminary Quick Start Guide Getting Started with KEIL MDK-ARM 4.54 1. Download and install Keil MDK-ARM 4.54 or later, evaluation version : http://www.keil.com/arm/mdk.asp 2. (Re)Install Windows USB Driver OpenSDA Support from P&E Micro Systems v11_120720 or later, at http://www.pemicro.com/opensda 3. Patch Keil MDK-ARM or later, to make it compatible with OpenSDA Debug * Copy the content of the folder "development tool patches\Keil_patch_v110\patch" from the FRDM-KL25Z_v1.00 zip file in the directory [Keil Install Dir]\ARM\PEMicro 4. Load the OpenSDA Debug Application * Follow step 3-2 5. Run Keil MDK-ARM or later and build the project * Run Keil uVision4 or later, by selecting it from the Windows Start menu * Select Project, Open Project * Select Blinky.uvproj available in the "Project Example\build\keil\Freedom_Blinky" folder from the FRDM-KL25Z_v1.00 zip file then Open * Right click on Blinky_Freedom Project (left panel) then Select Options for Target `Blinky_Freedom' - Tab "Device" verify that "Freescale" "MKL25Z128xxx4" is selected - Tab "Output" select the option "Create HEX File" if you want to generate a precompiled S-record file usable with OpenSDA MSD Flash Programming demo (see step 2) Preliminary - Tab "Debug" select Use: "Pemicro OSJtag/Multi ..." then click on "Settings" button (if you don't have Pemicro option, reinstall P&EMicro Windows drivers and Keil Patch) - In the new window, select the Interface "OpenSDA Embedded Tower Debug" then Port USB should be detected. Define CPU "KL25Z128M4" Select "Use SWD reduced pin protocol for communications" Unselect "Show this dialog before attempting to contact target" Then press "OK" - Tab "Utilities" select Use: "Pemicro OSJtag/Multi ..." - Press "OK" button * Select "Project" then "Clean Target" * Select "Project" and "Rebuild All Target files" or press Preliminary Quick Start Guide 6. Start the Debug Environment of KEIL MDK-ARM 4.54 or later * Press Download and Debug * Start the debug session selecting Debug, Run or pressing * Demo of Red Green Led Color Changing should start * Press "Break" button * Press "Reset" button * Press "Run" button * Press "Start/Stop" Button Edition Mode to pause the demo (stop code execution) if you want to restart program execution since the beginning to restart the code execution to leave the debug session and go back to Project Preliminary Measure real consumption from Kinetis L Series MCUs in different Low-Power Modes 1. Modify the FRDM-KL25Z hardware WARNING : Order first a board-board connector hearder 2way, 1row, like Samtec TSW-102-07-G-S or Molex 0022284023 with the corresponding jumper. * On the back side of the board, cut the strap between J4 pins * Then you need to connect a jumper on the top side between two pins J4 Preliminary Quick Start Guide 2. Load the OpenSDA MSD Flash Programmer application using the following steps: * Drag/drop or copy/paste the application file MSD-FREEDOM-KL25Z.SDA available in the "SDA application" folder from the FRDM-KL25Z_v1.00 zip file to the "BOOTLOADER" drive * Unplug the USB cable and plug it in again * A new removable drive should now be visible with a volume label of "FRDM-KL25Z" * Windows should detect a new device "OpenSDA - CDC Serial Port" and install automatically the right driver * Check in Windows device manager that Ports (COM & LPT)/OpenSDA-CDC Serial Port was correctly detected and save the COM Port number. Preliminary 3. Drag/drop or copy/paste the s-record precompiled demo file low_power_demo_freedom.srec available in the "S-RECORD project examples" folder from the FRDM-KL25Z_v1.00 zip file to the "FRDM-KL25Z" drive. 4. As Windows 7 doesn't offer anymore the hyperterminal tool, you need to download a version of this software, like "tera term Pro" 5. Additional tools * Plug the multimeter between the two pins from J4 (top side) and select mA mode * Run TeraTerm Pro, by selecting it from the Windows Start menu - Select "Serial" option and the Port COM Number corresponding to the "OpenSDA - CDC Serial Port" (information available in Windows Device Manager) - Select "Setup", "Serial port ..." and Baud Rate "19200" then "OK" Preliminary Quick Start Guide * Press the Reset button on FRDM-KL25Z * Hyperterminal window will update as below * Select a power mode (typing 0 to 9 or A to L) then press any key to confirm * You should now measure on multimeter the real current consumption Idd from KL25 in this mode Preliminary 6. To RUN another Low Power Mode * Press the RESET button on the Freedom board * Return to Hyperterminal window and Select another power mode (typing 0 to 9 or A to L) and press any key to confirm EXAMPLE of measurement for : - CASE 0: Enter VLLS0 with POR disabled (Very Low Leakage STOP 0) NO POR - CASE 20: Enter Compute Mode run for(i=0;i