CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Just bought dev board, debugger won't run

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pasty



Joined: 30 Mar 2016
Posts: 6

View user's profile Send private message

Just bought dev board, debugger won't run
PostPosted: Wed Mar 30, 2016 8:09 pm     Reply with quote

I just bought the 24EP256GP206 dev board package.
https://www.ccsinfo.com/product_info.php?products_id=PIC24H-kit
I can compile and run the exercise programs from the included booklet.
But the debugger won't run.
I called tech support, they didn't have an answer.

Any ideas?

Thanks,
Bob
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Thu Mar 31, 2016 1:13 am     Reply with quote

What development environment are you using?.
MPLAB or CCS IDE.

Assuming CCS.

First, have you selected 'debug', 'configure', and selected the right debugger?.

Have you told your code to debug?.
add:

#DEVICE ICD=TRUE

in the code (don't actually need to do this, but it avoids having to manually say 'yes' each time).

Then click 'enable debugger'.

What do you see at each stage?. Is the debugger listed?. Where does it fail?.
pasty



Joined: 30 Mar 2016
Posts: 6

View user's profile Send private message

more info
PostPosted: Thu Mar 31, 2016 12:09 pm     Reply with quote

Hi Telmah,
Thanks for your reply,

I am running the CCS IDE
The correct debugger is selected (ICD-USB). I am using the ICD-U64 (just bought it a few days ago).

I am aware of the #DEVICE ICD=TRUE

The debugger says "attaching", then "loading", then "busy", then a dialog opens saying "error - target not running"

I have noticed that there seems to be two way things are compiling.
1. If I select "compile" while the debugger window is open, then I get a compiler warning that says " warning - Bootloader disabled" and the target will not run. RAM% shows zero, ROM% shows zero after compile

2. If I select "compile" when the debugger window is closed, then select "build and run", the program runs. RAM% shows zero, ROM% shows 3%.
After hitting "build and run", I see "loading executive" then it loads a hex file then it runs OK.

In case 1, the target does not run.
In case 2, the target does run.

Something different seems to be happening in the compilation and with a bootloader in the two cases.

I am not finding any information about the bootloader. What is this doing exactly? Is this related to the problem?



Thanks,
Bob
pasty



Joined: 30 Mar 2016
Posts: 6

View user's profile Send private message

a little more info
PostPosted: Thu Mar 31, 2016 2:14 pm     Reply with quote

Apparently, the bootloader is a UART bootloader that is part of the devkit_24ep256gp206.h include file.

I went back to the first exercise program in the example booklet that does not use the above include file, it uses the 24ep256gp106.h include file (no bootloader included).

The debugger still will not start and still says "error - target not running"
So, the bootloader is not related to my issue.

I just got a message back from tech support saying they are working on the issue. They can't get the debugger to run on the 24EP dev board either.

I will report their findings when they are available,
Bob
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Fri Apr 01, 2016 1:19 am     Reply with quote

As a completely 'off the cuff' thing to try. Try setting up your program for the simplest possible clock mode. So FRC, at 7.37MHz. See if this then works.

There is a problem with all the chips in this family, that they can't wake up if PLL is being used, using an external oscillator that is outside the range of 3Mhz to 5.5Mhz. If this is the case, you have to wake using FRC, and only once started switch the divisors and enable the PLL. Now DEBUG in many cases behaves differently to 'real', with regard to clock switching, so might be giving problems. If the oscillator wasn't starting, then you would get the device not running error.
newguy



Joined: 24 Jun 2004
Posts: 1906

View user's profile Send private message

PostPosted: Fri Apr 01, 2016 7:41 am     Reply with quote

If Ttelmah is right, here's code that should get you up & running reliably. I had a similar issue but with a different chip.

http://www.ccsinfo.com/forum/viewtopic.php?p=159723&highlight=pll+internal#159723
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Fri Apr 01, 2016 11:39 am     Reply with quote

I'd test first with just FRC. The point is that what Newguy posts is a way of getting the chip working if it doesn't start. I'm looking at the possibility that the debugger can't handle the startup instead.
pasty



Joined: 30 Mar 2016
Posts: 6

View user's profile Send private message

FRC
PostPosted: Fri Apr 01, 2016 11:47 am     Reply with quote

Hi Telmah,
Thank you for the suggestion.
I am new to these processors and to programming micros in C.

What would the code be to try this?

Thanks,
Bob
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Fri Apr 01, 2016 11:58 am     Reply with quote

Something like:
Code:

#include <24EP256GP206.h>
#device ICD=TRUE

#FUSES NOWDT
#FUSES FRC
#FUSES CKSNOFSM
#FUSES ICSP1
#FUSES NOJTAG

#use delay(internal=7370000)

void main(void)
{
    while(TRUE)
        output_toggle(PIN_xx);
}

Choose a pin number that suits you for 'xx', and try debugging it.

If this launches and gets to the toggle line, it pins the problem down to the clock startup in debug.

If this works, then tell CCS, and they should very quickly have a tidy fix for it.
pasty



Joined: 30 Mar 2016
Posts: 6

View user's profile Send private message

no joy
PostPosted: Sat Apr 02, 2016 1:00 pm     Reply with quote

Hi Telmah,
I tried running the test code you sent.
I still get he same error "error - target programming not running" after launching the debugger.

Bob
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Sun Apr 03, 2016 12:43 am     Reply with quote

It was worth trying.

I was going through the list of things that would make the 'target not run'.

Power. However if CCS have tried as well, they should know how to power the board.
Clock.
Connections.

The only one of these that was in your control, was the clock. Hence worth trying....

If I had one of these in front of me, I'd sit down and play. Probably stick a logic analyser on the ICD connections and try to work out what is happening. Unfortunately looks as if you will have to wait and see what CCS say... :(
ljblinds



Joined: 13 May 2016
Posts: 2

View user's profile Send private message

PostPosted: Fri May 13, 2016 3:43 pm     Reply with quote

I had to put the following into my code for a 24FJ128GA106....

Code:

 #device icd=2
ljblinds



Joined: 13 May 2016
Posts: 2

View user's profile Send private message

PostPosted: Fri May 13, 2016 4:04 pm     Reply with quote

Open the Device Editor for your device. Expand Tools. You will see there are 3 sets of pins you can connect the ICD to on the "ICSP Pins" line. You need to tell the compiler which pins you are using. Probably the 2nd set, B6/B7 so I THINK that's why I had to put a 2 in there.

It's been several years and I'm just getting back into C programming for PICs so correct me if I'm wrong here. Question
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group