• AVR Freaks

Hot!MPLAB X IDE 5.20 Debug issue

Author
samrudha
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2017/10/30 01:53:29
  • Location: 0
  • Status: offline
2020/07/06 04:41:16 (permalink)
0

MPLAB X IDE 5.20 Debug issue

Hello guys, I am having a very strange problem.
I am using the ATSAME54P20A xplained pro board and developing firmware into MPLAB x IDE 5.20 (no other versions of IDE could compile my code) using HARMONY CONFIGURATOR 3 with compiler XC32. Code compiles and runs perfectly and gives the desired output also but when I start debugging the code and put a breakpoint to check the value of any variable or array, it shows null into the watch window. for example, if I write x=2(global) and check the value in debug it shows 0x00. If I put breakpoint into if statement saying x == 2, it halts at the breakpoint. Only the debug part is erroneous.
please help me out in finding the solution to this problem. It gets very difficult to debug the code this way.
#1

5 Replies Related Threads

    RISC
    Super Member
    • Total Posts : 5771
    • Reward points : 0
    • Status: offline
    Re: MPLAB X IDE 5.20 Debug issue 2020/07/06 04:59:24 (permalink)
    0
    Hi,
    If you use SAM parts I really encourage you to use the latest MPLAB X version as SAM parts are only supported since v5.00 so I guess many incremental changes / additions / fixes are done in each MPLAB X version (for SAM parts).
    The only software tool which prevents to can potentially prevent to compile is...the compiler...
    MPLAB X v5.40 has some quirks because this is the first 64bits version AND also uses OpenJava instead of Oracle Java, but MPLAB X v5.35 should work.
    Also use the latest XC32 version and Harmony version.
    However, if you want to use an existing project application in Harmony, it is essential to download exactly the software modules/components which were used to build it
    Regards

    For support make sure to check first here : http://microchipdeveloper.com
    There are hundreds of PIC, AVR, SAM...which one do YOU use ?
    #2
    ric
    Super Member
    • Total Posts : 27934
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: MPLAB X IDE 5.20 Debug issue 2020/07/06 06:05:53 (permalink)
    0
    samrudha. Code compiles and runs perfectly and gives the desired output also but when I start debugging the code and put a breakpoint to check the value of any variable or array, it shows null into the watch window. for example, if I write x=2(global) and check the value in debug it shows 0x00. If I put breakpoint into if statement saying x == 2, it halts at the breakpoint. Only the debug part is erroneous.please help me out in finding the solution to this problem. It gets very difficult to debug the code this way.

    This sounds like the typical misunderstanding of optimisation.
    Chances are the variable gets optimised away if you just load it with a constant.
    Try adding a "volatile" qualifier to the line that creates the variable.
    That creates less efficient code, but forces the compiler to always actually save the value to RAM.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    samrudha
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2017/10/30 01:53:29
    • Location: 0
    • Status: offline
    Re: MPLAB X IDE 5.20 Debug issue 2020/07/06 12:07:49 (permalink)
    0
    Thank you for your reply.
    I have tried to get the value of volatile variables, it's 0x00 all the time in debug. I assigned 0 to the optimization setting in XC32 compiler settings. 
    values are assigned to variables but do not reflect in debug. I was trying to code for the function which returns CRC of the passed array. Now I am not able to check the return value of the function as it shows 0x00 all the time.
    #4
    samrudha
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2017/10/30 01:53:29
    • Location: 0
    • Status: offline
    Re: MPLAB X IDE 5.20 Debug issue 2020/07/06 12:34:31 (permalink)
    0
    thank you for the reply.
    I am using X IDE version 5.20. I tried using other versions(5.10, 5.15, 5.30, and 5.40). My code compiles but throws an error when I try to program the ATSAME54P20A Xplained pro board.
    in version 5.20 which I am currently using, I downloaded the PACKS(in tools) updates for SAME54_DFP. after that, it again started to throw errors and did not program the board. So I had to uninstall the new updates of the packs and I could program the board. what I don't understand is, why the latest updates of the SAME54_DFP packs throw errors.
    #5
    RISC
    Super Member
    • Total Posts : 5771
    • Reward points : 0
    • Status: offline
    Re: MPLAB X IDE 5.20 Debug issue 2020/07/06 14:24:15 (permalink)
    0
    Hi,
    there are dependencies between compiler version, DFP packs, MPLAB X.
    Generally you need to follow the guidance from MPLAB X to select the right DFP pack.
    If you still have issues, open a ticket in Microchip official technical support.
    Regards
     

    For support make sure to check first here : http://microchipdeveloper.com
    There are hundreds of PIC, AVR, SAM...which one do YOU use ?
    #6
    Jump to:
    © 2020 APG vNext Commercial Version 4.5