Author Topic: debug/programming - opensda jlink/pemicro?  (Read 5647 times)

Offline fvnktion

  • Newbie
  • *
  • Posts: 1
    • View Profile
debug/programming - opensda jlink/pemicro?
« on: April 12, 2016, 08:56:56 PM »
Hi There,

I am just getting started with utasker for experimentation.  I am able to successfully build a project in KDS, but am wondering what the most direct way to debug/flash the board is?  The quickstart instructions video is for codewarrior and uses the flash utility which is not a part of KDS nor can it debug. 

Is it possible to easily use the opensda jlink or pemicro debuggers on the freedom boards?  If so how do I configure this?

Thanks!

Update:  After doing some experimenting I found it to be quite simple.  Go into "debug configurations" and add a "New" configuration under "GDB SEGGER J-link Debugging".  The only parameter I had to add was "MK22FN512xxx12" under "device name" in debugger settings.  It seems to be working well enough. 
« Last Edit: April 12, 2016, 09:21:31 PM by fvnktion »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: debug/programming - opensda jlink/pemicro?
« Reply #1 on: April 12, 2016, 09:38:11 PM »
Hi

In KDS you can create a "debug configuration" to load/debug a generated file by doing the following:
1. Select the .elf file (eg. uTaskerSerialLoader_FLASH\uTaskerSerialLoader.elf) in the project explorer
2. Right click and choose "Debug as | Debug Configurations..."
3. Double click on the debugger interface that you would like to use - eg. "GDB PEMicro Interface Debugging". This will create the basic debug configuration for the project target and the HW debugger.
4. Move to the debugger tab and choose the debugger type (eg. OpenSDA) and then it should show up as being attached if it is connected and all is well.
5. Choose "Select Device" and select the actual Kinetis part being used form the list that appears (these exact details may be debugger dependent but just see what options are there and set up the ones that make sense).
6. Usually you can select whether using JTAG or SWD and this will need to be correct - for OpenSDA it is SWD.
7. Click "Apply" to save the settings.
8. With "Debug" the target device will be connected to and the projects code loaded, after which KDS will usually move to the debug context so that you can then debug the code.

There are various options (whether to mass erase on connection, whether to connect without loading, whether to automatically run to the main entry etc.) which you can then experiment with.

Once a debug configuration has been created/used it is possile to start connecting/loading by simply clicking on a debug symbol. Find out which method works best for you and essentially do 1, 2, 8 each time in case of any intermediate difficulties.

Regards

Mark