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.
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:
- Press the Reset button while power the board
- Copy the Freedom BOOTLOADER:\ device
- Repower the board
With the Segger firmware loaded, the green OpenSDA LED flashes fast (about 10 Hz), and the J-Link drivers get installed:
and it shows up as 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:
At connection time, this dialog shows up:
💡 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:
💡 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.
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 🙂
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?
LikeLike
Hi cai,
how many hardware breakpoints are available depends on the vendor: ARM Cortex-M0+ has 0-4 possible hardware breakpoints. Freescale decided to spend 2.
LikeLike
The Segger version of OpenSDA looks a lot like CMSIS-DAP debugger? 🙂
Also (like CMSIS-DAP) no CDC serial comms supported…?!
LikeLike
yes, you are right, I have overlooked that: indeed it does *not* include a CDC virtual COM port 😦
LikeLike
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.
LikeLike
Pingback: Bricking and Recovering FRDM-KL25Z Boards: Reset, SWD Clock and Low Power | MCU on Eclipse
Pingback: DIY Free Toolchain for Kinetis: Part 3 – Debugger (GDB Server with P&E and Segger) | MCU on Eclipse
Pingback: The Freescale OpenSDA Trap: “No Device Available”, or something like that…. | MCU on Eclipse
Pingback: New CodeWarrior for MCU10.5 | MCU on Eclipse
Pingback: DIY Free Toolchain for Kinetis: Part 7 – GNU ARM Eclipse Plugins | MCU on Eclipse
Pingback: Using the FRDM-K64F with CodeWarrior | MCU on Eclipse
Pingback: Segger J-Link Firmware for OpenSDAv2 | MCU on Eclipse
I think that since I have a STM32F4Discovery board, which has SWD (ST-Link) interface, I’ll try to patch the FOSS ST-Link debugger at https://github.com/texane/stlink to debug the KL25/KL26 devices.
LikeLiked by 1 person
that would be really cool and interesting! I have as well a STM32 board, but I have not tried this yet, so any tips you can share?
LikeLike
Pingback: ARM Cortex-M board from scratch part 3: Kinetis KE04 | Raspberry Alpha Omega
Pingback: Using the Freescale Freedom (FRDM-KL43Z) to Debug other Boards | MCU on Eclipse
Erich,
You know if in version Segger J-Link 5.02g, it still is not avaiable?
I’m using KDS with Segger, and appears a “JLink CDC UART Port”, no device manager.
LikeLike
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?
LikeLike
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 ?
LikeLike
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?
LikeLike
Will it work for MK64 Chip?
LikeLike
Check the Segger license agreement: you cannot debug an off-board device or custom hardware.
LikeLike
Pingback: Visual Studio Code for C/C++ with ARM Cortex-M: Part 4 | MCU on Eclipse