Page 1 of 1

Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Tue Aug 27, 2013 12:28 am
by KeithV
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 ... ly/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.

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Thu Oct 24, 2013 8:17 pm
by DandyDon
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?

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Thu Oct 24, 2013 9:14 pm
by DandyDon
Never mind... I figured it out!

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

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Thu Oct 24, 2013 9:36 pm
by DandyDon
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?

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Sat Oct 26, 2013 1:49 pm
by ChristopheDupriez
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

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Wed Apr 23, 2014 8:58 pm
by tcsaba101
I have done it today.

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

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Mon Oct 06, 2014 5:44 pm
by rehrig
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.

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Mon Oct 06, 2014 6:00 pm
by rehrig
Keith,

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

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Sun Dec 27, 2015 3:21 pm
by greatnorthern
Hi KeithV , trying to check this .zip file out but it won't open! can you reupload it?

Re: Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Posted: Sat Mar 12, 2016 5:46 pm
by FredCailloux
Hello KeithV, looks like I am one more person having trouble opening that ZIP file. :(
Can you please re-post: 17007_ClassMaterial.zip