USBDM: making full flash memory dump of MC9S08AC96

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USBDM: making full flash memory dump of MC9S08AC96

Jump to solution
3,099 Views
Ano
Contributor I

Hi there,

I'm trying to make a dump of the full flash memory of the MC9S08AC96 chip,
which has a 96K FLASH memory.

But I'm a bit confused by the memory map in the specifications (see attached picture).

I found that in the specifications it is stated PPAGE = 78, so I have to set it to 'paged memory' when reading. Then I can succesfully read PPAGE=0, PPAGE=1, PPAGE=2, PPAGE=3, see attached picture.
But I'm still not at 96K... Still missing is PPAGE=4 and PPAGE=5.
Where are they hiding? If I set the address to 10000 - 13FFF and 14000 - 17FFF I get an error.

Does anyone know how I can dump the full 96K flash?
Thanks!

0 Kudos
Reply
1 Solution
2,908 Views
pgo
Senior Contributor V

Hi,

The failure for the verify of MC9S08AC96_AllPages_byAno is really a bug in the programmer.  It is confused by the security area being in the main memory map and also appearing in a memory page.  I believe it will verify if you select Unsecure option.

An improved memory map is attached MC9S08AC96_ModifiedMap.cfg.  This is paged apart from PAGE3 (which contains security information) which is directly accessed.  This captures all the Flash without any security issues.  I suggest you use this configuration to backup the chip and verify using the programmer.

The good news is that the PAGE0 does contain information that is not visible in the reset memory map.  This page (or at least the lower portion) must be used in the paged area.  This may account for the failure.

bye

View solution in original post

0 Kudos
Reply
14 Replies
3,070 Views
Ano
Contributor I

Thanks for your guidance, so that't how I should dump the entire flash.
I'm gonna try it and see if it works.

Updating the software from 4.12.1.262 to the latest version 4.12.1.330 did not go so well...
The USBDM Memory Dump tool works fine (as before), but when I run the HCS08 Programmer tool now, I get an error... (see attached screenshot).

Naamloos.jpg

Maybe my mistake was that I installed the new version alongside the old version (without uninstalling the old version first)?
I now uninstalled both versions, uninstalled the drivers, rebooted, installed the drivers, install the new version again, rebooted. But I still can't run the programmer, I still get this error


Anybody knows how to fix this? I hope so.

0 Kudos
Reply
3,064 Views
Ano
Contributor I

I found out why I got this connection error.
After upgrading the program, for some reason all time settings were set to "0 ms". After restoring the 'normal values' the program works well again:

Untitled.jpg

0 Kudos
Reply
3,049 Views
pgo
Senior Contributor V
You can clear ALL previous settings by deleting the configuration directory.
This will be either ~/.usbdm or %APPADATA%/usbdm depending on OS.
0 Kudos
Reply
2,983 Views
Ano
Contributor I

Today I did some testing.

The machine I'm working on has two pcb's, a 'power pcb' and a 'control unit pcb'. Both pcb's contain this MC9S08AC96 chip.

I started making a dump of the power pcb chip using the "Memory dump" tool, with the settings as described by @pgo (I attached a screen dump of my - updated - program), followed by a verification of the dump using the "Programmer" tool. The pcb has a connector to access the chip. That went well.
(The updated program is quite convenient, as you now can save and load settings )

Then I desoldered the original chip from the power pcb and soldered an a brand new MC9S08AC96 that I bought at mouser.com. I flashed the new chip with the dump using the "Programmer" tool, followed by a verification. That also went well.
Unfortunately, the machine doesn't work well with the new chip

Ok, maybe I have a 'bad chip'? Who knows... So I repeated the procedure with yet another brand new chip. But again the machine will not function correctly.

Then I soldered in the original chip again: the machine works well again!

Am I still missing part of the flash memory with the settings that were posted here?

Or does the chip e.g. have a hardware ID that can be read out by the control unit? So that it detects that I replaced the chip?

I hope someone can shine a light on this, thanks!

 

0 Kudos
Reply
2,977 Views
pgo
Senior Contributor V

Hi,

A bit difficult to diagnose from a distance.

You have done the right thing in using the programmer to verify that the memory image is consistent with the contents of the chip.  This is limited however, in that it only checks what is present in the image against the chip - anything missing will not be detected.  It is unlikely this would be a problem since I believe the map used is complete (but see below).

I do not know of any ID feature or similar in the AC96 but I am not an expert on this chip.

Some possibilities (rather unlikely)

  • The board doesn't appear to have a crystal so is it using the internal clock?  If so then any trim value saved in the image would be incorrect and result in slightly different clock speeds.  I think this is unlikely to be a problem as a incorrectly trimmed clock would still operate but with inaccurate timing.
  • The range specified is based on the default reset map.  It does not include the entirety of page 0 of the EPROM as that is not visible in the map.  It is possible that this page is being actually used with the paged window so this could cause problems.
  • When programming the chip you should use the Image security option. 

I suggest you do the following:

  • Use the attached Memory maps with the MemoryDump program to create two images.  One assumes the reset map,  the other uses the memory window to obtain the entire contents of the EPROM.
  • Post these on the forum and I will try to check for any issues.

bye

 

0 Kudos
Reply
2,947 Views
Ano
Contributor I

Thanks for your swift reply.
Yes, I always use the "Image" option when flashing (see attached printscreen).
The MemoryDumpSettings files that you sent me appear to be dumps (.sx files).
I was expecting a .cfg file that I could load into the MemoryDump program.
But how can I use these to .sx files to create the two images that you request?
Thanks!

0 Kudos
Reply
2,943 Views
pgo
Senior Contributor V

Hi Ano,

You are right to be surprised - so am I!

Obviously my fat fingers zipped the wrong files.  They were test runs.

Please see attached.

0 Kudos
Reply
2,932 Views
Ano
Contributor I

Here they are!

0 Kudos
Reply
2,929 Views
Ano
Contributor I
P.S. When I do a 'verify flash' of the two dumps you suggested, the "ResetMap" goes well, but with the "AllPages" dump I get the error "Readback of the flash contents does not agree with buffer."
0 Kudos
Reply
2,909 Views
pgo
Senior Contributor V

Hi,

The failure for the verify of MC9S08AC96_AllPages_byAno is really a bug in the programmer.  It is confused by the security area being in the main memory map and also appearing in a memory page.  I believe it will verify if you select Unsecure option.

An improved memory map is attached MC9S08AC96_ModifiedMap.cfg.  This is paged apart from PAGE3 (which contains security information) which is directly accessed.  This captures all the Flash without any security issues.  I suggest you use this configuration to backup the chip and verify using the programmer.

The good news is that the PAGE0 does contain information that is not visible in the reset memory map.  This page (or at least the lower portion) must be used in the paged area.  This may account for the failure.

bye

0 Kudos
Reply
2,903 Views
Ano
Contributor I

Thanks again for your help!
Ok, if I understand correctly you suggest to flash the chip with the dump I get from using the MC9S08AC96_ModifiedMap.cfg then.
I made the dump and flashed it with the "Image" option selected under "Security", flashing and verification was successful.

Then I put the pcb in the machine and......

YES YES !!

The machine is working properly now!

So apparently this was the correct way of dumping all flash memory.
I had no idea it could be so complex. Normally it's just looking up the memory ranges in the Reference Manual and using these ranges for dumping the flash memory. But with this paged memory apparently things are not so straight forward anymore!

Thanks a lot for your assistance!

0 Kudos
Reply
2,896 Views
Ano
Contributor I

So this is the correct way to make the dump:

DumpSettings.jpg

0 Kudos
Reply
2,945 Views
Ano
Contributor I
P.S. No, the pcb doesn't contain a crystal.
0 Kudos
Reply
3,077 Views
pgo
Senior Contributor V

The Memory dump program expects paged addresses for the paged area.

This consists of the pageNo+address within window as shown below:

pgo_0-1731504090438.png

I also suggest you update to the current version of the software as the screen grab you provided appears an old version.

bye

0 Kudos
Reply