Atmel Studio 6: watch Unknown identifier

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I use Atmel Studio 6 (version:6.0.1882) and I' trying to debug my code based on Bitcloud Stack.
I have problems with Watch window. I report part of the code where I have problems:

static void update_time(void)
{
  uint8_t i;
  uint32_t current_time_sec;
  uint64_t current_time_msec;
  
  // Get neighbor information
  NeibTable_t *neibTable = NWK_GetNeighborTable();
  
  if (true == initNeighborCount)
  {
    initNeighborCount = false;
    // reinit neighbor index
    neighborIndex = 0;
  }
  // update / set time on neighbors
  if (neibTable->size > neighborIndex)
  {
    // check if neighbor is our child
    if (RELATIONSHIP_CHILD == neibTable->table[neighborIndex].relationship)
    {
      if (DEVICE_TYPE_ROUTER == neibTable->table[neighborIndex].deviceType)
......

If I add

neibTable

to Watch, when I am on breakpoint, I get the error:

Quote:

Value = Unknown identifier

neibTable is defined under:

Quote:

BitCloud\Components\NWK\include

typedef NwkNeighborTable_t NeibTable_t;


How can I solve the problem?

Thank you

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

How can I solve the problem?

Make it volatile and see if that helps.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I use the same code with IAR and I can see the struct in watch window.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I use the same code with IAR and I can see the struct in watch window.

That's a bit like saying "this car can only do 0-60mph in 13 seconds but my other car can do it in 5.5, what's wrong with this one?"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The latest patch version of Atmel Studio has trouble watching structs, which is probably what you are seeing there. There's an internal fix for it which should be included in the next patch, but for now you may need to revert to AS6 public patch 1.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I use AS6 from short time, but I think that the problem could be due to environment configuration. It seems that AS6 doesn't have access to the definition of NwkNeighborTable_t.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you explain me how to revert to AS6 public patch 1?

thank you.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I reinstalled AS6 and I can add and open structs but not all. I cannot still open neibTable. I get the error:

Quote:

Value = Unknown identifier

For example,

appMessageToNetwork.data.extAddr_dst = neibTable->table[neighborIndex].extAddr; 

I can see the fileds of the struct

Quote:

appMessageToNetwork

but I get error with
Quote:

neibTable

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In VAssistx->Tool->VA View I can see the neibTable struct with all fields but not the actual values.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am also having trouble with watch variables. If I add local variables to watch window, I get error messages like unknown identified or unknown Location or Optimized away. I am using latest Atmel Studio 6.2

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I get error messages like unknown identified or unknown Location or Optimized away. 

That's because they HAVE been optimised away.

 

If you want to say "don't optimize this" then you add the word "volatile" to the variable definition.

 

EDIT: Perhaps have a read of this:

 

http://www.avrfreaks.net/forum/t...

Last Edited: Thu. Jul 2, 2015 - 11:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I need to change all my code (or may be some sections which I need to debug) with volatile keyword or is there any way I can completely disable optimization only while I debug? I feel it is very inconvenient if we have to add volatile to every variable.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you read the article I linked to?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One of the other ways this can happen is if your break point lands at a place where the variable in question is out of scope.

 

Jim

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net