chipKIT® Development Platform

Inspired by Arduino™

Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Created Mon, 26 Aug 2013 23:28:39 +0000 by KeithV


KeithV

Mon, 26 Aug 2013 23:28:39 +0000

This year at the Microchip Masters Conference I presented a class on how to debug chipKIT sketches with MPLAB-X. Attached is the course material we gave out at the Masters.

Before you start, make sure you have mpide-0023-xxxx-20130715 or newer and you have MPLAB-X 1.85 or newer. You can get this at:

http://chipkit.s3.amazonaws.com/index.html and http://www.microchip.com/pagehandler/en-us/family/mplabx/

The basic outline of how to do this is to:

  1. Do a verbose-compile (shift-verify).
  2. paste into your clipboard the generated .elf file
  3. import into MPLAB-X the .elf file (from your clipboard) using the prebuilt project import wizard. 3a. Make sure to use the import wizard as this is the only way that the sources will get populated into the project.
  4. Add the bootloader as a "Loadables."
  5. from the project-sources, select the file you want to debug
  6. set your breakpoint
  7. Then do a debug upload from X, it will run and hit your breakpoint and you are debugging.
  8. To restore the chipKIT board for MPIDE operations, just do a production-upload from X.

The slides are pretty clear on the procedure and give you instructions on how to edit from within X as well. There is also some interesting information about how memory is laid out and how/why the whole process works.


DandyDon

Thu, 24 Oct 2013 19:17:38 +0000

Keith,

I'm having trouble doing a verbose compile with MPIDE. I'm using mpide-0023-windows-20130715 with a Max32 chipKIT.

When I do a verbose compile, there is a lot of extra stuff that scrolls thru the console window... so much stuff that once the compile is done, I can't scroll up enough to get to the *.elf file to copy it to the clipboard.

I tried changing some of the settings in the MPIDE preferences text file, but still could not make it work.

Suggestions?


DandyDon

Thu, 24 Oct 2013 20:14:24 +0000

Never mind... I figured it out!

I was clicking upload instead of compile/verify. Now it works!


DandyDon

Thu, 24 Oct 2013 20:36:33 +0000

Rats! This is annoying! I closed MPIDE & then re-opened it. I tried to "Add Existing Item..." to the Prebuilt Files section of the MPLAB X project, but that did not work...

What happens to the project once MPIDE closes? Do I have to create a new project in MPLAB X every time I want to debug my sketch?


ChristopheDupriez

Sat, 26 Oct 2013 12:49:00 +0000

In the workshop slides, I appreciate as much the explanations than the functionalities presented: thanks a lot Keith!

I installed MPLAB-X 1.9 (I had only 1.7) and I was thinking that debugging would happen through USB (avrdude): Wrong! I must use an hardware programmer: I suppose PicKit-3 will do. Why then make so many efforts to keep the bootloader in place?

Have a nice w.e.

Christophe


tcsaba101

Wed, 23 Apr 2014 19:58:37 +0000

I have done it today.

see here: viewtopic.php?f=6&t=2861&start=30


rehrig

Mon, 06 Oct 2014 16:44:28 +0000

Keith,

How did you zip the attached presentation? I've tried unzipping it on multiple machines with multiple unarchivers, but I get an error each time.


rehrig

Mon, 06 Oct 2014 17:00:46 +0000

Keith,

How did you compress the lecture? I am having difficulty unzipping it.


greatnorthern

Sun, 27 Dec 2015 14:21:02 +0000

Hi KeithV , trying to check this .zip file out but it won't open! can you reupload it?


FredCailloux

Sat, 12 Mar 2016 16:46:40 +0000

Hello KeithV, looks like I am one more person having trouble opening that ZIP file. :( Can you please re-post: 17007_ClassMaterial.zip