Freescale OpenSDA + Linux ? - Page 1
Forum section: electronics / general

author: Palmitoxico
author_rank: Regular Contributor
timestamp: October 25, 2014, 05:52:41 pm
content: 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?

author: nctnico
author_rank: Super Contributor
timestamp: October 25, 2014, 09:06:38 pm
content: 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

author: Palmitoxico
author_rank: Regular Contributor
timestamp: October 25, 2014, 09:45:29 pm
content: Quote from: nctnico on October 25, 2014, 09:06:38 pmWell, 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.

author: ElektroQuark
author_rank: Unknown
timestamp: October 26, 2014, 07:16:55 am
content: 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.

author: nctnico
author_rank: Super Contributor
timestamp: October 26, 2014, 12:39:49 pm
content: 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.

author: cv007
author_rank: Frequent Contributor
timestamp: October 26, 2014, 04:45:50 pm
content: 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.

author: mrflibble
author_rank: Super Contributor
timestamp: October 26, 2014, 06:04:09 pm
content: Maybe you can use this for some openocd related inspiration:https://community.freescale.com/videos/1985QuoteAlso, this one:https://community.freescale.com/docs/DOC-101845Apparently openocd + cmsis-dap is the magic combo.

author: Palmitoxico
author_rank: Regular Contributor
timestamp: October 27, 2014, 12:44:19 am
content: Quote from: EdoNork on October 26, 2014, 07:16:55 amHum, 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.Quote from: nctnico on October 26, 2014, 12:39:49 pmI 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

author: true
author_rank: Frequent Contributor
timestamp: October 27, 2014, 05:25:55 am
content: Quote from: nctnico on October 26, 2014, 12:39:49 pmFreescale ("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.

author: coppice
author_rank: Super Contributor
timestamp: October 27, 2014, 05:37:46 am
content: Quote from: true on October 27, 2014, 05:25:55 amNames are intended to divert attention, not to illuminate.

author: rizzy
author_rank: Contributor
timestamp: October 28, 2014, 02:18:12 pm
content: Quote from: Palmitoxico on October 25, 2014, 05:52:41 pmThe 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 whyhttps://community.freescale.com/thread/316504QuoteNo, 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.comLink to the J-Link firmwarehttps://www.segger.com/opensda.htmlHow to install ithttp://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.

author: Palmitoxico
author_rank: Regular Contributor
timestamp: October 28, 2014, 02:52:18 pm
content: Quote from: rizzy on October 28, 2014, 02:18:12 pmI'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.

author: godFather89
author_rank: Contributor
timestamp: October 31, 2014, 09:02:19 am
content: 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

author: Palmitoxico
author_rank: Regular Contributor
timestamp: November 01, 2014, 04:46:04 pm
content: 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:$ openocd -f /usr/share/openocd/scripts/interface/jlink.cfgOpen On-Chip Debugger 0.9.0-dev-00098-ge03eb89 (2014-08-21-12:32)Licensed under GNU GPL v2For bug reports, readhttp://openocd.sourceforge.net/doc/doxygen/bugs.htmlInfo : only one transport option; autoselect 'jtag'Info : J-Link initialization started / target CPU reset initiatedError: 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 readyError: 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:$ JLinkExeJ-Link>rJ-Link>hJ-Link>exec device = MKL25Z128xxx4J-Link>loadbin main.bin,0x00000000JLink Software User Manual:https://www.segger.com/admin/uploads/productDocs/UM08001_JLink.pdfThank you guys!