chipKIT® Development Platform

Inspired by Arduino™

MPLab X, ChipKit PGM, Chipkit Uno: Now what?

Created Sat, 29 Sep 2012 05:32:56 +0000 by iamuke


iamuke

Sat, 29 Sep 2012 05:32:56 +0000

Befuddled noob here. So I got MPLab X, a nice Uno32, and the ChipKit PGM just arrived. I tried hooking everything up, some LEDs lit up, but MPLab X does not seem to be able to connect to the PGM, let alone try to debug or program anything. Full Stop.

It is clear that I am way out of my Arduino Comfort Zone here. My question: is there, anywhere, a simple step-by-step Chipkit For Dummies walkthrough that will get me debugging the Blink sketch using the tools described? I am a microcontrooler novice and feeling rather overwhelmed by a lot of what I read in this forum. So I need something super simple.

I just need to get through a basic example so I can verify my toolset is working and start getting familiar with MPLab X. What I actually want to debug is a lot more complex, but you gotta start somewhere.

Thanks in advance!


strim

Sat, 29 Sep 2012 10:52:36 +0000

I had similar problems. I don't know anything about MPLAB (and don't really care about it), but I've recently documented debugging with ejtagproxy and GDB. See this article in the wiki. Maybe it will help you somehow. The article is about development without MPLAB or MPIDE, but don't mind it, you could debug your MPIDE sketch the same way.

Edit: chipKIT PGM doesn't seem to be supported by ejtagproxy... but since it's similar to PICkit3, maybe adding support wouldn't be too hard?

By the way, have you seen this thread?


iamuke

Sat, 29 Sep 2012 13:12:19 +0000

strim, thanks for your response.

Yes, I have seen the thread you linked to. Looks good, but it's not the same toolset. MPLab X is not MPLab, PicKit 3 is not ChipKit PGM. I got enough variables without those differences.

If nothing else rises up I will have to resort to the process described in that post, albeit with a different hardware programmer/debugger. Not the preferred approach.

This is insane. The greybeards all seem to know the secret incantations, mysterious dance, and what potions must be mixed up in order to conjure the Pic32 demon out of the darkness. I can only thrash around trying to figue out why my LEDs don't blink. I can see that my learning curve is going to be vertical for quite some time, before I even manage to croak out a Hello World, let alone debug a double-buffered audio engine inside an ISR.

It's all cool stuff. I'm just hoping somebody has the basic procedure written out to a weapons-grade stoopid level for noobs like me. Worst case, If I manage to get through this, without such a guide I'll write one to spare future travelers from Arduinoville. I don't hink we're in Kansas anymore, Toto.


strim

Sat, 29 Sep 2012 20:45:00 +0000

I'm new to PIC32 myself, so I can't really help you, but I totally understand yours concerns. I've found no good introduction to chipKIT platform that focus on more low level things than just using Arduino libraries. I guess that's because chipKIT is still a farily new platform.

That's why I started learning PIC32 using open source toolchain (plain gcc, gdb, ejtagproxy, pic32prog), it's much easier to understand what's going on without all these additional layers in MPLAB or MPIDE.


EmbeddedMan

Sun, 30 Sep 2012 02:54:09 +0000

To use the PGM in MPLAB 8, you need to select 'Licenced Debugger' as your programmer or debugger. Is that one of the options in those menus?

*Brian


iamuke

Sun, 30 Sep 2012 03:22:21 +0000

Hey Brian,

I did select Licensed Debugger. Afer that, just to see what would happen I tried Debug>Run Debugger/Programmer self test. I figured since it's basically a PicKit3 with new lipstick, it should run the self test, no?

The output window told me it could not communicate with the device.

Just to be sure, MPLAB X does work with this PGM thingie, right? People have actually used the two components successfully?

Don't know it it matters, but I'm on OS X.


EmbeddedMan

Mon, 01 Oct 2012 15:39:47 +0000

Well, I'm on Windows, and I just got my first chipKIT PGM in the mail, and I have no problem connecting to it using MPLAB X or MPLAB 8. Maybe there's something wrong with yours?

*Brian


iamuke

Tue, 02 Oct 2012 04:31:19 +0000

I think the PGM is talking to MPLab X. Under Licensed Debugger is says "ChipKit Programmer -FN - Licensed Debugger. If it weren't talking to MPLab, how would MPLab know that?

If I unplug PGM, MPLab reverts to "licensed Debugger".

After trying various combinations of plugging in/unplugging/swearing/ clicking random debug-related menu items, I got this: [code]*****************************************************

Connecting to Licensed Debugger... Firmware Suite Version.....01.27.15 Firmware type..............PIC32MX

chipKITProgrammer by Digilent

Downloading Firmware... Downloading bootloader Bootloader download complete Downloading RS... RS download complete Downloading AP... AP download complete Firmware Suite Version.....01.28.07 Firmware type..............PIC32MX

Target detected Device ID Revision = 50900053

program memory: boot config memory configuration memory

Programming...[/code

Whereupon it hangs. Progress, I guess.


rosimildo@gmail.com

Tue, 02 Oct 2012 12:15:31 +0000

Have you tried to power the device using the USB cable ?

On my test board, I soldered the 6-pin connector to the chip-kit.


iamuke

Tue, 02 Oct 2012 13:33:12 +0000

I tried (a) powering both devices through the PGM, (b) powering both devices through the Chipkit, and (c) powering each device independently. The only one that seems to show any promise is (a)-- That's where I get the most LED action, at least.

I have not soldered the headers on. I suppose that's the next step.


EmbeddedMan

Tue, 02 Oct 2012 18:17:50 +0000

I just tried re-programming the bootloader for UBW32 using my chipKIT PGM under MPLAB 8 and it worked just fine. I had to help it along to get all of the updates to the PGM, but after that it just worked without a hitch.

I have connected to it under MPLAB X but have not actually tried programming with it yet.

Does it hang in the same place every time you try it? (I was powering the UBW32 with it's own USB cable during the program procedure.)

Do you have any other PIC32 based boards you can try the PGM on to see if its your board or your PGM that's the problem?

*Brian


iamuke

Tue, 02 Oct 2012 19:19:59 +0000

Not sure what a UBW is. But in any case, this morning I tried the "Program Device For Debugging Main Project" option, and got this:

Connecting to Licensed Debugger...
Firmware Suite Version.....01.28.07
Firmware type..............PIC32MX

chipKITProgrammer by Digilent
Target detected
Device ID Revision = 50900053


program memory: 
boot config memory

Programming...
Programming/Verify complete

So it appears that "programming" the device is working. Yet when I try to "Debug the main project", I get this:

*****************************************************

Connecting to Licensed Debugger...
Firmware Suite Version.....01.28.07
Firmware type..............PIC32MX

chipKITProgrammer by Digilent
Target detected
Device ID Revision = 50900053


program memory: 
boot config memory
configuration memory

Programming...

At which point the IDE just hangs. The board just sits there with the PGM attached. No blinkies, nothing.

I looks to my noob eyes like iMPLabX is successfully talking to the PGM and (possibly) doing something to program, boot config, and configuration memory, whatever that means. But then it hangs.

If I try to debug anyway, I get this:

Licensed Debugger is busy. Please wait for the current operation to finish.
Failed getting PC

I don't have any other boards to play with, but I can probably get one later from work in a week or so. I was planning to try an Explorer16, at least.


EmbeddedMan

Tue, 02 Oct 2012 22:11:17 +0000

Hmm. Well, the UBW32 is a board very similar to the chipKIT boards (like a MAX32). You can Google it to find more.

I tried debugging a program using MPLAB X and the chipKIT PGM and I didn't have any problem.

Maybe you could send me your entire project directory and I can try it on my end to see if it works? E-mail is brian at schmalzhaus dot com

*Brian


iamuke

Wed, 03 Oct 2012 02:39:39 +0000

I appreciate your offer, but I'm not sure my project would be any help. I just created a new project for the device, and filled in a couple of lines in main()-- int foo = 0; foo++; that kind of stuff.

I tried downloading MPLab 8. using that, the IDE recognizes the PGM, but the whole IDE freezes solid when I try to do anything with it.

I am going to have to put this away for a week since I'm going on vacation. I'll pick it back up when I return and hopefully figure this out.

Thanks for your help, I really appreciate it!


iamuke

Tue, 15 Jan 2013 04:49:32 +0000

Update 2013-01-14 -- Success!

Found a post by Gene Apperson elsewhere on this board. Turns out there was a manufacturing glitch and the PGM board I got was defective (wrong resistor value). I contacted Digilent and they sent me a new PGM. Problem solved, I can now debug!

If anyone got one of the earlier boards, you may want to get an RMA from Digilent. Apparently the defect allowed the boards to get through testing, but would sporadically fail out in the wild.

Aggravating, but Kudos to Digilent for standing by their product and making things right.