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!
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.
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 🙂
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 🙂