Author Topic: Freescale OpenSDA + Linux ?  (Read 10310 times)

0 Members and 1 Guest are viewing this topic.

Offline PalmitoxicoTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: br
  • no
Freescale OpenSDA + Linux ?
« on: October 25, 2014, 05:52:41 pm »
Hi people,

I've bought one Freescale's dev board (FRDM-KL25Z), which contains an Cortex-M0+ microcontroller and an embedded debugger/serial port converter that consists in another cortex-m microcontroller. For my STM32F4 Discovery board I've been using OpenOCD for debugging and programming without headaches, but I couldn't find any way in using the OpenSDA debugger on Linux.

Someone knows if it's possible? Maybe if I change the original OpenSDA firmware to another that is supported by OpenOCD?

If it's not possible to do, can I use the Stlink/V2 debugger with OpenOCD for debugging Freescale's microcontrollers?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26891
  • Country: nl
    • NCT Developments
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline PalmitoxicoTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: br
  • no
Re: Freescale OpenSDA + Linux ?
« Reply #2 on: October 25, 2014, 09:45:29 pm »
Does this help?
http://www.element14.com/community/docs/DOC-65460/l/opensda-update-instructions-for-freescale-freedom-development-boards-for-windows-81-and-linux

Well, it have made possible to program the target microcontroller via mass storage, but I coudn't find any software similar to OpenOCD to allow debugging with OpenSDA.
 

Offline ElektroQuark

  • Supporter
  • ****
  • Posts: 1244
  • Country: es
    • ElektroQuark
Re: Freescale OpenSDA + Linux ?
« Reply #3 on: October 26, 2014, 07:16:55 am »
Try Kinetis Design Studio. It's free from Freescale.

SEGGER has a free JLINK compatible firmware for OpenSDA too. Then you can use its tools.

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26891
  • Country: nl
    • NCT Developments
Re: Freescale OpenSDA + Linux ?
« Reply #4 on: October 26, 2014, 12:39:49 pm »
The problem with vendor provided tools is that they offer a solution for their products. If you use a few microcontroller families then you end up with several different workflows and tools. My last encounter with Freescale's microcontrollers ended quickly when I realised there are almost no alternatives to their own tools. OpenOCD+JTAG seems the way to go if the Kinetis devices support JTAG. Maybe there are breakout jumpers to disable the onboard debugger and connect a seperate JTAG dongle.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline cv007

  • Frequent Contributor
  • **
  • Posts: 825
Re: Freescale OpenSDA + Linux ?
« Reply #5 on: October 26, 2014, 04:45:50 pm »
You can download the FRDM-KL25Z Quick Start Package from Freescale, program the debugger mcu to use CMSIS-DAP.
I think OpenOCD supports CMSIS-DAP.

 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: Freescale OpenSDA + Linux ?
« Reply #6 on: October 26, 2014, 06:04:09 pm »
Maybe you can use this for some openocd related inspiration: https://community.freescale.com/videos/1985

Quote
Video showing project creation with SDK + Processor Expert for FRDM-K64F. SDK only supports CPU_MK64FN1M0VLL12 derivative, so compiler settings are changed. Then the Processor Expert cpu type is changed to chip on the board, plus the Pin Muxing updated. Finally, the project is debugged with OpenOCD and CMSIS-DAP.


Also, this one:
https://community.freescale.com/docs/DOC-101845

Apparently openocd + cmsis-dap is the magic combo.
« Last Edit: October 26, 2014, 06:06:06 pm by mrflibble »
 

Offline PalmitoxicoTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: br
  • no
Re: Freescale OpenSDA + Linux ?
« Reply #7 on: October 27, 2014, 12:44:19 am »
Try Kinetis Design Studio. It's free from Freescale.

SEGGER has a free JLINK compatible firmware for OpenSDA too. Then you can use its tools.

Hum, sounds interesting and run on Linux. It uses GDB + OpenOCD + CMSIS-DAP (Open-SDA) to debug. I don't like IDEs (I use emacs and makefiles) but maybe I can figure out how they configured OpenOCD to work with CMSIS-DAP on Eclipse and apply it to my current toolchain.

The problem with vendor provided tools is that they offer a solution for their products. If you use a few microcontroller families then you end up with several different workflows and tools. My last encounter with Freescale's microcontrollers ended quickly when I realised there are almost no alternatives to their own tools. OpenOCD+JTAG seems the way to go if the Kinetis devices support JTAG. Maybe there are breakout jumpers to disable the onboard debugger and connect a seperate JTAG dongle.

I totally agree with you, Freescale's microcontrollers aren't easy to use with open source tools. They want to push you to Code Warrior at all cost. I will first try to make OpenOCD work with CMSIS-DAP, if it don't work I will try find an external JTAG debugger that supports the kinets series and is supported by OpenOCD.

Thank you guys, when I have time to test this suggestions I will post the results here  :)

 

Offline true

  • Frequent Contributor
  • **
  • Posts: 329
  • Country: us
  • INTERNET
Re: Freescale OpenSDA + Linux ?
« Reply #8 on: October 27, 2014, 05:25:55 am »
My last encounter with Freescale's microcontrollers ended quickly when I realised there are almost no alternatives to their own tools.

Freescale ("Feescale") is certainly not free, generally doesn't scale (except in cost), and if they have a product with Open in it (on the board in question, OpenSDA), you can bet your ass it is as closed as it can be (good example in this case: it will only program/debug the chip on the board). Be thankful you can reprogram the debugger... EDIT: maybe I am wrong on that and you can't reprogram the debugger? That sounds more like Freescale anyway, to be honest.

I read through the license for the Kinetis SDK and was wondering again why I would want to design a low to medium-sized production run with one of these parts in it. Like hell I am using Code Warrior.
« Last Edit: October 27, 2014, 07:04:46 am by true »
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 8637
  • Country: gb
Re: Freescale OpenSDA + Linux ?
« Reply #9 on: October 27, 2014, 05:37:46 am »
... and if they have a product with Open in it you can bet your ass it is as closed as it can be.
Names are intended to divert attention, not to illuminate.
 

Offline rizzy

  • Contributor
  • Posts: 13
Re: Freescale OpenSDA + Linux ?
« Reply #10 on: October 28, 2014, 02:18:12 pm »
Hi people,

I've bought one Freescale's dev board (FRDM-KL25Z), which contains an Cortex-M0+ microcontroller and an embedded debugger/serial port converter that consists in another cortex-m microcontroller. For my STM32F4 Discovery board I've been using OpenOCD for debugging and programming without headaches, but I couldn't find any way in using the OpenSDA debugger on Linux.

Someone knows if it's possible? Maybe if I change the original OpenSDA firmware to another that is supported by OpenOCD?

The OpenSDA debugger is a product from P&E micro. It is not open at all. There is neither any documentation nor can you modify the firmware (in the sense that you can develop your own).
But you can flash third party firmware for example from Segger, so the OpenSDA becomes a J-Link lite which works with almost every IDE I know, independent of the OS you develop with.
It should also be possible to stay with OpenOCD because OpenOCD supports the J-Link but you can also use the debugger from Segger instead of OpenOCD. It's up to you.

Here is an OpenSDA related thread on the freescale forums that explains how things are and why https://community.freescale.com/thread/316504


Quote
If it's not possible to do, can I use the Stlink/V2 debugger with OpenOCD for debugging Freescale's microcontrollers?
No, you can not. Stlink only works with ST microcontrollers.

I can generally recommend Erich Stygers blog on developing with Freescale microcontrollers on Eclipse: www.mcuoneclipse.com
Link to the J-Link firmware https://www.segger.com/opensda.html
How to install it http://mcuoneclipse.com/2014/04/27/segger-j-link-firmware-for-opensdav2/

Here is a blog post about how to use OpenSDA with a P&E plugin with Eclipse (without the Segger firmware) http://mcuoneclipse.com/2014/09/11/pe-eclipse-update-site-for-gnu-arm-eclipse-plugins/

Hope that helps.
 

Offline PalmitoxicoTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: br
  • no
Re: Freescale OpenSDA + Linux ?
« Reply #11 on: October 28, 2014, 02:52:18 pm »
Quote
If it's not possible to do, can I use the Stlink/V2 debugger with OpenOCD for debugging Freescale's microcontrollers?
No, you can not. Stlink only works with ST microcontrollers.

I can generally recommend Erich Stygers blog on developing with Freescale microcontrollers on Eclipse: www.mcuoneclipse.com
Link to the J-Link firmware https://www.segger.com/opensda.html
How to install it http://mcuoneclipse.com/2014/04/27/segger-j-link-firmware-for-opensdav2/

Here is a blog post about how to use OpenSDA with a P&E plugin with Eclipse (without the Segger firmware) http://mcuoneclipse.com/2014/09/11/pe-eclipse-update-site-for-gnu-arm-eclipse-plugins/

Hope that helps.

I'll give a try on this J-Link firmware this weekend.

The reason I'm trying to use the Freescale's boards is because there is no other low cost dev board for ARM Cortex M sold here in Brazil (I've bought my STM32-Discovery F4 from china). I have a friend who wants to learn how to program this devices and he own one of these kinets boards.
 

Offline godFather89

  • Contributor
  • Posts: 22
  • Country: ro
Re: Freescale OpenSDA + Linux ?
« Reply #12 on: October 31, 2014, 09:02:19 am »
You can use USBDM (http://usbdm.sourceforge.net/) to reprogram the programmer chip. This way you can turn a board into a programmer/debugger. It seems to support Linux but I personally used it only on win with KL05 and KL25 boards.

Quote
USBDM is a debugger hardware interface for a range of Freescale microcontrollers. It is designed to work with Freescale's Codewarrior software under Windows and Linux. More recently basic support for Coldfire and Kinetis with the Codesourcery Tool chain or ARM Ltd GNU Tools for ARM has been added. A set of stand-alone programmers are also provided.
 

Offline PalmitoxicoTopic starter

  • Regular Contributor
  • *
  • Posts: 55
  • Country: br
  • no
Re: Freescale OpenSDA + Linux ?
« Reply #13 on: November 01, 2014, 04:46:04 pm »
Good news people!

I used the J-Link firmware (https://www.segger.com/opensda.html - version 2.1)  on my FRDM-KL25z board and installed the J-Link software from SEGGER (https://www.segger.com/jlink-software.html) and it worked!

OpenOCD seems to support JLink but it gaves me some errors when I try to connect:
Code: [Select]
$ openocd -f /usr/share/openocd/scripts/interface/jlink.cfg
Open On-Chip Debugger 0.9.0-dev-00098-ge03eb89 (2014-08-21-12:32)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : J-Link initialization started / target CPU reset initiated
Error: J-Link command 0xde failed (0)
Error: J-Link command 0xdc failed (0)
Error: J-Link command 0x01 failed (0)
Error: J-Link command EMU_CMD_VERSION failed (0)
Info : J-Link JTAG Interface ready
Error: J-Link command 0xdd failed (0)
Error: J-Link command 0xdf failed (0)
Error: usb_bulk_write failed (requested=6, result=0)
Error: jlink_tap_execute failed USB io (-107)
Error: An adapter speed is not selected in the init script. Insert a call to adapter_khz or jtag_rclk to proceed.
in procedure 'init'
NOTE: After trying to connect using OpenOCD you need to disconnect and reconnect the USB cable in order to JLinkGDBServer work.

Here is how to program the board with JLinkExe:
Code: [Select]
$ JLinkExe

J-Link>r
J-Link>h
J-Link>exec device = MKL25Z128xxx4
J-Link>loadbin main.bin,0x00000000

JLink Software User Manual: https://www.segger.com/admin/uploads/productDocs/UM08001_JLink.pdf

Thank you guys!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf