• AVR Freaks

Hot!PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavailable.

Author
Johnny0099
Super Member
  • Total Posts : 157
  • Reward points : 0
  • Joined: 2015/06/20 00:33:20
  • Location: 0
  • Status: offline
2017/12/10 06:41:58 (permalink)
0

PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavailable.

I'm trying to debug a issue that causes periodically a MCU reset.
 
In debug mode, i'm getting only this information: "Runtime exception @ PC address 0x9d019b44. Function and line number unavailable. at  :0"
 
I'm not able to find this address anywhere in Execution Memory or in Disassembly Listing. The application that causes this problem is an AT UART comunication at 115.200 bps with an external WiFi Module. Application runs for 4-5 minutes at max speed (40 packets/sec) and 30/40 min with reduced speed (20 packets/sec).
 
I'm using Harmony 2.03b and PIC32MZ2048EFM100 MCU running at 50 Mhz. I've doublecheched all buffers, pointers, variables, but can't find any solution to this issue. Any suggestion on what to look at? Someone experienced the same problem?
 
Thanks,
CF
#1

18 Replies Related Threads

    BillP
    Super Member
    • Total Posts : 325
    • Reward points : 0
    • Joined: 2014/09/28 07:53:35
    • Location: CA
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 08:20:23 (permalink)
    0
    Go to the memory map and locate the routine that contains the 0x9d019b44 address.  Then single step or print to narrow down where the exception actually occurs.
    #2
    Johnny0099
    Super Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2015/06/20 00:33:20
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 08:38:17 (permalink)
    0
    Do you mean Execution Memory? I've done a search for this address and doesn't exist. Anyway, that address is not the same every time that the exception happens.
     
    Very Frustrated!
    #3
    BillP
    Super Member
    • Total Posts : 325
    • Reward points : 0
    • Joined: 2014/09/28 07:53:35
    • Location: CA
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 08:59:34 (permalink)
    0
    go to <projectname>.X.dist.<family>.production.<projectname.X.production.map
     
    Near the bottom of that file are the function addresses.  Find the one that includes 0x9d019b44.  This is probably in a library call.  BTW - isn't that address in NVM?  
    #4
    Johnny0099
    Super Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2015/06/20 00:33:20
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 09:08:23 (permalink)
    0
    This is what i've found:
     
    .text._IntHandlerDrvAdc 0x9d019b44          0x2d8         728
     
    .text._IntHandlerDrvAdcData12
    0x9d019b44 0x2d8
    .text._IntHandlerDrvAdcData12
    0x9d019b44 0x2d8 build/default/production/_ext/1688732426/system_interrupt.o
    0x9d019b44 _IntHandlerDrvAdcData12
     
    I've to run test again to check if the exception returns the same address.
    #5
    BillP
    Super Member
    • Total Posts : 325
    • Reward points : 0
    • Joined: 2014/09/28 07:53:35
    • Location: CA
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 09:35:26 (permalink)
    0
    It seems (to me) that the problem is in the ADC interrupt handler (setup, alignment, logic, ..?).  I have no knowledge in this area, so someone else will have to chime in here.  Good luck.
    #6
    Johnny0099
    Super Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2015/06/20 00:33:20
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 11:04:23 (permalink)
    0
    Thank you BillP for your help, I will investigate in ADC interrupt handler. Anyway, this problem happens also if I disable the ADC. I will do some more test with and without ADC enabled.
    #7
    NKurzman
    A Guy on the Net
    • Total Posts : 17713
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 12:13:19 (permalink)
    5 (1)
    Not disable the ADC. Disable the ADC interrupt. And insure it is still disabled if the exception happens.
    #8
    Johnny0099
    Super Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2015/06/20 00:33:20
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 12:15:11 (permalink)
    0
    Ok, I will disable all ADC interrupts and do some more test.
    #9
    Johnny0099
    Super Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2015/06/20 00:33:20
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 13:09:05 (permalink)
    0
    I'm suspecting that it's a malloc issue. The error address this time is 0x9d01ca08, and this is the memory map:
     
    .text.DRV_SPI_MasterEBM 0x9d01c610 0x29c 668
    .text.malloc 0x9d01c8ac 0x28c 652
    .text._powx 0x9d01cb38 0x284 644
     
    Malloc starts at 0x9d01c8ac. I'm using malloc to implement a double linked list. In a prevois test the error was in the Pop function of the queue. I'm doublecheching but can't find anything wrong.
     
    Any suggestion?
    #10
    NKurzman
    A Guy on the Net
    • Total Posts : 17713
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 13:14:33 (permalink)
    0
    Are you checking to see if malloc is out of memory and returning null pointers?
    #11
    Johnny0099
    Super Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2015/06/20 00:33:20
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 16:25:50 (permalink)
    0
    Yes, absoluterly. I'm using a wrapper (Zmalloc) that checks if malloc is returning a NULL pointer.
    #12
    DavidBLit
    Super Member
    • Total Posts : 1578
    • Reward points : 0
    • Joined: 2012/02/18 13:08:48
    • Location: The Land of Confusion
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/10 18:28:14 (permalink)
    0
    Johnny0099
    ... I'm using malloc to implement a double linked list. In a prevois test the error was in the Pop function of the queue. 
    ...

    Are your list and queue mechanisms interrupt-safe?

    Yeah, "//Code and stuff".
    #13
    Johnny0099
    Super Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2015/06/20 00:33:20
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/11 05:15:38 (permalink)
    0
    I'm using a busy flag that is set when an operation on the queue is ongoing (Insert, Delete, Pop, Seach) and is unset when operation is complete. This should prevent concurrent access to the queue. Don't know if that's enough.
     
    I'm actually getting exceptions that are pointing to:
    a) The Pop() function
    b) Malloc function
     
    As I can see, harmony is using dynamic allocation for buffer queue (USART, I2C, SPI). Is it possible that malloc fails due to concurrency?
    #14
    muellernick
    Super Member
    • Total Posts : 473
    • Reward points : 0
    • Joined: 2015/01/06 23:58:23
    • Location: Germany
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/11 06:09:49 (permalink)
    0
    I'm using a busy flag that is set when an operation on the queue is ongoing (Insert, Delete, Pop, Seach) and is unset when operation is complete. This should prevent concurrent access to the queue. Don't know if that's enough.

     
    Do you modify the linked list in an interrupt?
    If so, what does the flag serve for? You can't prevent the ISR from modifying the list.
    While you work on the list, you have to disable INTs **if** the ISR modifies the list.
     
    Also, the flag has to be volatile, you never know what the compiler decides to do with it.
     
    Nick
    #15
    Johnny0099
    Super Member
    • Total Posts : 157
    • Reward points : 0
    • Joined: 2015/06/20 00:33:20
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2017/12/11 06:38:35 (permalink)
    0
    Thanks Nick,
     
    I'm actually not modifying the list in any ISR, but I've a doubt about a System Timer Callback. Let me check if the problem can be there.
    #16
    gilo
    Starting Member
    • Total Posts : 35
    • Reward points : 0
    • Joined: 2010/08/12 06:04:47
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2018/07/23 01:40:29 (permalink)
    0
    Hi,
     
    Do you remember what was the solution for that error cause i am getting something simmilar.
     
    Thnaks,
     
    #17
    Djoe
    New Member
    • Total Posts : 1
    • Reward points : 0
    • Joined: 2019/06/18 23:09:28
    • Location: 0
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2019/06/23 23:43:19 (permalink)
    0
    Hello gilo,
     
    I have recently hit the same problem. 
     
    The source was an inexistant interrupt handler. I've get this bug after a merge betwen two version. I have simply forget to update the name of the interrupt handler function.
     
    My advise for you is to check if an IT is enabled without handler.You can also create all the interrupt handler funtions and see if the problem still occur
    #18
    moser
    Super Member
    • Total Posts : 504
    • Reward points : 0
    • Joined: 2015/06/16 02:53:47
    • Location: Germany
    • Status: offline
    Re: PIC32MZ: Runtime exception @ PC address 0x9d019b44. Function and line number unavaila 2019/06/27 03:24:07 (permalink)
    0
    If you think it could be a missing interrupt handler, then you can create a default interrupt handler _DefaultInterrupt() and check if this gets called. See MPLAB® XC32 C/C++ Compiler User’s Guide, 14.3 WRITING AN INTERRUPT SERVICE ROUTINE for more details.
     
    However, if the address is changing all the time, I would suspect something different, for example the stack gets corrupted or the return address gets overwritten. If you implement some exception handlers, you could get more information.
    #19
    Jump to:
    © 2019 APG vNext Commercial Version 4.5