OpenSDA on the Freedom KL25Z Board


P&E has released information and firmware instructions for using the OpenSDA, see pemicro.com/opensda. Future has posted a very useful article about using OpenSDA here. So time to upgrade OpenSDA bootloader and firmware v10.1. My FRDM-KL25Z board is a pre-production board, and I assume the production boards expected next week will have the new firmware on it. But it is always useful to know how to change/upgrade the firmware, as I expect there will be new versions of it in the future.

:!: Update: P&E has released a new firmware v114 which combines USB CDC, MSD bootloader and debug application.

OpenSDA

In the Freedom board, there is a Kinetis K20 (K20DX) which runs OpenSDA:

Freedom Board

Freedom Board

The OpenSDA is a firmware running on the K20 which runs a bootloader:

OpenSDA Block Diagram

OpenSDA Block Diagram

The bootloader is pre-programmed on the board, and is entered if pressing the SW1/Reset button on the Freedom Board. The booloader enumerates as MSD (Mass Storage Device, like a USB Memory stick). Using that bootloader different applications are programmed on the board. These OpenSDA applications are files with *.SDA extension.

Note: I believe the only way to change the OpenSDA Bootloader itself is using the JTAG connector for the K20, although I have not seen the sources or project for it. According to the Freedom production board pictures on Element14, this JTAG header is *not* populated on the board. But adding that JTAG header should not be a big deal if needed.

The P&E firmware includes two different applications:

  • DEBUG_APP_*.SDA: this enables OpenSDA to act as a debugging interface (similar to what OSBDM does).
  • MSD-<board>*.SDA: Application which turns the board into an MSD (Mass Storage Device, like a USB memory stick). This MSD application can be used to program different application to the target chip, see here. With this bootloader loaded, it is possible to program S19 files to the target processor. Element14 has published a set of such files here.

Downloading the new firmware

Downloading the new OpenSDA firmware package from the P&E OpenSDA site gives me these files:

OpenSDA Firmware package

OpenSDA Firmware package

As explained above, there is one generic debug SDA application, plus three MSD applications which allow me to program the target processor with S19 applications. The MSD applications depend on the target processor to be programmed.

Programming OpenSDA firmware

To program an new OpenSDA *.SDA application is simple:

  1. press the reset/SW1 button on the Freedom board while powering the board (plugging in the K20 USB connector).
  2. The green LED near the K20 starts blinking
  3. The K20 enumerates as MSD device and is named ‘Bootloader':

    Enumerated Bootloader

    Enumerated Bootloader

  4. Simply drag&drop or copy the *.SDA application file to the Bootloader device to program it to the board:

    drag and drop new SDA application file

    drag and drop new SDA application file

  5. Re-power the board, and now the new SDA application is running

OpenSDA Debug Application

In case of the DEBUG_APP_*.SDA, the OpenSDA acts as a debug interface for example supported in CodeWarrior for MCU10.3. The beta is expected to be out very soon.

This applications enumerates as debug interface and offers a USB CDC mode:

OpenSDA Debug Devices in Windows Device Manager

OpenSDA Debug Devices in Windows Device Manager

The OpenSDA Debug connection is offered as a choice in the CodeWarrior New Project wizard:

OpenSDA Debug Connection in CodeWarrior

OpenSDA Debug Connection in CodeWarrior

Using the OpenSDA connection in the debugger is very similar to any of the P&E run control devices:

OpenSDA in Eclipse Debug Launch Configuration

OpenSDA in Eclipse Debug Launch Configuration

OpenSDA Application Bootloader

If using the OpenSDA MSD (e.g. MSD-FRDM-KL25Z_v103_Pemicro.SDA for the Freedom Board), then I can simply program S19 files to the target board. Element14 already has such S19 files available here:

Element14 SREC files for OpenSDA

Element14 SREC files for OpenSDA

Like above: press SW1 while power-on, and then simply copy the SREC file to the bootloader and reset the board. Simple as that :-).

I expect that there will be a growing community providing such SREC files. For sure I will offer my applications that way as well :-).

Happy OpenSDAing :-)

About these ads

56 thoughts on “OpenSDA on the Freedom KL25Z Board

  1. Pingback: Tutorial: Accelerating the KL25Z Freedom Board | MCU on Eclipse

  2. Pingback: CodeWarrior for MCU10.3 beta is now available | MCU on Eclipse

  3. Pingback: A Seminar, and Freedom with it | MCU on Eclipse

  4. Pingback: Tutorial: USB CDC with the KL25Z Freedom Board | MCU on Eclipse

  5. Pingback: Fixing the USB Drivers | MCU on Eclipse

  6. Pingback: Completing the FRDM-KL25Z Board | MCU on Eclipse

  7. Pingback: Unsecuring the KL25Z Freedom Board | MCU on Eclipse

  8. Pingback: JTAG/SWD Debugging with the FRDM-KL25Z Board | MCU on Eclipse

  9. Pingback: USB CDC and SCI: Side-by-Side with the Freedom Board | MCU on Eclipse

  10. Hello.

    I am having trouble connecting to my board on Windows XP. I installed and updated the drivers as the quick start guide explains with no trouble, and I can connect to the board both as the flash progammer (showing the FRDM-KL25Z drive) and as the bootloader (showing the BOOTLOADER drive), but I can’t seem to load files in either of them. The explorer window shows the new *.srec or *.sda files on the drive, but nothing changes on the board.

    Have you heard of somehing similar happening to someone else?

    I previously the same board on my work computer running Windows 7 and everything worked fine. I’ll try this board on that computer but I’d really like to have this working on my personal computer.

    Thanks in advance.

    Like

    • I do not have any more an XP machine (that machine runs now Windows 8). But I know for a fact from my experience with USB MSD (Mass Storage Device) work, that the Windows OS indeed could have an impact. I have seen cases where a ‘file commander’ or shell extension or virus scanner has an impact how the file is written to the bootloader. I suggest that you try to write to the board using the command prompt/dos shell. Maybe this helps.

      Like

      • Hello Erich.

        Thanks for the tip. I’m at my work computer and I tried writing to the bootloader using the Windows 7 user interface and it worked, so it may be what you mentioned. I also tried using the command prompt and it also worked.

        Later when I get home I’ll try using the command prompt in my Windows XP machine to see if it works. I’ll let you know.

        Thanks again.

        Like

      • Hello Erich.

        Just to let you know that using the command prompt worked for my board in Windows XP. Don’t know what is the cause but I’m glad there is a work-around.

        Thanks for the help.

        Like

  11. Hello,

    I am having exactly the same problem, than luismgc, the thing is that using the same computer (Windows 7 64bits) everything worked fine at the beginning but then I just cannot download files using the MSD, and actually the Error LED status is set every time I try to program it. I have updated the firmware and nothing changes. What should it be done when the Error status appears? How is it to write to the board using the cmd prompt??

    Thanks a lot in advance.

    Like

    • Hello,
      to use the command prompt:
      – press +R (this opens the ‘Run’ dialog
      – use ‘cmd’ as command to open the DOS shell/command prompt
      – then use the copy command to copy your s19 file to the board, e.g. “copy myFile.SREC e:\” where E:\ is the bootloader driver

      Hope this helps,
      Erich

      Like

      • Hey Erich!

        I am really starting to get worried.. I tried using the cmd prompt. It didn’t work. Additionally, I tried updating the Debbug SDA application instead of the MSD and when debugging using Codewarrior 10.3 beta, a message like this comes to the display: “Device is secure. Mass erase is disabled. Try to unsecure anyways?”. Then there are the options for yes or no, I have actually tried both of them both after a couple of times pressing the button, then a new window with the following error shows up: Error launching PruebaPWM_FLASH_OpenSDA, ARM GDI Protocol Adapter : Can’t connect. The Debugger can not connect to the P&E device. Any ideas??

        Thanks a lot.

        Like

    • Hello Avril.

      I used the method described by Erich, using the copy command on the command prompt. I just used the whole path for the srec or sda file.

      I haven’t experienced the “secured device” issue yet, but I remember seeing several posts about it in this blog. Here are some of them:

      http://mcuoneclipse.com/2012/05/28/device-is-secure/

      http://mcuoneclipse.com/2012/11/04/how-not-to-secure-my-microcontroller/

      http://mcuoneclipse.com/2012/10/26/unsecuring-the-kl25z-freedom-board/

      I haven’t read them, so I don’t know if they’re specific to your problem, but I hope it helps.

      Like

      • Hey Luis,

        thanks a lot, sure any help is welcome at this point… =) I believe I can solve my problem after reading some of the posts… However I’m gonna sleep now and will try it tomorrow =D!!! Thanks!!

        Like

      • Sure.

        Let me know how it turns out and if you find out how that happened, just in case I ever run into a similar issue.

        Good luck.

        Luis.

        Like

  12. Pingback: A new Freedom Board: FRDM-KL05Z | MCU on Eclipse

  13. Pingback: The Freedom Robot | MCU on Eclipse

  14. Pingback: Debugging ARM Cortex-M0+ Hard Fault with MTB Trace | MCU on Eclipse

  15. Pingback: First Steps with Avnet’s Wi-Go Board | MCU on Eclipse

  16. Pingback: Back to Basic(s) with the Freedom Board | MCU on Eclipse

  17. Pingback: Live View for Variables and Memory | MCU on Eclipse

  18. Pingback: Tutorial: IAR + FreeRTOS + Freedom Board | MCU on Eclipse

  19. Pingback: Zumo Line Following with FRDM-KL25Z | MCU on Eclipse

  20. Pingback: Tutorial: ADC with the Freedom Board | MCU on Eclipse

  21. Pingback: Pololu Line Following Robot with Freedom Board | MCU on Eclipse

  22. Pingback: First Steps with the P&E Tracelink | MCU on Eclipse

  23. Pingback: A new Freedom Board: FRDM-K20D50M with ARM Cortex M4 | MCU on Eclipse

  24. Pingback: printf() with the FRDM-KL25Z Board and without Processor Expert | MCU on Eclipse

  25. Pingback: Red Suite 5: Eclipse Juno, Processor Expert and unlimited FRDM-KL25Z | MCU on Eclipse

  26. Pingback: Using the Freedom Board as JTAG Programmer | MCU on Eclipse

  27. Pingback: Serial Bootloader for the Freedom Board with Processor Expert | MCU on Eclipse

  28. Pingback: Can MCU10.4 recover a bricked OpenSDA Freedom Board? | MCU on Eclipse

  29. Pingback: Freedom Board with Segger OpenSDA Debug Firmware | MCU on Eclipse

  30. Pingback: CMSIS-DAP with IAR and the KL25Z Freedom Board | MCU on Eclipse

  31. Pingback: Bricking and Recovering FRDM-KL25Z Boards: Reset, SWD Clock and Low Power | MCU on Eclipse

  32. Pingback: DYI Free Toolchain for Kinetis: Part 1 – GNU ARM Build Tools | MCU on Eclipse

  33. Pingback: DIY Free Toolchain for Kinetis: Part 2 – Eclipse IDE | MCU on Eclipse

  34. Pingback: DIY Free Toolchain for Kinetis: Part 3 – Debugger (GDB Server with P&E and Segger) | MCU on Eclipse

  35. Pingback: A new Freedom Board: FRDM-KL46Z | MCU on Eclipse

  36. Pingback: Tutorial: FreeMASTER Visualization and Run-Time Debugging | MCU on Eclipse

  37. Pingback: The Freescale OpenSDA Trap: “No Device Available”, or something like that…. | MCU on Eclipse

  38. Pingback: FRDM boards not responding? Check your Virus Scanner! | MCU on Eclipse

  39. Pingback: FRDM Board Bootloader fails with Windows 8.1 Preview | MCU on Eclipse

  40. Pingback: New P&E OpenSDA Firmware v114 | MCU on Eclipse

  41. Pingback: Review: New FRDM-KL26Z Board | MCU on Eclipse

  42. Pingback: Freedom Board Resources | Smiffy's Place

  43. Pingback: Binary Files for the mbed Bootloader with Eclipse and GNU ARM Eclipse Plugins | MCU on Eclipse

  44. Pingback: Segger J-Link Firmware for OpenSDAv2 | MCU on Eclipse

  45. Pingback: Updated Freedom Board Logic Analyzer with DMA | MCU on Eclipse

  46. Pingback: Step-by-Step: Updating OSBDM/OSJTAG Debug Firmware | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s