• AVR Freaks

Hot!dsPIC33 the program crashes

Author
amctech
New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2019/02/20 09:58:46
  • Location: 0
  • Status: offline
2019/08/06 07:49:25 (permalink)
0

dsPIC33 the program crashes

Hello,
Something wrong is going with my program: periodically it resets: it returns to the break point before the main while.
Is it possible to know on which point exactly it crashes?
I am programming in MPLAB X IDE v5.15, xc16-gcc(v1.36)
#1

4 Replies Related Threads

    du00000001
    Just Some Member
    • Total Posts : 3161
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: dsPIC33 the program crashes 2019/08/06 07:58:32 (permalink)
    0
    I don't think the exact location can be located.
    But you may check the call stack, which might give you the location from which the last function call originated.
     
    BTW: might be way faster to check whether the watchdog is active.
     
    Another BTW: Nice to know which MPLAB X and compiler you're using. But on which derivative ?

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #2
    NKurzman
    A Guy on the Net
    • Total Posts : 17918
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: dsPIC33 the program crashes 2019/08/06 08:46:50 (permalink)
    0
    Do you have the exception Trap Handlers coded?
    Did you check the RCON register to see why it reset?
    #3
    amctech
    New Member
    • Total Posts : 19
    • Reward points : 0
    • Joined: 2019/02/20 09:58:46
    • Location: 0
    • Status: offline
    Re: dsPIC33 the program crashes 2019/08/06 23:43:30 (permalink)
    4 (1)
    Thanks to your help found a solution to the problem.
    There was in the Call Stack:
    -_DefaultInterrupt, LFE1, .isr...
    and then:
    -No source code lines were found at current PC 0x0. ...
    In the post [link=https://stackoverflow.com/questions/15490040/no-source-code-lines-were-found-at-current-pc-0x0]https://stackoverflow.com...ound-at-current-pc-0x0[/link] we read:
    "Your code execution is trying to execute code at address 0x00. It happens when you call a pointer to a function that was not initialized, which means, it holds the value 0".
    Finally: there was some #define in the code without any value (accidentally it has been erased). After entering a new value the program returns to work properly.
    Thanks to all participants for their help.
    #4
    JPortici
    Super Member
    • Total Posts : 813
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: dsPIC33 the program crashes 2019/08/07 00:41:55 (permalink)
    0
    I don't think you understood the issue, neither the guys at stackoverflow.
     
    address 0x00 is the reset vector.
    The debugger has halted at 0x00 because the debugger will halt on a reset by default. (you have to tell him NOT to halt on a device reset if you don't want it to)
     
    As you see on the call stack the last function called was DefaultInterrupt.
    Default interrupt is an ISR created automatically by the linker. Also, the linker will redirect all interrupts (and exceptions) that don't have an ISR written by you to the default interrupt.
    The Default Interrupt is usually just a Reset instruction.
    The default interrupt is also placed automatically, but you can tell the linker not to if you don't want to.
     
    You problem is that your program caused an interrupt (or an exception) that was unhandled. To determine which, check the status of the various CORCON,INTTREG, INTCONx and IFSx/IECx registers.
    Then solve the problem.
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5