This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS 5.2 Debugger Problem

I have just done the "blinky" program in CCS.

The program builds fine, but when running debug mode it stops right after the
void main(void)

{

section.

in the Debug window as you can see in the attached picture.  Clicking on "resume" starts the program properly, but I shouldn't have to click "resume"...

It runs fine if use Keil's "program".

Any help in getting this to work properly in CCS would be greatly appreciated.

Thanks,

-Mark

  • Hi Mark,

    if you are asking why it halts at main?  This is default CCS behaviour.  However it can be modified in the project debug settings.  Project->Properties->Debug .

     

    Please give that a try  Also please let me know if I misinterpreted your question.

    Best Regards,

    Lisa

  • That stops it from halting at main, but the program doesn't run and I don't understand the problem.  That was the answer to my original question.  but now I need to know why the program itself won't run.

    I get this if I run with the breakpoints inserted.  And the program seems to do nothing if I run with the breakpoints.

     

  • Hi Mark,

    what do you mean/can you confirm you program does not run?  Do you see the code getting loaded?  What if you to to Run->Load->Program once in Debug mode?  Do you see this if you don't use breakpoints?  What about pressing the run button.  Will the code/target/debug session then proceed normally?

    Best Regards,
    Lisa

  •  Lisa,

    If I use "Free Run" after the program is loaded, the program works.
    If I don't use Breakpoints, I still see the code being loaded.

    The project doesn't give me an error if I don't use breakpoints, but the program does nothing.  It also does nothing on a reset.

    I then tried to use the "create intel-hex" tool and program the device using the Luminary Micro flash programmer.  The program still doesn't run.

    I have attached the project so maybe you can see what I'm doing wrong.

     I'm getting a "No source available for "_c_int00() at 0x290"

    1351.CCSTrial.zip

     

    If there's more info I can give, I'll try.  I'm new to using CCS.

     

  • Hi Mark,

    the behaviour you see is expected.  I am not sure exactly what you are expecting?  Is free run a good option for you then.  Do the below explanations help?  Are you trying to debug?  Are you loading your code and connecting in CCS? (seems to be the case)


    CCS behaves as follows

    - by default when you launch the debugger it loads the codes and comes up halted at "Main".  This option can be changed or disabled.  For example if you diesable the option it comes up to the entry point (_c_int00) which is why you get the message you get.  You can change the symbol it runs to, and in fact if you put in a dummy or non existant symbol it will run forever.

    - free run sets the target running then disables all breakpoints and disconnects

    Best Regards,
    Lisa

  •  Thanks Lisa.

    You are correct in that I'm loading my code and connecting in CCS.  I'm glad it's expected CCS behaviour and not that I'm doing something wrong.

    What I'm trying to do is: once the unit is reset, I want the code to run.
    As in not having to run the debugger to have the code run on the eval board on subsequent power ups.

    I'm trying to make a datalogger to run overnight (using the SD slot and the ADC ports) and I don't want to have to have my computer hooked up to the board while it's running.

    Thanks for your help/patience :)

    -Mark

     

  • HI Mark,

    once code is loaded onto your chip, it should run and do whatever it has been programmed to do as long as it has power.    I am not sure why your data logger might require a debugger/debug session?

    Can you check what you have programmed/what settings you use for your reset interrupt vector?  Is there a reason you are trying to do this in a debugger? Are you still debugging code?

    Best Regards,
    Lisa

  • Thanks Lisa!

    I neglected to set up the interrupts (>_<) so it couldn't have done anything on reset.

    The debug mode is being used as I'm still debugging the ADC code.  I was trying to figure out why it wasn't running using the blink program as the problem was the same and I can see if the LED is blinking.

    You are both very patient and helpful.

  • HI Mark,

    no worries.  That's what we are here for.  Does this get you going then?

    Best Regards,
    Lisa

  • Yeah, I should be well on my way now.

    CCS/ARM is a much different beast than the PIC's I'm used to.

     

     

  • Hi Mark,

    great, glad to hear that that helped and all the best with development.

    Best Regards,
    Lisa