• AVR Freaks

Hot!MPLABx v5 - Cannot edit debug watch variables since update??

Page: 12 > Showing page 1 of 2
Author
john_nohj
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2016/02/06 03:25:04
  • Location: 0
  • Status: offline
2018/08/31 07:02:42 (permalink)
0

MPLABx v5 - Cannot edit debug watch variables since update??

Hello,
 
Since updating to MPLABx v5 I cannot debug programs as I used to on v3.
 
I am working on a project for a PIC16F, and on previous versions of this software I could simulate the code, pause the debugger, and edit registers in the variables window, then continue running the code.
Now in v5 when I try to do this, the variable stay the same when I edit it then press enter.
 
Just to be clear: I am pausing the software first, and I cannot edit global variables or SFRs.
I used to be able to do this to edit any global variable or SFRs (e.g PORT) registers on the v3 software.
 
This is severely increasing the time it is taking me to debug at the moment, as I am having to do everything with the "stimulus" window, which does not work well for certain situations.
 
Can anyone advise me what I may need to change to get this working again in v5?
Any help is greatly appreciated!
#1

23 Replies Related Threads

    john_nohj
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2016/02/06 03:25:04
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/01 10:02:19 (permalink)
    0
    OK as a test I have made two copies of a PIC18F25K80 project I have had running on breadboard.
    In this project TRISC C0 & C1 are set as digital inputs.
    If I open copy 1 in MPLABx v3.55 with XC8 v1.41 I can edit the PORTC values in the simulator variables window as expected.
    If I open copy 2 in MPLABx v5.00 with XC8 v1.45 I can edit the PORTC values in the simulator variables window as expected.

    However, if I now open a PIC18F65K40 based project in MPLABx v5.00, then I cannot edit registers in the variables window.
    So at the moment this problems seems to depend on the PIC used, rather than the IDE....
    post edited by john_nohj - 2018/09/02 07:20:51
    #2
    Weydert
    Super Member
    • Total Posts : 483
    • Reward points : 0
    • Joined: 2008/07/02 04:22:40
    • Location: Aachen/Germany
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/02 03:25:05 (permalink)
    0
    Hi,
    I have a similar Problem:
    Created a Project in IDE 5.0 for the new Device dsPIC33CH128MP506 in Assembly.
    Could not change any of the Variables during Debugger (ICD3) hold.
    Possible sources of the Problem:
    - IDE 5.0  ?
    - new Device not supported?
    - Assembler support bad ?
    .....?
     
    Today created a Project for the same device but in IDE 4.2 , using the Simulator as debugger and Variables set in a c-File:
    Could change variables during Debugger hold
    Opened the same Project with IDE 5.0: could not change the Variables (after Project was "updated")
    Opened the same (updated) Project in IDE 4.2: Could change the Variables.
     
    So I don't know which Tool causes the Problem.
     
    edited:
    Meanwhile downloaded IDE 4.2 on the PC connected to the "real world" with ICD3. Opening my Project (dsPIC33CH128MP506 , ICD3, XC16 V1.35 , most Part of Project in Assembly ) in IDE 4.2 now lets me change Variables and SFRs in the Debug-Session again.
    So I think IDE 5.0 is the Problem
    post edited by Weydert - 2018/09/02 09:11:41
    #3
    john_nohj
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2016/02/06 03:25:04
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/03 01:28:49 (permalink)
    0
    I have been playing around with this a bit more....
    I have created a PIC18F65K80 project in MCC, and only peripherals I have set is RA0 & RA1 as inputs.
    So this project is as simple as I could get. I also added a global uint8_t which is just incremented in main(). There is nothing else going on.
     
    In this simple project I can edit the PORTA register, and global variable in the simulator variable window, as expected.
     
    Now if I open up a proper PIC18F65K80 project that I am working on I cannot edit anything in the variable window. This project has two timer interrupts, ADC, UART, and around 30 digital IO, all based on an MCC configuration.
     
    Could this be something set in MCC causing these issues?
     
    #4
    Mysil
    Super Member
    • Total Posts : 3325
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/03 02:34:14 (permalink)
    0
    Hi,
    Have observed the same issue for PIC32MK with MPLAB X v5.0 using XC32 v2.10.
     
        Mysil
    #5
    JeffADI
    New Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2018/08/24 17:24:38
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/04 12:49:25 (permalink)
    0
    I too cannot change variables during debugging.
    PIC32MX, XC32 1.42, MPLABX 5.0  on Windows10
    #6
    john_nohj
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2016/02/06 03:25:04
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/04 23:41:00 (permalink)
    0
    I am going back to MPLABx V3 for now. These problems are not happening on v3.
    #7
    JeffADI
    New Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2018/08/24 17:24:38
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/05 03:06:44 (permalink)
    0
    Is there a way to go back if your projects have been upgraded to v5?
    #8
    Jim Nickerson
    User 452
    • Total Posts : 6016
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/05 08:04:12 (permalink)
    0
    Maybe this plugin can help
    Attachments are not available: Download requirements not met

    Attachment(s)

    Attachments are not available: Download requirements not met
    #9
    Jim Nickerson
    User 452
    • Total Posts : 6016
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/05 08:06:09 (permalink)
    0
    Maybe you could compare the configurations.xml file with the previous version 4 files, I seem to recall a post saying there were minimal changes
    #10
    Steven37
    Super Member
    • Total Posts : 347
    • Reward points : 0
    • Joined: 2008/08/29 05:20:14
    • Location: South Australia
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/09/09 04:50:01 (permalink)
    0
    Just started an assembler project with a 16F1575 ( not supported by MPLAB v8.92 ) so I've started experimenting with MPLABx 5.05.
     
    I found I can edit watched variables in the simulator, but only if I edit the variable in the Value column.
     
    Steve
     
    EDIT :-  Just restarted MPLABx, I can now edit the variable in any of the display columns.
    post edited by Steven37 - 2018/09/09 05:35:38
    #11
    mmujumdar
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2018/04/23 16:27:06
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2018/10/08 11:19:07 (permalink)
    0
    The issue of editing variables during debugging in the 'Variables' window has been fixed in MPLAB X v5.05. This version can be downloaded from: http://www.microchip.com/mplab/mplab-x-ide
    #12
    meraviglioso
    Starting Member
    • Total Posts : 41
    • Reward points : 0
    • Joined: 2019/01/01 15:15:35
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2019/02/20 22:31:55 (permalink)
    0
    I believe this may still be an issue in v5.10.  I am not able to edit variable values in the debugger window.  I have 0 values in the window, change to 1, press enter. Instantly resets to 0.  This happens during run time as well as during a pause.
    #13
    qhb
    Superb Member
    • Total Posts : 9998
    • Reward points : 0
    • Joined: 2016/06/05 14:55:32
    • Location: One step ahead...
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2019/02/20 22:33:11 (permalink)
    0
    What PIC and debugger are you using?
    Most combinations can NOT change variables while running, only while paused.
     

    Nearly there...
    #14
    meraviglioso
    Starting Member
    • Total Posts : 41
    • Reward points : 0
    • Joined: 2019/01/01 15:15:35
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2019/02/21 07:04:56 (permalink)
    0
    QHB, Sorry for not clarifying but I am running strictly in the simulator right now.  I did state in my previous post that it does not work during runtime or during a pause.  I am currently simulating with a PIC 18F47J13.
    #15
    GeorgePauley
    Moderator
    • Total Posts : 1119
    • Reward points : 0
    • Joined: 2009/12/01 13:59:30
    • Location: Chandler AZ
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2019/02/21 08:29:03 (permalink)
    +3 (3)
    The simulator can be... "tricky" when attempting to change variables via the watch window.  The simulator is aware of the r/w characteristics of each register.  What can happen is user sets an SFR value in the watch window and the simulator looks at the new value and says "you can't write to these read-only bits" and rejects the write.  If one uses a physical device tool like ICD, it will LOOK like you can indeed write to these same SFRs, but you really can't.  The issue is that the ICD just performs the requested SFR write, but doesn't validate that the register has the new value via a read back.

    Along the same lines, another way the simulator can stop editing of the SFRs is via its peripheral support.  For example, imagine the TRIS register is set to outputs, and the user attempts to set the PORT register.  The simulator PORT peripheral will perform the requested write to PORT and then immediately update PORT based on the actual pin values.  So it appears that the user can't edit the PORT register.

    Finally, Stimulus (and SCL) will allow the user to do anything and completely ignores the r/w characteristics of the register.  The reasoning is that if you are using stimulus then you "know what you are doing".  Note that this means stimulus overcomes the r/w characteristics issue, but does not overcome the peripheral issue.
    #16
    Mysil
    Super Member
    • Total Posts : 3325
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2019/02/21 08:56:37 (permalink)
    0
    Hi,
    Don't complain that simulator mimic the real hardware!
     
    Edit: GeorgePauley submitted an excellent message while I was writing.
     
    This is with reference to message #2
    Beeing able to edit the value of PORTC, and see the register value change, is a bug in the simulator in older versions.
     
    In all PIC18 devices, and modern PIC16 devices, PORTC is a Read-Only register.
    Any write to PORTC go into LATC in the real hardware, so any change to PORTC should be visible in LATC instead.
    In wery old PIC16 devices there are also Output latches, but they are Write-Only registers, with no possibility for for the CPU or Debugger to read in hardware.
     
    What will happen with PORTC register, then depend upon TRISC and ANSELC registers:
        If ANSELC register is set to Analog mode, then digital input buffers in hardware are disabled,
            and PORTC values shall be 0.
        If ANSELC register is set to Digital mode, PORTC register shall show signal state on the pin:
            If TRISC register is set to all Inputs, PORTC shall Not change,
                value should still be the value of External signals in hardware, or Stimulus values in the simulator.
            If TRISC is set to all Outputs, then changes to LATC should be visible in PORTC register,
                unless the pin is shorted to Vss or Vdd, or is driven by another output in hardware.
    If individual pins have different settings in TRISC, ANSELC, or if other peripherals are enabled,
    then each bit in PORTC register should respond accordingly.
     
    This message is based upon how hardware is supposed to work.
    Different versions of the simulator and debugger may have different bugs or limitations,
    so unless you specify what version of MPLAB X is used,
    and precisely describe what register you study, and what settings have been done in other registers,
    then it is impossible to understand if the simulator is at fault, or if the simulator is showing the effect of a user or program mistake.
     
        Mysil
    post edited by Mysil - 2019/02/21 09:23:29
    #17
    meraviglioso
    Starting Member
    • Total Posts : 41
    • Reward points : 0
    • Joined: 2019/01/01 15:15:35
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2019/02/21 21:18:18 (permalink)
    0
    I was not attempting to modify any tris, ansel, port or sfr registers.  I am simply trying to set a boolean variable as true.  It is a global variable declared within the header file and I see no reason in the code preventing it from being modified.  It is not just this specific variable, it is any variable that is displayed in the variables window while stepping through the code.  I don't know what code I can share that would be useful so I will refrain from posting any unless specifically requested in an attempt to keep this clean.
     
    MPLAB X IDE v5.10
    Java 1.8.0_181

    Attachment(s)

    Attachments are not available: Download requirements not met
    #18
    GeorgePauley
    Moderator
    • Total Posts : 1119
    • Reward points : 0
    • Joined: 2009/12/01 13:59:30
    • Location: Chandler AZ
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2019/02/22 09:36:22 (permalink)
    0
    I just wrote a simple program and ran it in MPLAB X 5.10.  I was able to change variables with no problems.

    #include <xc.h>

    unsigned char tempInt;

    int main(int argc, char** argv)
        {
        tempInt = 0;
        while (tempInt == 0)
            asm("nop");
        while (1);
        return (0);
        }

    #19
    meraviglioso
    Starting Member
    • Total Posts : 41
    • Reward points : 0
    • Joined: 2019/01/01 15:15:35
    • Location: 0
    • Status: offline
    Re: MPLABx v5 - Cannot edit debug watch variables since update?? 2019/02/22 10:24:42 (permalink)
    0
    GeorgePauley
    I just wrote a simple program and ran it in MPLAB X 5.10.  I was able to change variables with no problems.

     
    #include <xc.h>

    unsigned char tempInt;

    int main(int argc, char** argv)
        {
        tempInt = 0;
        while (tempInt == 0)
            asm("nop");
        while (1);
        return (0);
        }
     



    Thanks for confirming George.  I have found one variable in my program that I can manually update.  I still don't see any reason why the others wont allow me to change them.  The variable that I can update doesn't seem any different than the others that it wont allow me to update.  I understand the earlier comment about the SFR being read only but as a beginner to this platform I am struggling to grasp why the simulator is seeing my variables as read only (or whatever other reason is preventing the edit).  Could you lend me some info as to where I should be looking in my code or what conditions may cause this?  I know this is a pretty generic question and if sharing some of my code will help please let me know.
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5