Wp34s Flash backup/restore


I'm trying to understand how to backup/restore program data so that I don't loose my programs when I upgrade the firmware.
Here's what I'm doing:

  1. On+B+B to backup to Flash;
  2. On+S+S to enter Samba;
  3. In Samba, save from 0x11F800, 0x800 bytes, to a file on the PC;
  4. Update the firmware as usual;
  5. send the saved backup file to the calc, from address 0x11F800.
This worked partially, in that I had two programs on my calculator, and now I only have one. Could it be because in memory, the program labeled "A" came after the program labeled "B"? Or did I do something wrong?

Also, I have a suggestion... When you press On+S, it writes "SAM-BA? Boot" on the display, showing what you're going to do if you press S again. This is great. Instead, when you press On+B to backup (or On+R to restore), you get no message at all; the only message you get is "Cancelled" if you don't press B (or R) again.
It would be really nice if it could show, after the first press, i.e. "Backup?" or "Restore?" and then, if the operation is carried on, "Backup OK" or "Restore OK", or "Cancelled" otherwise.
Does this make sense? :)



Cristian, the docs aren't up to date. Go to the FLASH.TXT file for the correct commands. Here is the contents again:

Commands to handle the flash memory on the real calculator

Hold down ON (EXIT) and press one of the following keys:

STO - Backup: This creates a copy of the RAM in flash memory.

RCL - Restore: This restores a previously created backup.

S - SAM-BA: Clears the GPNVM1 bit and turns the calculator off.
S is on the '6' key.
ATTENTION: You can now only boot into SAM-BA mode!
Without the SAM-BA software and the cable, you're lost!

These ON key combinations have to be pressed twice in a row without
releasing the ON key to be executed.

Do an ON+STO before you want to flash a new release! After flashing,
your backup should still be in place if you didn't accidentally press the
ERASE button on the cable but used ON+S instead to get into SAM-BA boot

There are additional commands in the I/O catalogue (f+STO):

PSTO n Store program in region n. n is 0 to 3. A region is a
block of flash memory that can hold a copy of the
user program area. Alphanumeric labels in flash can be
called with XEQ. This allows creation of libraries.
Use the new label browser (f+RCL) to see the labels.
Region 0 is the same region that is stored with the backup.

PRCL n Restore region n to the program area where data can be edited.

P<> n Swap the current program with the contents of region n.

LOAD Executes ON+RCL. This is available on the emulator, too.

SAVE Executes ON+STO. See above.

RRCL Recall the register data only from a previously created backup.

SRCL Recall the setup data only from a previously created backup.

You can recall a group of registers from the backup with the command
R-COPY from the program catalogue. Just give it a negative value in X
and the source block will be fetched from flash instead of RAM.

Single registers in flash can be read with RCF and its arithmetic variants
(RCF+, etc.)

Mapping from memory regions to emulator state files

Region Flash address state file Remark
unnamed 0x11fc00 wp34s-R.dat Registers and state of the backup
0 0x11f800 wp34s-0.dat User program of the backup
1 0x11f400 wp34s-1.dat Generic user Program region
2 0x11f000 wp34s-2.dat ditto
3 0x11ec00 wp34s-3.dat ditto
RAM wp34s.dat Emulator image of the RAM area

wp34s.dat is only written on exit of the emulator software.
wp34s-?.dat is written each time a flash command is executed.
All files are only read into memory on emulator startup.
If we find enough free space in flash we may increase the number
of regions.

How to transfer data between the calculator and your PC

The whole RAM is saved to address 0x11f800 (relative address 0x1f800)
with ON+STO. This can be copied to your PC or loaded from it.

1. From calculator to PC

a) Do an ON+STO, then ON+S, then RESET with the cable connected.
b) Press ON once and start SAM-BA on the PC. It should connect.
c) Set the start address to 0x11F800 and the size to 0x800
d) Enter a file name in the receive field.
e) You can now receive the file with SAM-BA.
f) Move it under the name wp34s.dat into your emulator directory.
g) The emulator should accept the file. Your registers and programs
will than be in place.
h) To get your calculator back in business, start the "Boot from flash"
script in SAM-BA, the same procedure you should know from flashing
the firmware.
i) Reset and power the calculator up and perform a restore with ON+RCL.
The latest version does the restore automatically when RAM is lost.

2. From PC to calculator

a) Perform steps (a) to (c) from above. No need to set the size.
b) Point SAM-BA to your wp34s.dat file from the emulator.
c) You can now send the short file with SAM-BA.
d) Perform steps (h) and (i) from above.

The program regions accessible with the commands PSTO, PRCL and P<> are
stored at addresses 0x11f000 and above (see table above) and have a length
of 0x400 (1 KB) each. The emulator creates files 'wp32s-?.dat', '?' being
the region number. You can handle these files the same way as the complete
state file from the emulator. The regions have identical formatting and
can be swapped by copying their data to the "wrong" place. The register
and state portion of the backup area at 0x11fc00 is formatted differently.

If you want to get your emulator data into the calculator in one go,
do the following in Windows:

copy /b calc.bin+wp34s-2.dat+wp34s-1.dat+wp34s.dat calc-full.bin

As an alternative the following will copy the backup data instead of the
RAM state file:

copy /b calc.bin+wp34s-2.dat+wp34s-1.dat+wp34s-0.dat+wp34s-R.dat calc-full.bin

The resulting file can be programmed into flash and all data is readily

Edited to reflect latest updates.

Edited: 6 June 2011, 6:55 a.m. after one or more responses were posted


A revised version of this text will be in the next manual :-)


Possibly Related Threads…
Thread Author Replies Views Last Post
  DIY HP 30b WP 34s serial flash/programming cable Richard Wahl 2 2,537 12-04-2013, 11:14 AM
Last Post: Barry Mead
  PRIME: re-format the flash drive to recover the operating system Harold A Climer 2 1,728 11-06-2013, 12:22 AM
Last Post: Michael de Estrada
  Bad Flash in HP Prime Han 11 3,273 09-27-2013, 12:38 PM
Last Post: Han
  Flash Flood Warning: 9/16/2013 (One Week from HHC13) Eddie W. Shore 8 2,878 09-17-2013, 09:20 PM
Last Post: Craig Ruff
  FLASH? command Andrew Nikitin 1 1,216 06-18-2013, 01:02 AM
Last Post: Walter B
  [EXCLUSIVE FLASH] Infos about new HP Prime ! Mic 16 4,112 04-02-2013, 11:06 AM
Last Post: Frank Boehm (Germany)
  No luck getting flash disk to work in 95lx Harald 7 2,958 03-18-2013, 08:11 AM
Last Post: Harald
  [41CL] Repairing an image in Flash Monte Dalrymple 0 901 01-24-2013, 07:01 PM
Last Post: Monte Dalrymple
  Archive an HP 50G and Restore on an HP 48GX Rudy P. 5 2,037 11-16-2012, 09:24 PM
Last Post: Michael Lopez
  [WP34S] WP34S firmware on the AT91SAM7L-STK dev kit? jerome ibanes 1 1,215 10-04-2012, 04:59 PM
Last Post: Paul Dale

Forum Jump: