pic32 USB Program..issues

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
Hi,
so its been a while since iv posted here, hope all's ok.
been programming on my little pic32 starter kit (DM320004) if anyones interested, i posted here a while back about having issues with usb host. well iv managed to find some time, and im back on it, having sorted out directories etc, iv started writing and playing with my own code.. however, problem is, when i load the board, and its all compiled for debugging etc, i click play, but it instantly stops it.
no idea why.. i tried copying all the demo code over and it does the same.. so very confused!! please help..
any questions, any required help.. the demo code is fine, yet i compile and program the board of my code (a direct copy due to this issue) and it still does the same?
:(
 

ErnieM

Joined Apr 24, 2011
8,377
Hard to guess what the problem may be. Do you get any code to run at all? When you say "it instantly stops it" what is "it"? What code are you running? Will it run in release mode? Did you build the code in debug more to debug it? Is the correct debugger selected?

If this is your first P32 code then post something simple, like get a LED to light.
 

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
Hi ErnieM,
i have this afternoon fixed it..? it was a problem with the project settings, though which im not entirely sure, im just playing with the code itself at the moment, but i intend to go through and sort it out, seems a stupid problem to have had!
 

Thread Starter

chrisw1990

Joined Oct 22, 2011
551
Hi ErnieM,
i have this afternoon fixed it..? it was a problem with the project settings, though which im not entirely sure, im just playing with the code itself at the moment, but i intend to go through and sort it out, seems a stupid problem to have had!
i hadn't got a "heap size" in, corrected it to what the demo code had (8192) and bingo, not sure what that does though?
 

ErnieM

Joined Apr 24, 2011
8,377
The "heap" is a place in RAM for C to pull out bits of memory at run time on an as-needed basis. It is where "malloc" gets the space for it's memory. It can be reserved then later released for other uses.

Similarly there is the "stack" area where the pushed data goes used in function calls and dynamic function memory (static variables go elsewhere).

If either memory area is overrun the PIC32 is sophisticated enough to raise an exception (like an interrupt), and the default handler just stalls the program execution.
 
Top