This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

error instead of value in watch

Other Parts Discussed in Thread: MSP430G2553

Hi,

I'm trying to verify my flash write / erase functions work and I realize I can't view variable's vlaues in watch.

I use MSP430G2553 with Launch Pad debugging using IAR embedded workbench 5.40.1

I attached a picture

Thank you

Igal

  • is there no one that can help with this?

  • Abraham Keren said:
    I realize I can't view variable's vlaues in watch

    While debugging, you should disable all optimizations in the compiler settings.

    With optimizations on, the compiler may turn some local variables into register variables (thus there is no memory location that holds the value) or may even optimize them away or use their location if no longer used. The debugger than doesn't know where to get them from.

  • thank you for your reply

    In the example pic the variable circled is a global variable

    I have optimization disabled.

    so the problem is elsewhere, any ideas?

    thank you

  • Well, is it a constant that resides in flash?

    During a write/erase operation, the flash memory isn't accessible. Any instruction fetch results in a returned 'instruction' of 0x3fff (which is JMP $). Any data read may result in an error.

    edit: I missed the pic you attached.Usually, people directly embed their pics directly into the text and use attachments only for unreadable binary data (such as zip files) :)

    Well, what is flash_wr_buffer? Is it a pointer? Or a statically allocated array?

    I don't use IAR (or CCS) so I cannot test it myself and have no personal experience with this problem. I can only offer possible reasons as read in this forum before, and some guesses of my own :)

  • Thank you, I'm embedding the pic for future readers :-)

    BTW, what do you use for debug?

    as of  "flash_wr_buffer" - it is a global array of unsigned char.

    It doesn't matter, it happens all over. if you'll see in the pic the following line loads an address to a pointer (ptr)

    currently the watch says ptr points to 0x0, but after executing this line ptr in the watch has "<Error>" as well.

    going to View---Memory (from the IAR main menu) instead of seeing the memory (either RAM or program memory, it doesn't matter) you'll see "--"

    if I select a few cells some of them show their values. I will embed a couple of pics down here to illustrate what I mean.

    trying to see the memory's content:

    after selecting several cells:

    Thank you for your help

  • Yes, that's strange. Unfortunately I don't kno wwhat happens. The watches need to fetch the memory data through JTAG. This is a very slow process. So you should limit your watches to the absolute necessary. I  don't know, however, why you get errors. I'd rather expect the system responding very slowly if there are many matches. But maybe they have introduced a timeout if the data fetching takes too much time to prevent the system becoming unusable.

    You should really ask this in the compiler forum. Only the compiler makes know what their debugger is intended to do (and how it is done).

**Attention** This is a public forum