Loading RAM content file in the debugger

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

Hi together!

I use an AVR32 ATUC3B0512 microcontroller and use Atmel Studio 7.

 

To find a bug I have created a special version of my firmware which allows me to read out the complete RAM without being connected via debugger.

 

In case of an error I would like to have this RAM content sent as binary file and then load it into the debugger at my place. So I can at least examine the global variables. Basically this is like a reduced core dump.

 

Under Eclipse you can import such a file in the memory view. That means I start the debugger with exactly the same firmware version as the customer has. I let it stop directly in the main with a breakpoint.  Then I load the file via import and can use watch expressions to view the content of the global variables.

 

Is there a possibility to load memory content from a file in the debugger of Atmel Studio 7?

 

Or does someone have a completely different idea how to view such a RAM snapshot in a clear way?

 

Many thanks in advance,

Roland

 

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

In GDB the command is "restore".

Does Atmel Studio have a GDB command line interface?

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

r.cassebohm wrote:
a completely different idea how to view such a RAM snapshot

If you can't get AS to do it, could you just write the complement of the code which dumped the memory ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your advice.

 

Yes, I think I could do that. I've been thinking about it.

 

But that would only be my second choice. I think it will be difficult because I will also overwrite global variables that are used during the transfer. I'd have to do it with a special routine that doesn't overwrite a specific area that it uses itself.

 

The best thing would be, I could just start the debugger without any real hardware and look at the memory dump directly. It would be like looking at a core dump:

 

gdb elf-file core-dump-file

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

If you're able to use a UC3A (or UC3L) device instead you could use the Studio simulator. The stim-files support "memload" and "memdump" directives which can be used to read/write any memory to/from a hex-file. Unfortunately we don't have simulator support for UC3B.

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

Great! It works!

 

This is what I have done:

 

  1. I have disabled building in my configuration.
     
  2. Then I have switcht from AT32UC3B0512 to AT32UC3A0512.
     
  3. Then I have choosen simulator in Tools.
     
  4. Then started debugging with break.
     
  5. I have converted my binary RAM content file into a hex file with avr32-objcopy.
     
  6. Then made a stim file with:
    $memload C:\Data\Atmel\Stimulus\CM_AVR32.hex s nocheck
     
  7. Loaded the stim file and ececuted it.
     
  8. Then just made one step with the debugger.
     
  9. Now all RAM is loaded with the content of the file and i can look at the variables with the watch view.

 

So many thanks!!! smiley

 

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

Great that you found a solution! :-D

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

Neat!