Simulator shows question marks in memory view

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

I've just returned to AVR programming after many years and am having trouble viewing the AVR memory in the simulator. My code was written in assembler for the ATtiny2313, I am using Atmel Studio 7.0.2397.

 

In the memory view when I look at registers, mapped_IO, IRAM, EEPROM or OSCCAL it shows all values as "??". Looking at Prog FLASH shows real data. Looking at the I/O points in the I/O view shows real data. The attached file shows the issue.

 

There is an anomaly though, when I scroll down any of these windows it eventually starts to show data (although at memory locations beyond what the Tiny2313 has) and this display turns back to "??" when I next do a "Step Into" with the debugger.

 

I have found a similar question at the link below, but no real answers. This was using a tiny4313, so a very similar device to mine.

https://www.avrfreaks.net/forum/...

 

Does anyone know how to view the memory contents of an AVR when using the simulator in Atmel Studio? I am sure that it "just worked" when I simulated them previously (maybe 8 to 10 years ago).

 

 

Thanks

 

G..

Attachment(s): 

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

Keen to see an answer on this one also, as I noticed this today in RAM address space, between sections of valid and expected data...

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

To the OP: where did you get the outi instruction from?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Good question. It came from some example code that I have been working from. It was defined as a macro for "ldi" and then "out" (and it uses r16 for storage, which I didn't realise until I went looking after you asked that question, and it could be the source of the bug I am trying to track down).

 

I will now go through my code and remove all of these so it's obvious what is happening.

 

The original code came from...

https://www.avrfreaks.net/projec...

 

I an still trying to solve my simulation problem though... I am guessing that it is not expected behaviour (i.e. you should be able to view the memory contents when simulating) and maybe I need to report it as a bug?

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


Seems to be a fault with the simulator, selecting 4 columns display on the R/H fixes the iram view

 

 

selecting 4 or 8 columns fixes the register view, however you are better off having the registers on the R/H pane.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

So don't worry about the outi macro, just a Red herring. Also I would not bother reporting the fault officially, not many chances of a fix I don't think.

 

Edit just tried with a real chip and a JTAG Mk3, same behaviour, so not just the simulator.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Wed. Mar 25, 2020 - 03:28 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hmmmm... I thought that bug was fixed...
.
So, question marks in the memory window can mean 1 of 2 things, the address is out of range or an error occurred during reading of the range. The problem is that Studio had an issue not returning partial ranges. The memory window reads a bit more than needed, and if any of the read ranges failed we would fail all reads. I.e if the memory window shows more memory than the full device, then it would always fail to read...
.
Ill need to check out bug lists tomorrow to see if we ever fixed this...

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

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

Oh dear I spoke too soon about a fix not likely to happen devil by the way my AS7 is  "Atmel Studio 7 (Version: 7.0.1931 - )" running on Win7.

 

Maybe I should update to the latest but I'm terrified of updates.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:

selecting 4 or 8 columns fixes the register view, however you are better off having the registers on the R/H pane.

Thank you for that (and for the suggestion to put the registers at the RHS). That has fixed it for me.

 

js wrote:
Edit just tried with a real chip and a JTAG Mk3, same behaviour, so not just the simulator.

I figured it would be. I have just received my ATMEL ICE in the mail (Iwas trying to get it to work with the simulator first, so that I knew how it worked with the ICE)

 

meolsen wrote:
Ill need to check out bug lists tomorrow to see if we ever fixed this...

Thank you so much for this. This is the sort of thing that can cause newbies to abandon projects (mine was on hold for a couple of weeks due to this).

 

js wrote:
Maybe I should update to the latest but I'm terrified of updates.

I share your fear of updates, but I am running the latest and still have this issue.

 

js wrote:
So don't worry about the outi macro, just a Red herring.

Actually, the "bug" I was referring to was the one in my AVR, and which I was trying to figure out by using the simulator. I have used the outi macro without realising that it changes r16. Unfortunately the bug only manifests itself when connected to the I2C bus of the robot (the project is for a kids' robotics team, which is on-hold due to the virus, and the Sydney competition being deferred) so I will have to wait for a while before getting to the bottom of this one!

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

the Sydney competition being deferred

Where was it going to be held?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
Where was it going to be held?

The Quaycentre at Sydney Olympic Park (sometimes referred to as the "State Sports Centre")

 

 

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

Not far from me, could get my grandson to visit if it's not too expensive to attend. cheeky

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
Not far from me, could get my grandson to visit if it's not too expensive to attend.

It's free! You are welcome to attend, they encourage news of their competitions to be spread as wide as possible. I don't know how old your grandson is, but this comp is for high school kids (the organisation that runs them has four tiers of which this is the top tier, the second tier is the Lego robotics tournaments that some primary schools are involved with, which you may have come across before)

 

Both the Southern Cross Regional and the South Pacific Regional are held in Sydney, so there are teams from all over the place (many from China and Taiwan, plus Hawaii, the Phillippines, South Africa, etc). If you came, I'd be happy to show you around the pits and show you the internals of the robots.

 

All we need now is for COVID-19 to abate and the tournaments to be rescheduled!

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

It's free!

The right price for me. cheeky My grandson just started high school. Do you have a link to the event so that I can pass it on?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
The right price for me. cheeky My grandson just started high school. Do you have a link to the event so that I can pass it on?

 

https://firstaustralia.org/frc-sydney-regional/

 

And a link to one of the matches (the final from last year - which got an invite to the world championships at Houston for the team I am with)

https://www.youtube.com/watch?v=9BPJcaSKMt8

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

Thank you.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly