▼
Posts: 3,283
Threads: 104
Joined: Jul 2005
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
▼
Posts: 875
Threads: 37
Joined: Jul 2005
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?
▼
Posts: 3,283
Threads: 104
Joined: Jul 2005
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?
▼
Posts: 875
Threads: 37
Joined: Jul 2005
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.
▼
Posts: 3,283
Threads: 104
Joined: Jul 2005
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.
▼
Posts: 875
Threads: 37
Joined: Jul 2005
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!
...
▼
Posts: 3,283
Threads: 104
Joined: Jul 2005
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.
▼
Posts: 875
Threads: 37
Joined: Jul 2005
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?
▼
Posts: 3,283
Threads: 104
Joined: Jul 2005
See the new file flash.txt in the current release for what is possible now. :-)
▼
Posts: 875
Threads: 37
Joined: Jul 2005
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.
▼
Posts: 3,283
Threads: 104
Joined: Jul 2005
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.
▼
Posts: 875
Threads: 37
Joined: Jul 2005
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.
▼
Posts: 3,283
Threads: 104
Joined: Jul 2005
It's plain old DOS respectively Windows command prompt.
▼
Posts: 875
Threads: 37
Joined: Jul 2005
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.
|