Hot!Reading EEPROM with ICD3?

Page: 12 > Showing page 1 of 2
Author
SpokaneNexus
Super Member
  • Total Posts : 362
  • Reward points : 0
  • Joined: 2013/02/05 14:53:25
  • Location: 0
  • Status: offline
2018/03/12 13:14:06 (permalink)
0

Reading EEPROM with ICD3?

In a debugging session, what's the magic to accurately displaying the EEPROM contents using an ICD3 and MPLAB X? I use Window / PIC Memory Views / EE Data Memory and it brings up a nice window. As I step along my code writes some new values, reads them back and compares them for validity, then I close and reopen Window / PIC Memory Views / EE Data Memory and it shows the old values. Or all FF's. Or whatever.
 
In other words, my code is working fine but I can't examine the contents of EEPROM using the debugger. I haven't dared try to modify the EEPROM using the ICD3... if it can't READ it properly, who knows what would happen if it tried to WRITE it.
 
I searched this subforum for "EEPROM" and it reported zero results, so apparently I'm the very first person ever in history to have this problem.  {/sarcasm}
 
Any tricks, tips, or tribal lore to doing this? Thanks!
#1

25 Replies Related Threads

    KTrenholm
    Super Member
    • Total Posts : 382
    • Reward points : 0
    • Joined: 2012/08/08 14:04:23
    • Location: Connecticut, USA
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 13:30:36 (permalink)
    0
    So I made a post with a helpful little screenshot, but it doesn't seem to want to show up in the thread (for me at least).
    There should be a button in the top left of the EE Data Memory view to read the EEPROM data from the attached PIC.  If my post eventually shows up there will be a little screenshot showing it.
     
     
    #2
    mbrowning
    Just a Member
    • Total Posts : 876
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 13:34:12 (permalink)
    0
    EEPROM and FLASH do not update automatically. You need to click the green uparrow to read them. Unfortunately, MPLAB-X doesn't seem to support this during debugging, so you have to exit the debugger and then update EEPROM and FLASH.
     
    Not great but at least possible.

    Can't remember. I've slept since then - Mark
    #3
    jtemples
    Super Member
    • Total Posts : 10682
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 13:36:48 (permalink)
    0
    Any sort of read or write operation is going to reset the PIC anyway, so it would be pointless to support it in debug mode.
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 15722
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 13:38:41 (permalink)
    +1 (1)
    Suppport during debugging depends on the type of pic. Since functionality is now split between MPLabX and IPE you may need to use both programs to get the same functionality that MPLab had.
    #5
    SpokaneNexus
    Super Member
    • Total Posts : 362
    • Reward points : 0
    • Joined: 2013/02/05 14:53:25
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 14:18:38 (permalink)
    0
    KTrenholmThere should be a button in the top left of the EE Data Memory view to read the EEPROM data from the attached PIC.  If my post eventually shows up there will be a little screenshot showing it.

    Thank you! I've seen that button but when debugging it's greyed out. I will try it again when back in the debugger.
     
    Unbelievably strange that they'd disable the ability to read memory while debugging - especially DATA memory. I can sort of understand perhaps not being able to interact with the flash, but the EEPROM?
    #6
    SpokaneNexus
    Super Member
    • Total Posts : 362
    • Reward points : 0
    • Joined: 2013/02/05 14:53:25
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 14:20:33 (permalink)
    0
    NKurzmanSuppport during debugging depends on the type of pic. Since functionality is now split between MPLabX and IPE you may need to use both programs to get the same functionality that MPLab had.

    Huh? How does IPE allow you to debug live code?
     
    Maybe I'm not being clear. What I want to do is be able to single step (or run with HW breakpoints) through code that interacts with the EEPROM, and be able to examine the EEPROM in real time, between lines of the code, to confirm how the code is interacting with it. I can't reset the PIC, or switch to a different application, when single stepping.
     
    I don't think this is asking a lot for embedded development.
    #7
    jtemples
    Super Member
    • Total Posts : 10682
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 14:27:04 (permalink)
    0
    I can sort of understand perhaps not being able to interact with the flash, but the EEPROM?

     
    EEPROM is not like RAM.  You can't just read it with a read cycle; it requires code executing on the PIC.  The tools will read EEPROM the same way they read flash.  I suspect it would be fairly involved for the EEPROM window to be "live" during debugging.
     
    You'll have to find another means, like dumping the EEPROM contents to a UART, etc.
    post edited by jtemples - 2018/03/12 14:33:02
    #8
    qɥb
    Monolothic Member
    • Total Posts : 2067
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: online
    Re: Reading EEPROM with ICD3? 2018/03/12 14:29:28 (permalink)
    +1 (1)
    SpokaneNexus
    ...
    Maybe I'm not being clear. What I want to do is be able to single step (or run with HW breakpoints) through code that interacts with the EEPROM, and be able to examine the EEPROM in real time, between lines of the code, to confirm how the code is interacting with it. I can't reset the PIC, or switch to a different application, when single stepping.
     
    I don't think this is asking a lot for embedded development.

    Unfortunately, that is precisely what the PK3 and ICD3 cannot do.
    The method they use to read FLASH or EEPROM is to put the chip into programming mode, which requires a reset, losing all the debugging context.
    Conceivably, the debug monitor code placed into the PC could be extended to add an EEPROM read function, but on many PIC devices that would require using the EEPROM access registers, potentially disrupting any code being debugged which also used those registers.
     
    When developing this sort of code, I don't bother with the debugger interface, just output my own debugging to serial port, where I can do what I want.
     
     

    PicForum "it just works"
    #9
    du00000001
    Just Some Member
    • Total Posts : 1724
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 14:42:39 (permalink)
    0
    It may be considered tiring, but it is possible to read EEPROM data during debugging:
    • The "issue" is that EEPROM is not memory-mapped like flash and RAM.
    • Thus you have to follow the same procedure as your code - even more:
    • First read (and memorize the address currently stored in EEADDR
    • The write the address of interest to EEADDR
    • Issue the read command
    • Inspect the data in EEDAT. Unless you disabled the peripheral clock during debug, this value will be available "immediately" after issuing the read command.
    • Don't forget to restore EEADDR prior letting the core continue normal execution.
    • Provided you're not interrupt'ed, there should be no need for a reset.
    BTW: there's a lot more doable once you switch to the tedious task of writing and reading peripheral registers with the debugger. But quite rewarding as the setup of "anything static" can be developed/debugged this way.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #10
    SpokaneNexus
    Super Member
    • Total Posts : 362
    • Reward points : 0
    • Joined: 2013/02/05 14:53:25
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 14:45:23 (permalink)
    0
    jtemplesEEPROM is not like RAM.  You can't just read it with a read cycle; it requires code executing on the PIC.  The tools will read EEPROM the same way they read flash.  I suspect it would be fairly involved for the EEPROM window to be "live" during debugging.

    Yes, I understand how flash works. I don't expect it to update in real time, just as the Variables window doesn't update Watch variables while code is executing. But when you manually stop execution, or hit a breakpoint, the Variables window is updated. Likewise, the debugger could cause the DUT to execute EEPROM read code and update the EEPROM window. The spec sheet says it takes one cycle to read a byte; say we allow a total of 50 cycles per byte. With 1K of EEPROM that's 50K cycles... there'd be no noticeable delay as you come out of real time execution. Heck, the ICD3 already has a 1-2 second delay switching from "run" to "halt", what's another (let's be insanely generous) 100mS to update the EEPROM window if it's displayed?
     
    A guy can dream....
    #11
    du00000001
    Just Some Member
    • Total Posts : 1724
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 14:57:28 (permalink)
    0
    You could start writing your own debugger or help evolving gdb. Provided your dreams are large enough. Then you will find out soon that this job isn't done with 50 k cycles: there's more to do - with as little memory (RAM) impact as possible as (nearly) all the RAM is supposed to be under control of tze application.
    Your task: do much, but don't use any resources.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #12
    NKurzman
    A Guy on the Net
    • Total Posts : 15722
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 16:02:44 (permalink)
    0
    Still no Part Number?  Older PICs did not have the ability to read Flash or EEPROM while debugging.  Many Newer ones can.  However it was noted by George Pauly that Not all that that could read without ending a debug session could.  Additional there may be limitations based on the Debugger.  The Grayed out read says it is not supported in your combination.
    I added the Note about IPE because MPlabX will not let you change an eeprom or flash value.  Mplab did.
    You may need it.
    #13
    SpokaneNexus
    Super Member
    • Total Posts : 362
    • Reward points : 0
    • Joined: 2013/02/05 14:53:25
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 16:27:18 (permalink)
    0
    NKurzmanStill no Part Number?

    Sorry: PIC18F25K80
    #14
    NKurzman
    A Guy on the Net
    • Total Posts : 15722
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 16:47:49 (permalink)
    0
    That seems new enough.  And the ICD3 would be higher end. So if the Button is grayed out it either can't or MPlabX thinks it can't.  You could try a Cross post to the MPlabX forum and ask if the Chip can be read during a debug session, and it is an MPlabX issue, or it can't.  either way it does not help you now.
    #15
    SpokaneNexus
    Super Member
    • Total Posts : 362
    • Reward points : 0
    • Joined: 2013/02/05 14:53:25
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 16:54:47 (permalink)
    0
    NKurzmanThat seems new enough.  And the ICD3 would be higher end.

    My assessment as well.
     
    Don't have time to debug Microchip's IDE and hardware for them right now {grin}, so I'm working through it blindly. Just irritating, and seems fixable since Microchip controls every piece of this particular puzzle.
    #16
    Ken_Pergola
    Super Member
    • Total Posts : 2097
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 17:27:23 (permalink)
    +1 (1)
    Hi everyone,
     
    There appears to be some confusion and incorrect information in this thread.
    Let me try to clarify things a bit (with the caveat that this information is coming from the best of my recollection):
     
    Using MPLAB X IDE and the MPLAB ICD 3 or MPLAB REAL ICE tools:
    A lot of 8- 16- and 32-bit parts can read flash memory in a debug session (debug mode) without resetting the part via an explicit read operation by the user in a debug session.
     
    If you look at the 'Debug Reads' here:
    http://www.microchip.com/Devicedebugfeatures/
    (It would generally be indicating Debug Reads of flash memory. The PICkit 3 tool may be less supported in this regard compared to the MPLAB ICD 3 and MPLAB REAL ICE tools.)
     
    I realize this thread is about Data EEPROM so...
     
    Most (if not all) 8-bit Enhanced Midrange parts can additionally (beyond flash memory) read the following memory areas in a debug session (debug mode) without resetting the part via an explicit read operation by the user:
     
    1) Data EEPROM (if exists on MCU)
    2) User IDs
    3) Configurations words
    4) DIA memory (if exists on MCU)
    5) DCI memory (if exists on MCU)
     
    To the best of my knowledge this capability (1 through 5 above):
     
    a) Is not supported in this older PIC18F25K80 part.
    (It is not a technical limitation but could be a size limitation of the Debug Executive.)
     
    b) Is not supported on the newer PIC18 MCUs with either the older tools (MPLAB ICD 3 and MPLAB REAL ICE) or the newer tools at this time (MPLAB ICD 4 and MPLAB PICkit 4).
    (It is not a technical limitation. There may be enough room to add this functionality to the Debug Executive in the future.)
     
    I hope this helps somewhat (even though it does not solve your immediate issue today SpokaneNexus).
     
    Best regards,
     
    Ken
     
    #17
    SpokaneNexus
    Super Member
    • Total Posts : 362
    • Reward points : 0
    • Joined: 2013/02/05 14:53:25
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 18:13:41 (permalink)
    0
    Ken_PergolaI hope this helps somewhat (even though it does not solve your immediate issue today SpokaneNexus).

    Thank you for the additional clarifications. I'm surprised that the PIC18F25K80 is considered an "older" part, and thus lacks some debug capabilities. Too far down the road on this design to change now, so I'll muddle through!
     
    Thanks again!
    #18
    Ken_Pergola
    Super Member
    • Total Posts : 2097
    • Reward points : 0
    • Joined: 2003/11/07 12:48:48
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/12 19:14:52 (permalink)
    +1 (1)
    SpokaneNexus
    ...I'm surprised that the PIC18F25K80 is considered an "older" part, and thus lacks some debug capabilities...



    Hello SpokaneNexus,
     
    I'm sorry for your frustration in this inability for the tool to do what you want. I agree it is a very useful and reasonable feature when one is writing code and developing a project or product.
     
    These Debug Mode Read features are derived from the code in the Debug Executive -- not from the silicon itself. I'm sorry I was not more clear -- that is why I was saying it is not a technical (or silicon) limitation. The Debug Executive code is changeable to provide value-added debug features if there is enough room to do so.
     
    I looked at the space left in the PIC18F25K80 Debug Executive and my gut feeling is that there is plenty of space left in my opinion to implement Debug Mode Reads of the Data EEPROM. (Some Debug Executives are so starved for space which unfortunately precludes adding some of these useful debug features for customers.)
     
    If you are willing and able, my best advice to you would be to suggest this feature to be added to MPLAB X IDE by contacting Microchip directly or through your local FAE. Still, it does not help you in the short term but if enough customers request this feature then it might become a reality and incorporated into a future MPLAB X IDE release.
     
    My Support:
    http://www.microchip.com/support/hottopics.aspx
     
    How to submit a technical support case?
    https://microchip.secure.force.com/microchipknowledge/articles/en_US/FAQ/How-to-submit-a-case/?l=en_US&fs=Search&pn=1
     
    (I hope this helps even though it does not help you through your immediate need in the short term.)
     
    Best regards,
     
    Ken
     
    P.S. Edit: SpokaneNexus, I will add an internal feature request for you and reference this Forum post.
     
    post edited by Ken_Pergola - 2018/03/12 19:24:50
    #19
    SpokaneNexus
    Super Member
    • Total Posts : 362
    • Reward points : 0
    • Joined: 2013/02/05 14:53:25
    • Location: 0
    • Status: offline
    Re: Reading EEPROM with ICD3? 2018/03/13 09:58:02 (permalink)
    0
    Ken_PergolaThese Debug Mode Read features are derived from the code in the Debug Executive -- not from the silicon itself. The Debug Executive code is changeable to provide value-added debug features if there is enough room to do so.

     
    That has always been my presumption. I tried to explain how I envisioned that working earlier in this thread, and you've basically confirmed my expectation.
     
    P.S. Edit: SpokaneNexus, I will add an internal feature request for you and reference this Forum post... If you are willing and able, my best advice to you would be to suggest this feature to be added to MPLAB X IDE by contacting Microchip directly or through your local FAE.

     
    Thank you so much for initiating that internally! I suspect that carries a lot more weight than an external request. Given that you're doing that, does it still make sense for me to follow your advice and "suggest this feature to be added to MPLAB X IDE"? Or is that redundant now that you're doing it internally?
     
    Thanks!
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2018 APG vNext Commercial Version 4.5