Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Debug External Processors with USBDM and Freedom Board | MCU o...
2 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
USBDM_4_10_4a_Win.msi
Debug External Processors with USBDM and Freedom Board | MCU o...
3 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
USBDM Setup
Debug External Processors with USBDM and Freedom Board | MCU o...
4 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Not sure if this was just a problem with my machine, but: afterwards my
OpenSDA/OSBDM/OSJTAG device drivers did not enumerate properly. I had
to browse to the driver files e.g. in C:\Freescale\CW MCU v10.3\Drivers
\P&E\Drivers\osbdm to have them installed again.
OpenSDA USBDM Firmware Installation
For OpenSDA, I need a special firmware. I did download the USBDM_OpenSDA firmware zip
file:
USBDM_OpenSDA Firmware
Then updated the firmware on the Freedom board, following the instructions in the
OpenSDA.txt in the archive. After that, the device should enumerate properly as USBDM
BDM Interface:
Debug External Processors with USBDM and Freedom Board | MCU o...
5 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
If everything is working out, you should have now an extra connection setting in the new
bareboard project wizard:
I dont know why, but for whatever reason this option and the
corresponding functions (debug connections) were not showing up in
CodeWarrior first. Since I tried it the first time (and it did not work), I have
for sure rebooted my machine. Fact is: it is working now
Debug External Processors with USBDM and Freedom Board | MCU o...
6 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
It adds a new Connection Type to the CodeWarrior debugger: USBDM ARM Interface
Debug External Processors with USBDM and Freedom Board | MCU o...
7 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Debug External Processors with USBDM and Freedom Board | MCU o...
8 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Debugging the FRDM-K20D50M with the FRDM-KL25Z the same way as debugging the the
FRDM-KL25Z above:
As above, the master boards needs to have the J11 trace disconnected.
Using FRDM-KL05Z to Debug an External Board
Next one is the FRDM-KL05Z. However, this did not work out of the box. Until I have found
this post in the Freescale Forum: The problem is a wrong wiring to the J6 header: the
OpenSDA signal from U4 goes to pin1 of J6, and this pin1 goes as well to the KL05Z. This
means that it is not possible to disconnect the OpenSDA from the KL05Z
. The solution is
to cut a trace and connect it to either pin 4 of J1 (SWD header) or to pin2 of J1. I did the
second solution.
First, I need to cut the J6 trace:
Debug External Processors with USBDM and Freedom Board | MCU o...
9 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Debug External Processors with USBDM and Freedom Board | MCU o...
10 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Instead to Pin2 of J6, the signal can be routed to Pin4 of J1 instead. But J6
was much easier to do for me.
With this, the FRDM-KL05Z is prepared to debug an external processor:
With J6 removed, I can debug an external processor
With J6 installed, I debug the KL05Z processor on the FRDM-KL05Z board
Debug External Processors with USBDM and Freedom Board | MCU o...
11 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Note: I have not managed to debug the changed FRDM-KL05Z say from the
FRDM-KL25Z or FRDM-K20D50M. Im using a pre-production board here,
so this might be the reasons. I can debug the other Freedom boards with the
FRDM-KL05Z, just not the other way round. I have solved this problem, see
Debugging FRDM-KL05Z with USBDM.
FRDM-K20D50M debugging FRDM-KL25Z
This time the FRDM-K20D50M hooked up to the FRDM-KL25Z: For this I have to cut/remove
the jumper J11 on the FRDM-K20D50M:
I tried different powering (just in case) and even have cut the J11 and J3 to disconnect
Debug External Processors with USBDM and Freedom Board | MCU o...
12 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
However, with the P&E Multilink Im still able to debug that board with the SWD debug header
. So there are definitely good reasons to use a probe like this: to recover from cases
where USBDM cannot help. As always: as second source and backup is what an engineer
always needs.
The other problem I was running into was this one with a 60 KByte application:
Not sure if I have hit a limit, but after that I had to restart Eclipse to
recover from this issue, as any other USBDM debug session failed. Maybe it
has corrupted the DLL? In any case, I need to follow up on this.
Summary
With USBDM, I have an Open Source run control solution with CodeWarrior and the Freedom
Debug External Processors with USBDM and Freedom Board | MCU o...
13 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
boards. So far I just have explored OpenSDA Freedom boards, but it should support boards
and microcontroller beyond that: I can now download *and* debug other microcontroller with
the Freedom board
. What Im missing with USBDM is the USB CDC support which the
original OpenSDA provides (or I have not seen how to enable that).
While professional solutions like P&E and Segger worked for me out of the box, I had to
invest time to get USBDM up and running. After that, it was working nicely. Spending that
extra time is like with any other Open Source projects I did or used: I trade in time for less
costs, or to learn new things on return. I hope that this article saves you some time and is
useful for you.
Many thanks and kudos to pgo, dieter and Brion for their help and posts, and all the ones
who developed USBDM!
Happy USBDMing
Links
USBDM Version 4.10.4 announcement: https://community.freescale.com/thread/303257
USBDM Documentation on SourceForge: http://usbdm.sourceforge.net/
USBDM Project on SourceForge: http://sourceforge.net/projects/usbdm/
USBDM Sources on GitHub: https://github.com/podonoghue
USBDM/OSBDM discussion forum: https://community.freescale.com/community/bdm
S H AR E TH IS :
G O O G LE +
Erich Styger
44
Debug External Processors with USBDM and Freedom Board | MCU o...
14 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Freedom Board, KL05Z Freedom Board, KL25Z Freedom Board, open source projects,
OSBDM/OSJTAG, P&E, technology, Tips&Tricks, USBDM by Erich Styger. Bookmark
the permalink [http://mcuoneclipse.com/2013/04/27/debug-external-processorswith-usbdm-and-freedom-board/] .
33 THOUGHTS ON DEBUG EXTERNAL PROCESSORS WITH USBDM AND FREEDOM BOARD
Allan K Liu
on May 14, 2013 at 03:47 said:
Erich Styger
on May 14, 2013 at 07:41 said:
Hi Allan,
USBDM does not support IAR (to my knowledge). But I just
saw this: http://www.segger.com/opensda.html
I need to try this out shortly, and if I do this, Ill write a post in
my blog.
I hope this helps.
Bill Lewis
on July 8, 2013 at 17:05 said:
Debug External Processors with USBDM and Freedom Board | MCU o...
15 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Erich Styger
on July 8, 2013 at 17:11 said:
Hi Bill,
I did it with the K20D50M on the FRDM-K20D50M board, so
this should work.
warcomeb
on July 16, 2013 at 11:05 said:
Hi Erich,
I using Universal Multilink rev.A with MKL15128VLH4. I have
connected in a dummy board SWD_DIO, SWD_CLK, TVCC, RESET
and GND on PORT G. I try to program microcontroller by CW 10.3
or CW 10.4 but I fail and the software tell me that this isnt possible
to connect to the programmer do you know any issue on this
microcontroller with U-Multilink? Can you help me? I choose this
microcontroller for two project and now Im desperate!
Thanks
Marco
Erich Styger
on July 16, 2013 at 11:15 said:
Hi Marco,
no I have not seen any issues on my side with using the P&E
Multilink to program Kinetis devices, at least not such kind of
issues. Does it work with a non-custom board? Like the
FRDM board (solder the SWD header on it). That way you
know your setup is working. Then check your wiring to the
KL15. Best if you do it like e.g. on the FRDM board to make
sure you have the traces right, with the proper resistors/etc.
For our boards we replicated 11 the schematics as on the
FRDM boards, and this worked very well.
I hope this helps.
warcomeb
on July 16, 2013 at 11:33 said:
Debug External Processors with USBDM and Freedom Board | MCU o...
16 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Erich Styger
on July 16, 2013 at 12:15 said:
Have you configured it to use SWD (use SWD reduced pin protocol for communication)? Note that if
you use the JTAG protocol, this will not work, you
need SWD enabled. See bitmap USB Multilinke instead of OpenSDA in CodeWarrior
Debug External Processors with USBDM and Freedom Board | MCU o...
17 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
warcomeb
on July 16, 2013 at 12:45 said:
Erich Styger
on July 16, 2013 at 12:58 said:
warcomeb
on July 16, 2013 at 14:25 said:
Marko
on September 2, 2013 at 11:01 said:
Erich Styger
on September 2, 2013 at 18:10 said:
Hi Marko,
In general, the answer is no. But it all depends on what you
are using: the instruction set and the main core is the same.
But the peripherals and memory map very likely is different.
Then it will not work. But I think for very simply things you
could do this. But no guarantee.
Debug External Processors with USBDM and Freedom Board | MCU o...
18 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Jems
on December 17, 2013 at 17:36 said:
Hi Erich !
I read many article that you post ! I can not thank you enough for all
this share !
I did the DIY about the toolchain and also the Debug External
Processors with USBDM and Freedom Board but there is little
things knotted on my mind !
I would like to program now a TWRK70 with the freedomboard
KL25! But i was asking me if a software existing to use USBDM
without using CW. I mean is there something that could be running
on KEPLER ?
Thanks again !
Erich Styger
on December 17, 2013 at 19:56 said:
Hi Jems,
the KL25Z has a SWD debug interface, while the K70 has
JTAG. So you cannot use the KL25Z (OpenSDA SWD) for
this. And to my knowledge USBDM is only supported by
CodeWarrior.
Karibe
on February 14, 2014 at 17:14 said:
Yeah, this is the problem i had with the boards today as i told you,
So it doesnt work yet, even after I cut J6, I was still debugging the
onboard controller
Karibe
on February 15, 2014 at 09:20 said:
Debug External Processors with USBDM and Freedom Board | MCU o...
19 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
I have no idea why my custom kl05z board will not work, I checked
the pinout over and over agani, nothing wrong. Both freedom boards
FRDM-KL25Z and FRDM-KL05Z are able to debug my kl24z custom
board, but openocd just gets an error on the kl05z board at the end
of initialization:
Info : only one transport option; autoselect cmsis-dap
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : add flash_bank kinetis kl05.flash
cortex_m reset_config sysresetreq
adapter speed: 50 kHz
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST =
0 nRESET = 0
Info : DAP_SWJ Sequence (reset: 50+ 1 followed by 0)
Info : CMSIS-DAP: Interface ready
Info : clock speed 50 kHz
Info : IDCODE 0x0bc11477
Error: CMSIS-DAP: Write Error (004)
Info : kl05.cpu: hardware has 0 breakpoints, 0 watchpoints
Error: CMSIS-DAP: Write Error (004)
Polling target kl05.cpu failed, GDB will be halted. Polling again in
100ms
Error: CMSIS-DAP: Read Error (004)
Polling target kl05.cpu failed, GDB will be halted. Polling again in
300ms
Error: CMSIS-DAP: Read Error (004)
Polling target kl05.cpu failed, GDB will be halted. Polling again in
700ms
Error: CMSIS-DAP: Read Error (004)
Polling target kl05.cpu failed, GDB will be halted. Polling again in
1500ms
Error: CMSIS-DAP: Read Error (004)
Polling target kl05.cpu failed, GDB will be halted. Polling again in
3100ms
I think i will stick with the kl24z for now
Karibe
on February 15, 2014 at 13:04 said:
Debug External Processors with USBDM and Freedom Board | MCU o...
20 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Amreen
on May 27, 2014 at 13:03 said:
Hello Erich,
I want use this USBDM with Freedom Board to debug another
board.
I am using KL25Z128 controller.
I have my old code without USBDM in it.
So in debug configuration setting i added new connection for
USBDM and i added USBDM target.
Now i can Run or debug the code only for the first time.
But after reconnecting the board i am not able to burn the code.
Error occurred as : -Failed to resume target process.
I have created new project with USBDM addition.
It is working. But I want the USBDM in my previous project.
Is it possible to add new connection through debug configuration
setting?
Please suggest if I am missing something.
Or I need to create new project?
Regards,
Amreen
Erich Styger
on May 27, 2014 at 21:35 said:
Hi Amreen,
yes, you can add/create a new debug configuration any time.
But your problem looks more like a USBDM problem? I just
saw that there is a new versio nof USBDM out now, so you
might give it a try.
Durgesh
on June 6, 2014 at 12:08 said:
Hello Erich,
I have followed the same procedure as above to program my target
board(with MKL25Z32M4 MCU) using freedom board.
Debug External Processors with USBDM and Freedom Board | MCU o...
21 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Erich Styger
on June 6, 2014 at 14:00 said:
Hello Durgesh,
can you verify that it works with another FRDM-KL25Z
board? I suggest to check your wiring. Failed to resume target processor means that it is not able to reset and halt the
processor, so have a look at the reset line.
I hope this helps.
Durgesh
on June 6, 2014 at 15:14 said:
Hello Erich,
Thanks for replying.
Before cutting the J2, I have downloaded the test
code onto freedom board through SWD debug
header. It worked fine. That means my SWD connections are correct.
Again I could able to program my target(MKL25Z32M4) using Multilink through SWD. So
my target board SWD connections are also correct.
But i am unable to program my target(MKL25Z32M4)
using my freedom board(both are connected with
SWD),after cutting J2
Erich Styger
on June 6, 2014 at 18:31 said:
Durgesh
on June 6, 2014 at 15:16 said:
Debug External Processors with USBDM and Freedom Board | MCU o...
22 of 22
http://mcuoneclipse.com/2013/04/27/debug-external-processors-with-u...
Durgesh
on June 9, 2014 at 16:50 said:
Erich Styger
on June 9, 2014 at 18:21 said: