Showing posts with label CMSIS-DAP. Show all posts
Showing posts with label CMSIS-DAP. Show all posts

January 6, 2014

CMSIS-DAP bootloader for K20 interface (news)

The freedom platform and some tower boards contain openSDA circuit. OpenSDA is managed by Freescale Kinetis K20 MCU (Cortex -M4).

It is claimed to be open-standard serial and debug adapter. It's not by "all" means, because the P&E bootloader can't be reprogrammed, as the chip is locked. Thus CMSIS-DAP interface was used on top of P&E bootloader.

CMSIS-DAP is the interface firmware which connects the Debug Port to USB. It consists of a debug unit and a device, both are usually assembled on a single board.



I was porting bootloader for K20 the last 3 days. As result, I sent yesterday a pull request to CMSIS-DAP repository (consider it's the first initial version as it's not yet on master branch), which means that the circuit openSDA (K20) will have full CMSIS-DAP support.
The link to my pull request Pull request #14 for CMSIS-DAP [github.com/mbedmicro/CMSIS-DAP]

You can freely design your boards which could use CMSIS-DAP (bootloader + interface). I will describe CMSIS-DAP more in the following days.

December 13, 2013

KL46Z CMSIS-DAP update - beta version 2 (news)

Some of you might have noticed that KL46Z was stripped from platforms. Wonder why?

The CMSIS-DAP interface was functional. However, it sets randomly the security bit or even disabled mass erase bit. With help from the mbed team, we corrected it.

I updated my notepad page on mbed, the CMSIS-DAP v2 for KL46Z is shared there.
CMSIS-DAP for the freedom platform [mbed.org/users/Kojto/notebook]

December 4, 2013

CMSIS-DAP for the freedom platform (news)

As many of you know, I recently added new freedom platforms to CMSIS-DAP, with help from the mbed team and also bigarmer2013.

I built today the CMSIS-DAP for the following boards:
  • KL05Z
  • KL25Z
  • KL46Z
  • K20D50M
You can download them here CMSIS-DAP for the freedom platform [mbed.org/users/Kojto/notebook]

Be aware, they are for testing purposes at the moment

If you have any problems, report them on mbed site, preferably in the notebook comments. EnjoY!

November 28, 2013

pyOCD with KL25Z (introduction)

This is an introduction to pyOCD, my very first steps getting familiar with pyOCD. Two mbed users reported locking of their KL25Z chips with pyOCD. I hope we find out why!

The pyOCD used to be part of mbed github repository, but not anymore. It was separated, can be found here pyOCD repo [github.com/mbedmicro/pyOCD]. It has awesome readme file there, which serves as documentation.

the official mbed page for pyOCD Debuging from GDB using pyOCD [mbed.org/blog].

I started with pywinusb (using windows on my laptop), installed via easy_install.


The second step was to build pyOCD, run from the pyOCD root directory python setup.py install.


Connect KL25Z to your PC, be certain it has mbed interface! Time to start gdb session, either gdb from toolchain or from pyOCD. I chose to run gdb_test.py which is in pyOCD/test folder.


KL25Z detected, presume to flashing part. To be save, I opened basic_test.py located in test directory and commented out line 156 flash.flashBinary(binary_file). This prevents from flashing (locking alert which I explain later).


Everything went ok according to the console, flashing was skipped though. Now return the line 156 to test flashing part. Have ready compiled GCC program (I use bin file from the example I created for mbed GCC KL25Z demo).

If you run it without arguments, the default path is /binaries/l1_target.bin, the name of bin file for KL25Z is l1_kl25z.bin . Flashing was successful but program was not running correctly and chip got to secured state. I restarted gdb test script, received an error. I opened uVision, it displays a warning that chip is locked, but not permanently, fortunately! I have to get my prototype board, to continue with testing.

I'll share more once I explore what's going on and why chip got locked once.

Update 1st of December:
I have been debugging it for a while, I added some extra code which completely messed connection to the chip, gdb returned error. Once I found out what I did wrong, everything seems to be functional.
Even flashing different binaries does not lock chip, still using pyOCD scripts, not directly its gdb implementation.



November 21, 2013

KL46Z and KL05Z boards have CMSIS-DAP interface (update)


I have spent my last evenings with CMSIS-DAP, mostly with the interface layer. There has been some motion in CMSIS-DAP recently. The master branch already contains these 2 interfaces.

After porting mbed SDK to those 2 freedom boards, this was on my todo list as a final step. They should be tested, both SDK and also CMSIS-DAP, then enabled on mbed. Can't wait to see these 2 boards online.

I can come back to the freedom board K20D50M and its mbed SDK implementation. Also what I would like to do, start with pyOCD.

November 13, 2013

CMSIS-DAP interface and porting the new boards (news)

The CMSIS-DAP interface was published by mbed team 2 weeks ago. Here's the link
CMSIS DAP [github.com/mbedmicro]

The handbook for mbed firmware can be found at cmsis-dap-interface-firmware [mbed.org/handbook] . It explains the file structure plus some basics, not detailed implementation though, which is actually crucial. I really appreciate what mbed does and the way they do! To open and share with us this interface, takes a lot of effort.

I decided this week, to get familiar with it, attempt to add HAL for the other freedom platforms which are already supported on mbed github (KL05Z, KL46Z). This is the last step (testing will be carried out anyway) to enable them online. They need the mbed interface!

KL05Z is the first one I started. However, the code is commented, but not everything is clear, I have to do lot of guessing.. Thus KL05Z flashing by bin is not working yet, it returns SWD error which I located where it fails, have to examine why it fails and do some corrections.

If I succeed, I can share the testing version of that interface.

One side note: ARM GCC export for KL25Z will be available online soon! Can't share more at the moment, but I will !