Freedom Board with Segger OpenSDA Debug Firmware

Looks like there is some movement on the ‘OpenSDA Front’: After CodeRed has released their RedProbe OpenSDA firmware, now Segger has released an OpenSDA firmware.

With this, I get a low-cost debugging solution similar to the well-known J-Link run control devices. The OpenSDA Segger Firmware is something like a J-Link-lite.

FRDM-KL25Z with Segger OpenSDA Debug Firmware

FRDM-KL25Z with Segger OpenSDA Debug Firmware

Licensing and Terms

The firmware and the licensing terms are on http://www.segger.com/opensda.html.

There are several restrictions:

  • Only for Freescale devices (ok, that’s not a problem, or are there other devices supported by OpenSDA?)
  • Only for evaluation boards, not for custom hardware. This means e.g. just for the FRDM boards. I read that I cannot program another device with it as I can do with USBDM?
  • No production programming: ok, that makes sense, as this is not intended to be ‘professional’
  • No warranty or support: yup, that’s fine!

Installation

I used CodeWarrior for MCU10.4 with the Segger OpenSDA and the FRDM-KL25Z board.

Installation is as usual:

  1. Press the Reset button while power the board
  2. Copy the Freedom BOOTLOADER:\ device
  3. Repower the board

With the Segger firmware loaded, the green OpenSDA LED flashes fast (about 10 Hz), and the J-Link drivers get installed:

J-Link Driver Installed

J-Link Driver Installed

and it shows up as J-Link Device:

J-Link Device

J-Link Device

After this, the green OpenSDA LED is most of the time on.

Debug Connection in CodeWarrior

In CodeWarrior I can select the Segger J-Link as connection:

Segger Connection

Segger Connection

At connection time, this dialog shows up:

Segger Terms of Use

Segger Terms of Use

💡 After selecting the ‘do not show again’ box, that dialog does not show up again.

The debug connection can be easily changed from an existing P&E OpenSDA to a Segger J-Link one:

J-Link and J-Trace for ARM Debug Connection Settings

J-Link and J-Trace for ARM Debug Connection Settings

💡 Make sure you select ‘SWD’ as Debug Port Interface.

Features

I measured (hand stopped) the time from launching the debugger up until the target stops at main(), for a 40 KByte FRDM-KL25Z application:

  • Original OpenSDA: 11 seconds
  • Segger OpenSDA: 4 seconds

So the OpenSDA is much faster for downloading, plus stepping was perceived faster too.

The other thing I noticed (and debatable if this is a bug or not: with all the other connections I use (P&E, USBDM), if I press ‘Terminate’ for a stopped target, the target will remain stopped (not running). With the Segger OpenSDA implementation, it seems that the target receives a ‘run’ as a side effect, so the application runs after terminate.

Terminate

Terminate

The other feature Segger has are ‘unlimited flash breakpoints‘:

“Unlimited breakpoints in flash available for evaluation only.” (Source: Section limitations on http://www.segger.com/opensda.html)

But I have not seen this working with CodeWarrior, as I believe this would need special treating in the debugger. Maybe because I’m not using an ‘evaluation’? If anyone knows how to enable this, please post a comment.

The other question many will ask: what about debugging a processor on another board, like how it is possible with USBDM: The problem is this in the licensing terms from Segger:

“Only debugging on evaluation boards is allowed. Debugging on custom hardware is not supported and not allowed.” (Source: Section limitations on http://www.segger.com/opensda.html)

Clearly it does not allow me to debug my custom board. But does this prevent me to debug another Freedom board???? Maybe? Maybe not? In order not to get me into troubles for saying here ‘something’, all what I can say here is this, for debugging another FRDM board (e.g. FRDM-KL25Z from another FRDM-KL25Z with the Segger OpenSDA on it):

  • I do not see any technical reasons why this should not work, if I have J6 (SWD poplulated on the ‘source’ board, J11 removed on the source board and connecting to the ‘target’ board with a 10 pin ARM Cortex debug cable
  • I do not say here that I tried this ;-), and I do not say here that it would have worked if I would have tried it ;-).
  • All what I can say is that if somebody in my office would say that he saw it working, I neither can confirm nor I can deny it 🙂

Summary

That new Segger OpenSDA interface is a new member of the hopefully growing SDA (useful) applications. It works out of the box with CodeWarrior for MCU10.4, and it is easy to transform existing ‘standard’ OpenSDA connections to use the Segger one. What I get is a faster download and debug performance. So fast that at the beginning I was doing stepping too fast in my code :-).

❗ In the current version, the Segger OpenSDA does not offer a virtual COM port over (USB CDC). This feature is supported by the original P&E and USBDM OpenSDA implementation.

Happy J-Linking 🙂

Advertisements

22 thoughts on “Freedom Board with Segger OpenSDA Debug Firmware

  1. I have test this function at IAR IDE, it’s work, and multi break point sucess, I can see in J-link control panel, there are two “HARD”, and any “FLASH”, but as I know, M0+ core support 4 hardware break point, but I can only see 2, as OpenSDA seem to support 2 hareware breakpoint?

    Like

  2. It’s going to be end of mine day, however before ending I am reading this enormous piece of writing to improve my know-how.

    Like

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

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

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

  6. Pingback: New CodeWarrior for MCU10.5 | MCU on Eclipse

  7. Pingback: DIY Free Toolchain for Kinetis: Part 7 – GNU ARM Eclipse Plugins | MCU on Eclipse

  8. Pingback: Using the FRDM-K64F with CodeWarrior | MCU on Eclipse

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

  10. Pingback: ARM Cortex-M board from scratch part 3: Kinetis KE04 | Raspberry Alpha Omega

  11. Pingback: Using the Freescale Freedom (FRDM-KL43Z) to Debug other Boards | MCU on Eclipse

    • Hi Carlos,
      It is not a matter of the J-Link software if a USB CDC port shows up, but a matter of the J-Link OpenSDA firmware on the board. Are you using the latest Segger firmware already?

      Like

      • I much prefer the Segger debugger over P&E, and have also noticed that the current Segger firmware create a “JLink CDC UART” although I’ve been unable to access it from within my apps (on a FRDM-KL26Z board).

        Do you know if it uses different pins than the standard P&E OpenSDA UART bridge, or is just not available for some other reason ?

        Like

      • Hi Geoff,
        I’m using it in the same way as the P&E one, and it uses the same pins. There is no difference from the application point of view. Is the Segger virtual COM port shown on your system properly?

        Like

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