SHDesigns: Embedded Systems Design, Consulting and Developer Resources Page hits:

Rabbit Programming Tips

Save a Flash to disk in Dynamic C

If the flash on a board gets corrupted, you need to compare it to the original. DC has no function to dump tha flash to a .bin file. This procedure will allow you to dump the flash to a .bin file and then use a hex editor to compare the files.

Note: the DC save entire flash option does not work on many boards.

To save the flash, downlaod hex2bin.zip.

The perform the following steps:

  1. Load setflashcs.c
  2. Comment out the CS_FLASH2 line if you use two 256k Flash chips
  3. Compile setflashcs.c to RAM
  4. Single-step to the while loop.
  5. From the Inspect menu select "Dump at address"
  6. Select physical address and dump to file, address is 80000
  7. If there is no "Physical address" option, use 80:0000
  8. Set the number of bytes to the size of the original .bin file you want to compare to.
  9. Save as .hex or .txt.
  10. Use hex2bin to convert to a .bin file: hex2bin infile.hex outfile.bin

Then you can compare the .bin files. I use MS Visual Studio for this. There are other hex editors available.

The DOS comp.exe can also be used.

Note: the user and ID-block areas will be different.


Additional Information: Back to Tips page - SHDesigns Home Page