The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

wp34s - New features in the SVN repository - now released!
Message #1 Posted by Marcus von Cube, Germany on 5 May 2011, 9:18 a.m.

I've added a new feature to wp34s: Flash backup of user data. This is still preliminary, more a proof of concept that I can handle flash programming within the firmware but it's useful:

ON + 'B' creates a backup of the 2 KB static RAM in flash where it survives a complete power loss, reset or other trouble.

ON + 'R' restores the backup. Only data with a valid checksum is copied.

You'll find the most recent build in SVN on SourceForge only.

Edit: The package is now released in SF.

Edited: 6 May 2011, 3:50 a.m. after one or more responses were posted

      
Re: wp34s - New features in the SVN repository
Message #2 Posted by Jeff O. on 5 May 2011, 1:55 p.m.,
in response to message #1 by Marcus von Cube, Germany

Probably my fault, but version 820 does not work on my 20b. After the download to the calculator is complete, the display stays blank and does not respond to keystrokes.

Assuming the above is just a minor glitch, could this new feature somehow be used to get programs from the outside world, say developed on the emulator, into the calculator? In other words, could a bin file be created with valid data in the flash ram back-up area and then downloaded into the calculator?

            
Re: wp34s - New features in the SVN repository
Message #3 Posted by Marcus von Cube, Germany on 5 May 2011, 2:01 p.m.,
in response to message #2 by Jeff O.

I have to check what's possible. It's not clear if the emulator produces exactly the same structure as the real hardware.

I'll check why 820 doesn't respond. Can you retry the download? Have you set the "boot from flash" bit in SAM-BA?

                  
Re: wp34s - New features in the SVN repository
Message #4 Posted by Jeff O. on 5 May 2011, 2:16 p.m.,
in response to message #3 by Marcus von Cube, Germany

I am using MySamba, not SAM-BA. I tried it using SAM-BA and got it to download successfully. MySamba is a lot easier to use than SAM-BA, so if you could figure out a way to make it work with MySamba, that would be great :-)

Do any of our tools allow the bin file to be extracted from the calculator? That would allow programs to be developed, uploaded to PC, stored, shared, re-downloaded, etc.

                        
Re: wp34s - New features in the SVN repository
Message #5 Posted by Marcus von Cube, Germany on 5 May 2011, 2:20 p.m.,
in response to message #4 by Jeff O.

I could add a hidden feature to activate the SAM-BA boot loader on the next reset without clearing the flash. That would allow external access to the flash contents. A way to up/download via the cable would be the deluxe variant.

                              
Re: wp34s - New features in the SVN repository
Message #6 Posted by Jeff O. on 5 May 2011, 2:43 p.m.,
in response to message #5 by Marcus von Cube, Germany

I am not quite sure what you mean by your response, but, I'll assume it would be good. My naive assumption (or hope) about how it should or could work is as follows:

Step  Action
  1   wp34s user creates a nifty program on a 20b or 30b running wp34s
  2   wp34s user backs up ram to flash memory
  3   wp34s user extracts current rom from calculator
  4   wp34s user sends rom to another wp34s user
  5   2nd wp34s user downloads rom to his/her 20b/30b
  6   2nd wp34s user executes restore command to move program from 
      flash into ram
  7   2nd wp34s user begins using 1st wp34s user's nifty program

I tested the back-up and restore commands, they work as advertised. Cool!

...

                                    
Re: wp34s - New features in the SVN repository
Message #7 Posted by Marcus von Cube, Germany on 5 May 2011, 3:49 p.m.,
in response to message #6 by Jeff O.

I was thinking of simply concatenating the wp34s.dat file of the emulator with the flash image and restoring this. This may work or may not, depending on some details which I don't know yet.

The problem with getting the current flash contents out of a real wp34s is that you cannot get into SAM-BA mode without erasing the complete flash contents. :-( I need to add a command to enable SAM-BA without erase or even better to send the flash or user RAM through the serial port from the application.

                                          
Re: wp34s - New features in the SVN repository
Message #8 Posted by Jeff O. on 6 May 2011, 8:16 a.m.,
in response to message #7 by Marcus von Cube, Germany

Quote:
I was thinking of simply concatenating the wp34s.dat file of the emulator with the flash image and restoring this. This may work or may not, depending on some details which I don't know yet.

Program development on the emulator would be a great alternative, as long as there is some way to get programs onto the calculator from the outside world. My operating paradigm might now look like this:

Step  Action
  1   wp34s user creates a nifty program on the wp34s emulator
  2   wp34s user backs up ram to "virtual" flash memory on the emulator
  3   wp34s user extracts wp34s.dat file of the emulator and 
      concatenates with calculator bin file
  4   wp34s user downloads rom to his/her 20b/30b
  5   wp34s user executes restore command to move program from 
      flash into ram
  6   wp34s user begins using nifty program on the real hardware

Of course programs could be shared among users this way also.

Speaking of concatenating to the flash image file, if you recall I mentioned that the new version would not download correctly for me using MySamba. I assumed this had something to do with the new version being only 126k instead of 128k. I tried padding the file out to 128k, but could not get it to work. Do you have any idea why MySamba does not like the shorter file or versions padded out to 128k? Is there some secret character that must come at the end?

                                                
Re: wp34s - New features in the SVN repository
Message #9 Posted by Marcus von Cube, Germany on 6 May 2011, 9:49 a.m.,
in response to message #8 by Jeff O.

See the new file flash.txt in the current release for what is possible now. :-)

                                                      
Re: wp34s - New features in the SVN repository
Message #10 Posted by Jeff O. on 6 May 2011, 1:24 p.m.,
in response to message #9 by Marcus von Cube, Germany

Hi Marcus,
Thanks for your continued work on this.

I read the flash.txt file and attempted to follow the instructions, but the uploaded dat file was 4k file. I did not figure I could tack a 4k file on to a 126k file to get a 128k file to download back into my other calculator, so I must be doing something wrong. I was able to get my calculator back in business, so no damage done.

edit - On my second try I was able to upload the state file from my 20b, concatenate to the v831 bin file, load that file onto my 30b, and restore the state file on the 30b. Not sure if I remember exactly how I did it though.

Edited: 6 May 2011, 2:56 p.m.

                                                            
Re: wp34s - New features in the SVN repository
Message #11 Posted by Marcus von Cube, Germany on 6 May 2011, 4:09 p.m.,
in response to message #10 by Jeff O.

A state file is always a bit short of 2K. The 4K file must have been something different.

The command is:

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

You then send calc-2.dat to your calculator.

Edited: 6 May 2011, 4:10 p.m.

                                                                  
Re: wp34s - New features in the SVN repository
Message #12 Posted by Jeff O. on 6 May 2011, 8:38 p.m.,
in response to message #11 by Marcus von Cube, Germany

The 4k file was a definite error on my part.

Quote:
The command is:

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


That sounds like some sort of linux mumbo jumbo with which I am totally unfamiliar :-)
I used a much more cumbersome process using a hex editor.

                                                                        
Re: wp34s - New features in the SVN repository
Message #13 Posted by Marcus von Cube, Germany on 7 May 2011, 4:17 a.m.,
in response to message #12 by Jeff O.

It's plain old DOS respectively Windows command prompt.

                                                                              
Re: wp34s - New features in the SVN repository
Message #14 Posted by Jeff O. on 7 May 2011, 12:13 p.m.,
in response to message #13 by Marcus von Cube, Germany

Thanks, shows what I know (very little, obviously.)
Turns out I do remember basic DOS commands, the suggested procedure worked great. Thanks Marcus.

Edited: 9 May 2011, 7:46 a.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall