Problems reading memory using AtmelStudio

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

Hi guys,

 

I really was surpised  recognizing that my AtmelStudio (V7, avrisp mkii) is not able to read the memory of an ATmega328 correctly...

The original hex-file I wrote started like this:

:100000000C94AB000C94C8000C94C8000C94EC1435
:100010000C94C8000C94C8000C94C8000C94C80040
:100020000C94C8000C94C8000C94C8000C94C41420
:100030000C94C8000C94C8000C94C8000C94C80020
:100040000C94C8000C94C8000C948F230C94C80026
:100050000C94C8000C94C8000C94C8000C94C80000
:100060000C94C8000C94C80007634236B79BD8A70D
:100070001A39685618AEBAAB558C1D3CB7CC5763CD
:10008000BD6DEDFD753EF6177231BF000000803F7B
:1000900008000000BE922449123EABAAAA2ABECD97

And reading the just written file again shows:

:100000000C94AB000C94C8000C94C8000C94EC1435
:100010000C94C8000C94C8000C94C8000C94C80040
:100020000C94C8000C94C8000C94C8000C94C41420
:100030000C94C8000C94C8000C94C8000C94C80020
:100040000C94C8000C94C8000C948F230C94C80026
:100050000C94C8000C94C8000C94C8000000000068
:100060000000000000000000000000000000000090
:100070000000000000000000000000000000000080
:100080000000000000000000000000000000000070
:100090000000000000000000000000000000000060

The memory seems to be empty, but the chip is working fine.

As well the verifying of the original hex-file after programming has no errors.

Lock bits are all off.

 

Any idea what I'm doing wrong?

 

Thanks!

BEXX

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

So writing the .hex file to the chip changes the file..?  The first file has a larger vector table than the second file.  What did you change?

 

Greg Muth

Portland, OR, US

Xplained/Pro/Mini Boards mostly

 

Make Xmega Great Again!

 

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

Maybe my first post was a bit confusing...

 

The .hex file made by the compiler is the first one. This one has been written to the flash an verified OK.

The second one is the re-read .hex file from the same chip after successful programming.

I'm wondering, why the re-read one is not equal to one programmed before.

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

Do you mean you re-read IMMEDIATELY after the initial write/verify operation? Also what tools did you use for the writing/reading? If a command line tool such as avrdude what were the command parameters?

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

Yes, I've been using Atmel Studio 7 for programming and also the AS7device programming tool for immediate reading.

I've been also trying AvrStudio 4 on a different PC and the reding was Ok there.

 

Now I did one more try on the next different PC, now writing and re-reading with the AS7device programming tool

shows below the compare result with notepad++:

most of the .hex file seems bo be the same, but not all.

Shouldn't it be exactly the same???

 

 

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

Presumably the reader creates "sparse" hex? Do a hex2bin on each (objcopy is a good way) then use something like vbindiff to compare the bin files, that's ultimately what matters.

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

Attached you find a screenshot of the difference.

Obviously the size of the two files is no identically and re-reading the chip AS7 additional characters.

Would it cause a problem flashing the re-read file again?