Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Post Reply
KeithV
Posts: 181
Joined: Tue Sep 13, 2011 4:40 pm
Contact:

Debugging chipKIT Sketches with MPLAB-X, Lecture Slides

Post by KeithV » Tue Aug 27, 2013 12:28 am

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.
Attachments
17007_ClassMaterial.zip
(2.15 MiB) Downloaded 545 times
KeithV
Digilent

DandyDon
Posts: 26
Joined: Fri Oct 05, 2012 7:28 pm

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

Post by DandyDon » Thu Oct 24, 2013 8:17 pm

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
Posts: 26
Joined: Fri Oct 05, 2012 7:28 pm

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

Post by DandyDon » Thu Oct 24, 2013 9:14 pm

Never mind... I figured it out!

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

DandyDon
Posts: 26
Joined: Fri Oct 05, 2012 7:28 pm

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

Post by DandyDon » Thu Oct 24, 2013 9:36 pm

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
Posts: 56
Joined: Sat Oct 05, 2013 3:25 pm

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

Post by ChristopheDupriez » Sat Oct 26, 2013 1:49 pm

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
Posts: 92
Joined: Mon Dec 30, 2013 5:05 am
Location: Hungary

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

Post by tcsaba101 » Wed Apr 23, 2014 8:58 pm

I have done it today.

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

rehrig
Posts: 2
Joined: Mon Oct 06, 2014 4:29 pm

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

Post by rehrig » Mon Oct 06, 2014 5:44 pm

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
Posts: 2
Joined: Mon Oct 06, 2014 4:29 pm

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

Post by rehrig » Mon Oct 06, 2014 6:00 pm

Keith,

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

greatnorthern
Posts: 4
Joined: Sun Apr 06, 2014 4:03 pm

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

Post by greatnorthern » Sun Dec 27, 2015 3:21 pm

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

FredCailloux
Posts: 69
Joined: Sat Mar 28, 2015 4:45 am
Location: Quebec - Canada

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

Post by FredCailloux » Sat Mar 12, 2016 5:46 pm

Hello KeithV, looks like I am one more person having trouble opening that ZIP file. :(
Can you please re-post: 17007_ClassMaterial.zip
Prashant Tripathi :idea: Knowing is to the Self what knowledge is to the ego

Post Reply