• AVR Freaks

Hot!Unable to Read Device Memory

Author
JuliaDee
Super Member
  • Total Posts : 187
  • Reward points : 0
  • Joined: 2009/05/04 13:51:40
  • Location: Connecticut
  • Status: offline
2020/02/10 18:07:14 (permalink)
0

Unable to Read Device Memory

I'm working with the 24FJ256GA705 family, using MPLAB X 5.30 and also tried 3.55. When I click on the Read Device Memory icon, either the little one on the Program Memory window or the big one up on the toolbar, the IDE progress indicator shows some activity, but the program memory display never updates to show the new program memory contents after I've executed an erase or programming sequence. I expect that this command should update the Program Memory display to show the current contents of the device program memory (as "Debug Read" used to do in the old MPLAB IDE) - is that expectation wrong?
 
I know that the device memory has changed, because I have a routine that copies a block to RAM, and there I can see that my erase operation succeeded, but the Program Memory window never changes.
 
Julia

"Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
#1

14 Replies Related Threads

    davekw7x
    Entropy++
    • Total Posts : 1849
    • Reward points : 0
    • Joined: 2012/01/16 12:01:07
    • Location: Second star on the right, straight on till morning
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/10 20:01:08 (permalink)
    +1 (1)
    JuliaDee
    ... 24FJ256GA705.. When I click on the Read Device Memory icon...the program memory display never updates to show the new program memory contents

    You forgot to tell us what debugging tool you are using.  It might (or, maybe, not) make a difference.

    Anyhow...

    I can tell you that on my system the "Read Device Memory" function works as expected.  (MPLABX version 5.30 on Windows 10 Professional, PIC24FJ256GA7 Curiosity Board)

    JuliaDee
    ...I know that the device memory has changed...


    To test without depending on my sure knowledge of whether (or not) the program memory has changed, here's what I would do (assuming you have previously programmed your device):


    1. Exit MPLABX IDE.
    2. Invoke MPLABX again.
    3. Create a new PIC24FJ256GA705 project and view the "Program Memory" pane.  You should see all FFFFFF entries.  Don't add any files;  don't try to compile; don't try to run the debugger; don't try ANYTHING else.
    4. Click the Up Arrow (Read Device Memory) icon on the  main toolbar.
    5. See if anything has changed in the view of Program Memory.

    For example:
    Is there anything other than FFFFFF in location zero?  (Mine shows goto 100, YMMV.)


    Regards,

    Dave


    post edited by davekw7x - 2020/02/10 20:36:51

    Attachment(s)

    Attachments are not available: Download requirements not met

    Sometimes I just can't help myself...
    #2
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/10 20:37:19 (permalink)
    0
    I'm using an ICD3 and running MPLAB X in Windows 10, sorry for forgetting to mention that.
     
    I don't believe my IDE ever shows an Output pane like that of your screenshot "OutputFromRead". The progress bar at the bottom goes quickly from "empty" to "full", but I think if that Output pane had displayed I'd have noticed it.
     
    I'll try the test you suggest tomorrow and report the results. Good to know that the system can in fact work and that the problem is only with my setup, thanks!

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #3
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 08:22:39 (permalink)
    0
    I did your experiment with an empty project and it read the device properly as you described. All ones before reading and after reading, my code from the device is there.
     
    Going back to my project, I had a look at the ICD output pane which I'd neglected before in my focus on the Program Memory pane, and looky what's there after attempting a device memory read:
     

     
    No idea why it's failing, and the error message doesn't seem to provide any clues. I have no memory protection enabled in either config bits or project settings - project settings are all default.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #4
    KTrenholm
    Super Member
    • Total Posts : 783
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 08:29:58 (permalink)
    0
    What a wonderfully descriptive error message LoL: LoL
     
    This might be a silly suggestion, but have you tried a disconnect/reconnect/reboot of the PC?  I've had an embarrassing number of ICD issues clear up after rebooting/reconnecting after wrestling with them for ages wondering what's wrong.  Although you appear to be able to attach and debug...
    #5
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 08:34:05 (permalink)
    0
    KTrenholm
    What a wonderfully descriptive error message LoL: LoL
     
    This might be a silly suggestion, but have you tried a disconnect/reconnect/reboot of the PC?  I've had an embarrassing number of ICD issues clear up after rebooting/reconnecting after wrestling with them for ages wondering what's wrong.


    Yes, the ICD has always been flaky :( I'll try a PC reboot now.
     
    I did just try a different ICD3, with the same result.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #6
    KTrenholm
    Super Member
    • Total Posts : 783
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 08:38:38 (permalink)
    0
    Hmm, I wonder if there's some issue when reading device memory while debugging.
    This person here appears to have the same problem, and "resolved" it by exiting the debugger.
     
    Of course this doesn't do much for someone looking to see program memory at a specific time during debugging.
     
    Maybe as a workaround drop a while(1); after your block copy to lock it in place then do a read after exiting the debugger?
    #7
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 08:42:10 (permalink)
    0
    Ugh, that would make debugging something like a bootloader rather tedious, to say the least. Unfortunately the old MPLAB doesn't support the GA7xxx family.

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #8
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 09:06:40 (permalink)
    0
    Same result after a reboot, and same result with a GA704 as with the GA702 target I've been working with. I'll try a fresh install on a different computer, and if no joy file a ticket.
     
    Yes, the person in the other thread reported the same error message, so I'm not alone. The fact that the ICD says:
     
    "Reading the device while in debug mode may take a long time..." makes me think that it's not meant to be necessary to exit the debugger (plus it would be very silly).
     
     
     

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #9
    KTrenholm
    Super Member
    • Total Posts : 783
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 09:07:02 (permalink)
    0
    FWIW, I just fired up my ICD3 debugging my current PIC24FV16KM202 project and was able to read program memory after hitting a breakpoint.
     
    I DID find that the "Read Device Memory" button was greyed out until I re-selected the Format dropdown.  After that, though, no trouble reading.  What are you using for your clock/how are you powering the device?  I'm using a 16MHz Crystal Oscillator and externally powering the PIC.
    #10
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 09:15:52 (permalink)
    0
    KTrenholm
    FWIW, I just fired up my ICD3 debugging my current PIC24FV16KM202 project and was able to read program memory after hitting a breakpoint.
     
    I DID find that the "Read Device Memory" button was greyed out until I re-selected the Format dropdown.  After that, though, no trouble reading.  What are you using for your clock/how are you powering the device?  I'm using a 16MHz Crystal Oscillator and externally powering the PIC.


    Yes, I'm 98% sure I've been able to read device memory while in the debugger using the FJ128GA204 in the past; this issue may be specific to the GA7xxx + ICD3 combination, since Davekw7x's reply seems to say that his setup works with a GA7xxx and a Curiosity Board.
     
    My target uses an 8MHz resonator and 4x PLL for Fcy = 16MHz. Powered from a locally-regulated 3.3V supply derived from the mains. The product has been in production for a year - I don't think there are any supply issues.
     
    I can corroborate that the small upload arrow on the Program Memory pane is often greyed out, but I hadn't noticed that using the Format drop-down enables it, so thanks for that :)

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #11
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/11 09:38:11 (permalink)
    0
    Same error with MPLAB X 5.25 under MacOS 10.13.
     

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #12
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/17 07:48:11 (permalink)
    0
    It turns out that this is a known issue with ICD 3 and the GA7 family. I don't see a similar issue listed for the ICD 4, so I guess I'll be buying one of those.
     


    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #13
    KTrenholm
    Super Member
    • Total Posts : 783
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/17 07:55:06 (permalink)
    0
    JuliaDee
    It turns out that this is a known issue with ICD 3 and the GA7 family. I don't see a similar issue listed for the ICD 4, so I guess I'll be buying one of those.

     
    You could probably save some $$$ by trying a PicKit4 instead.  Unless you were looking for an excuse to get an ICD4 anywaymr green
    #14
    JuliaDee
    Super Member
    • Total Posts : 187
    • Reward points : 0
    • Joined: 2009/05/04 13:51:40
    • Location: Connecticut
    • Status: offline
    Re: Unable to Read Device Memory 2020/02/17 07:59:47 (permalink)
    0
    Thanks - already ordered an ICD 4, as I try to never skimp on tools Smile: Smile

    "Given one hour in which to chop down a tree, I'd spend the first 30 minutes sharpening my axe" - Abraham Lincoln
    #15
    Jump to:
    © 2020 APG vNext Commercial Version 4.5