• AVR Freaks

Hot!No source code lines were found at current PC 0x0

Page: 12 > Showing page 1 of 2
Author
melvinpmathew
New Member
  • Total Posts : 21
  • Reward points : 0
  • Joined: 2020/03/19 08:25:06
  • Location: 0
  • Status: offline
2020/07/13 10:31:05 (permalink)
0

No source code lines were found at current PC 0x0

I had a project running fine - debugging, out of nowhere I start getting this error :
 
No source code lines were found at current PC 0x0. Open program memory view to see instruction code disassembly
 
 
any idea whats going on?
 
Restarted IDE, Programmer, PC - still no effect. 
 
 
#1

22 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6715
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 10:38:35 (permalink)
    0
    My crystal ball says "the Pic reset ( PC 0x0 )"
    #2
    Jim Nickerson
    User 452
    • Total Posts : 6715
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 10:39:35 (permalink)
    +2 (2)
    If in debug mode and the Pic resets the debugger is started and there are no C source lines at 0
    #3
    melvinpmathew
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2020/03/19 08:25:06
    • Location: 0
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 13:36:45 (permalink)
    +1 (1)
    But , it was all working fine just minutes ago. I'm so confused.
    #4
    crennolet
    Super Member
    • Total Posts : 202
    • Reward points : 0
    • Joined: 2012/03/15 09:51:58
    • Location: 0
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 15:02:07 (permalink)
    0
    What processor?
    #5
    melvinpmathew
    New Member
    • Total Posts : 21
    • Reward points : 0
    • Joined: 2020/03/19 08:25:06
    • Location: 0
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 15:36:32 (permalink)
    0
    dsPIC33EP512gm706
    #6
    crennolet
    Super Member
    • Total Posts : 202
    • Reward points : 0
    • Joined: 2012/03/15 09:51:58
    • Location: 0
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 15:55:31 (permalink)
    +1 (1)
    OK. The odds-on favorite for your circumstance is a memory access fault (such as trying to access a word variable at an odd address, for example) that generates an unhandled exception. Sadly, I haven't done anything much with this architecture, and that's the limit of my advice.
    #7
    Jim Nickerson
    User 452
    • Total Posts : 6715
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 16:01:08 (permalink)
    0
    Is an exception handler available ?
    dsPic33 is not something I use.
    #8
    dan1138
    Super Member
    • Total Posts : 3717
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 16:21:38 (permalink)
    +4 (4)
    I cannot tell from a brief glance at the data sheet if the dsPIC33EP512GM706 has ECC flash.
     
    If it does then my favorite trap for new players is when a program word is written that was not erased.
     
    This corrupts the ECC check word and will cause an ECC error trap when this location is accessed for any reason.
     
    I have yet to see a Microchip In-Circuit-Debug tool that can deal with this.
     
    To recover requires that the device be erased.
     
    It took me over a week to figure this out the first time.
    post edited by dan1138 - 2020/07/13 19:48:53
    #9
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3984
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 16:45:32 (permalink)
    0 (2)
    We don't know if he is doing that but ECC memory is 48bits wide
    and must be aligned on a 48bit boundry.
     
    Try this:
    When a trap occurs CORCON, INTCON (1 - 4) and INTTREG
    are printed to a terminal such as PuTTY.
     
    qhex(CORCON, 4, 0);
     
    This function prints out 4 digits of hex, not  justified.
    (Easy to replace)
    // ----------------------------------------------------
    // ----------------------------------------------------
    void getintcon(){
        const char *txticon = "INTCON";
        
        qputs("CORCON", 0);  qhex(CORCON, 4, 0); qputc(0xd);
        qputs(txticon, 0);   qputc(0x31); qhex(INTCON1, 4, 0); qputc(0xd);
        qputs(txticon, 0);   qputc(0x32); qhex(INTCON2, 4, 0); qputc(0xd);
        qputs(txticon, 0);   qputc(0x33); qhex(INTCON3, 4, 0); qputc(0xd);
        qputs(txticon, 0);   qputc(0x34); qhex(INTCON4, 4, 0); qputc(0xd);
        qputs("INTTREG", 0); qhex(INTTREG, 4, 0); qputc(0xd);
    }
    // ----------------------------------------------------
    // ----------------------------------------------------
    void __attribute__((interrupt, no_auto_psv)) _StackError(void){
        qputs("#TRAP: STACK\r", 0);
        getintcon();
        for(;;);
    }
    // ----------------------------------------------------
    // ----------------------------------------------------
    void __attribute__((interrupt, no_auto_psv)) _MathError(void){
        qputs("#TRAP: MATH\r", 0);
        getintcon();
        for(;;);
    }
    // ----------------------------------------------------
    // ----------------------------------------------------
    void __attribute__((interrupt, no_auto_psv)) _AddressError(void){
        qputs("#TRAP: ADDRESS\r", 0);
        getintcon();
        INTCON1bits.ADDRERR = 0;
        for(;;);
    }
    // ----------------------------------------------------
    // ----------------------------------------------------
    void __attribute__((interrupt, no_auto_psv)) _OscillatorFail(void){
        qputs("#TRAP: OSCILLATOR\r", 0);
        getintcon();
        INTCON1bits.OSCFAIL = 0;
        for(;;);
    }
    // ----------------------------------------------------
    // ----------------------------------------------------


    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #10
    atferrari
    Super Member
    • Total Posts : 1446
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: online
    Re: No source code lines were found at current PC 0x0 2020/07/13 19:43:35 (permalink)
    0
    I get the same when I start the simulator with MPLAB 5.40. The Program Memory window shows the PC in 0000 and there is code.
    Raised a ticket; waiting for a reply.

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #11
    GlennP
    Super Member
    • Total Posts : 780
    • Reward points : 0
    • Joined: 2009/03/29 15:04:55
    • Location: El Paso County, CO, USA
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 21:42:15 (permalink)
    0
    atferrari
    I get the same when I start the simulator with MPLAB 5.40. The Program Memory window shows the PC in 0000 and there is code.  Raised a ticket; waiting for a reply.



    I've used the simulator on a closely related chip (dsPIC33EP64MC202) and except for an obscure bug WRT Idle-mode it seems to work acceptably.  I'm not saying there is no problem with Simulator using the OP's chip, just that the simulator is not totally hosed for that architecture.
     
    Edit1: I'm using an MCC-generated main.  Is it possible the main declaration is missing something?
     
    GP
    post edited by GlennP - 2020/07/13 21:54:51
    #12
    LdB_ECM
    Super Member
    • Total Posts : 404
    • Reward points : 0
    • Joined: 2019/04/16 22:01:25
    • Location: 0
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/13 22:13:03 (permalink)
    0
     Close the Memory View debug window ,... then try again :-)
    #13
    friesen
    Super Member
    • Total Posts : 2148
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/14 05:21:26 (permalink)
    0
    Make sure you don't have a hardware issue, like power supply glitching from ? Transmitting ?  Turning on something?

    Erik Friesen
    #14
    GeorgePauley
    Moderator
    • Total Posts : 1261
    • Reward points : 0
    • Joined: 2009/12/01 13:59:30
    • Location: Chandler AZ
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/14 08:07:18 (permalink)
    +3 (3)
    Lot's of suggestions.  I thought I'd chime in and try to explain what the debugger is trying to tell you.  It makes the suggestions make much more sense :)

    To begin with, the message is not an error, rather it is just informative.  It is telling you that your PIC device has halted at address 0.  To be clear, halted is a debugging term, not a hardware term, it means the debugger has stopped execution of your application software.  But the device is still powered, and ready to resume execution.

    One of the things that MPLAB does is map physical hardware addresses with specific lines of code in your source files.  This is how the little green arrow gets put at the correct spot.  Unfortunately, address 0 doesn't map to any of your source file lines.  So MPLAB doesn't know where to put the green arrow.  This is what the message is trying to tell you.

    There are two major ways we end up halting at address 0.  The first is we tell MPLAB to do so, via the MPLAB settings.  The second is that the PIC device has undergone a reset, or an interrupt that doesn't have a handler.  For example, a watchdog timer expiration, power fluctuation, divide by 0, invalid address, etc.  I don't remember the details for your particular device, but I feel pretty confident that there should be a set of registers you can read after the reset that will tell you exactly what went wrong.
    #15
    atferrari
    Super Member
    • Total Posts : 1446
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: online
    Re: No source code lines were found at current PC 0x0 2020/07/14 08:37:45 (permalink)
    0
    GeorgePauley
    Lot's of suggestions.  I thought I'd chime in and try to explain what the debugger is trying to tell you.  It makes the suggestions make much more sense :)

    To begin with, the message is not an error, rather it is just informative.  It is telling you that your PIC device has halted at address 0.  To be clear, halted is a debugging term, not a hardware term, it means the debugger has stopped execution of your application software.  But the device is still powered, and ready to resume execution.

    One of the things that MPLAB does is map physical hardware addresses with specific lines of code in your source files.  This is how the little green arrow gets put at the correct spot.  Unfortunately, address 0 doesn't map to any of your source file lines.  So MPLAB doesn't know where to put the green arrow.  This is what the message is trying to tell you.

    There are two major ways we end up halting at address 0.  The first is we tell MPLAB to do so, via the MPLAB settings.  The second is that the PIC device has undergone a reset, or an interrupt that doesn't have a handler.  For example, a watchdog timer expiration, power fluctuation, divide by 0, invalid address, etc.  I don't remember the details for your particular device, but I feel pretty confident that there should be a set of registers you can read after the reset that will tell you exactly what went wrong.




    Sorry George but in my case, MPLABX shows that there is code and it knows where to put the green arrow. As I said when I opened the ticket, contradictory at least. A change of the wording maybe?
     

    Attachment(s)

    Attachments are not available: Download requirements not met

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #16
    Jim Nickerson
    User 452
    • Total Posts : 6715
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/14 08:46:34 (permalink)
    +3 (3)
    atferrari
    GeorgePauley
     
    One of the things that MPLAB does is map physical hardware addresses with specific lines of code in your source files.  



    Sorry George but in my case, MPLABX shows that there is code and it knows where to put the green arrow. As I said when I opened the ticket, contradictory at least. A change of the wording maybe?
     

    Are there source files open in "your" project relating to code at 0 ?
    #17
    atferrari
    Super Member
    • Total Posts : 1446
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: online
    Re: No source code lines were found at current PC 0x0 2020/07/14 09:05:58 (permalink)
    0
    JANickerson
    atferrari
    GeorgePauley
     
    One of the things that MPLAB does is map physical hardware addresses with specific lines of code in your source files. 

     
    Sorry George but in my case, MPLABX shows that there is code and it knows where to put the green arrow. As I said when I opened the ticket, contradictory at least. A change of the wording maybe?
     

    Are there source files open in "your" project relating to code at 0 ?


    Understand that "open" means that I can see the code. If so, yes. Also the Debugger is launched, ready to start, with PC reset to address 0000.  See below.
     
    post edited by atferrari - 2020/07/14 10:02:46

    Attachment(s)

    Attachments are not available: Download requirements not met

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #18
    Jim Nickerson
    User 452
    • Total Posts : 6715
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: No source code lines were found at current PC 0x0 2020/07/14 09:12:47 (permalink)
    0
    Is the "open" file one that you created by typing ?
    #19
    atferrari
    Super Member
    • Total Posts : 1446
    • Reward points : 0
    • Joined: 2004/07/08 13:09:24
    • Location: Buenos Aires - Argentina
    • Status: online
    Re: No source code lines were found at current PC 0x0 2020/07/14 10:05:32 (permalink)
    0
    Yes Jim that one. Assembly in my case - pic-as 2.20.
     
    Had to attach again the screen capture. You can see it there.

    Agustín Tomás

    In theory, there is no difference between theory and practice. In practice, however, there is.

    http://cablemodem.fibertel.com.ar/atferrari/
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5