41CL Flash Update Question



#12

I have Ángel's new CLUTILS 2E loaded in RAM on my 41CL. I want to update the image in flash, and I'd like to confirm my understanding of how that works before I plunge ahead. I understand that flash must be erased in 64k chunks. So that means you have to save off 7 pages (8 if you want to keep a backup of the original ROM) somewhere and write them back after the erase.

Assuming my understanding is correct, I'm then left with a question about the mnemonics for the standard ROMs. Where is that mnemonic kept? If write the new CLUTILS 2E on top of the existing CLUTILS, will the new ROM inherit the 'CLUT' mnemonic for mapping it into port memory? Can I add my own mnemonics to the table, wherever it is located?

Sorry if I missed this in the documentation, and thanks in advance for any help you can offer.

Merry Christmas

Howard


#13

Howard, I don't know about you, but I'm nervous about writing back to flash on my 41CL until I thoroughly understand how this works. I've already seen one post where a new 41CL owner accidentally over-wrote some of his flash memory. Given my conservative mind-set when it comes to storage, the very first thing I want to do is COMPLETELY back up all of my flash to a PC so if I accidentally screw up, I can restore it to factory specs. Then I want to back up all my RAM just for the heck of it. Geoff has talked about this in some of his posts and I want to do that too before I start tinkering around. Also, in the new production version of the 41CL, some of the user flash (the XXXA 4K section I think) has solution books located there so if you're not careful, they could be over written if you didn't see that in the user notes that were sent with the 41CL circuit board.

So, for us 41CL Newbies, how do I backup both RAM and flash to a Win7 PC? Please write this as simply as possible because I'm an idiot and if there is a way to screw this up, my fingers will find it!

Thank you,

Gerry

P.S. I do have the 41CL serial port option installed and a good cable to a PC serial port.

Edited: 23 Dec 2011, 6:42 p.m.


#14

Quote:
I've already seen one post where a new 41CL owner accidentally over-wrote some of his flash memory.

I saw that too. I think that happened because he wasn't aware that an erase would take out 8 pages of flash at a time. Hence the need to back up the 64K block that contains the ROM you want to update.

Quote:
Given my conservative mind-set when it comes to storage, the very first thing I want to do is COMPLETELY back up all of my flash to a PC so if I accidentally screw up, I can restore it to factory specs.

This would be nice too. I have the PIL-Box, which connects HP-IL to USB, and the ILPer software that will serve up a virtual LIF disk. One way to do it would be to map blocks of 7 pages into port memory (8 minus one for the HEPAX) and write them out to LIF. The HEPAX WRTROM will do contiguous pages. So you'd set up the mnemonics in extended memory or normal registers, and step through them seven at a time.

Quote:
Then I want to back up all my RAM just for the heck of it. Geoff has talked about this in some of his posts and I want to do that too before I start tinkering around.

I've done this using Geoff's procedure. You write the state of the calculator to flash. It involves erasing a section of user flash, which to me less hair raising than overwriting pieces of the library.

Quote:
P.S. I do have the 41CL serial port option installed and a good cable to a PC serial port.

I haven't installed mine yet. As far as I know, there's no software to drive the calculator end of things.


#15

Look at the description of the serial functions in the 41CL manual. There are also programs for linux and windows on the website.


If you aren't aware, there is also a 41CL wiki located at


http://www.wiki4hp.com/doku.php?id=41cl:replacement_cpu_board


with information generated by the Beta testers. All users are encouraged to contribute there themselves.

#16

The image mnemonics are hard-coded in YFNZ. Each mnemonic points to a specific physical address and "knows" the size of the image stored at that location.


All of the production boards contain an Image Database at address 0x0DF000, and I want to update YFNZ at some point to use this database. But I don't have a schedule for that yet. I also hope to add functions that will allow users to add mnemonics to the table.


#17

Quote:
Each mnemonic points to a specific physical address and "knows" the size of the image stored at that location.

But it would be OK to store back an updated ROM as long as the page count didn't change? (i.e. the "known" sizes are multiples of 4096.)

Quote:
All of the production boards contain an Image Database at address 0x0DF000, and I want to update YFNZ at some point to use this database. But I don't have a schedule for that yet. I also hope to add functions that will allow users to add mnemonics to the table.



That would be very cool. :)

I'm looking at Geoff's QRG for the beta. I assume that patching YFNS using the procedure there would be a bad idea? The version being patched is YFNS 1A, whereas YFNZ in the production board shows YFNS 2B in cat 2. (The table in the manual still has "yfnsX 1a for both ROMS.)


#18

Yes, you can store an updated (or different) image to Flash as long as the image type (size) doesn't change.


There is no need to patch -2B. All of those patches to the Beta versions are already applied to the release version.


The only reason you might want to mess with the -2B version would be to modify one of the polling points to select the 50x Turbo mode every time the calc is turned on. The instructions for doing this are available on the 41CL website. I don't recommend attempting to do this until you are familiar with working with the Flash.

#19

Yes, Flash is ERASED in sectors of 32k, that is 8x blocks of 4k each. So if you want to update CLUTLS (or any other ROM) you´ll have to have all the 8x blocks in RAM and do a YFWRT eight times.

That´s why typically the Flash update routines first copy to RAM those blocks that won't be updated as well before doing YERASE, since otherwise there'll be gone.

For instance, see the following script to re-flash sector 0x0F6. This assumes new versions of the 41Z, CLUTLS, and YFNS are already loaded in RAM, at locations 0x807, 0x80C, 0x80D, and 0x80E. Thus it first copies the other four in safe locations prior to YFERASEing the sector,and then proceeds to re-write all blocks back to the same locations.

You will have to modify the program below unless the exact same conditions apply.

Hope this helps, just make sure you're 150% sure that it all is safe to proceed and use a fresh set of batteries.

And one more things: CLUTLS 2F is ready - corrects a few glitches and changes the YFWALL/YFRALL destination to preserve the sector where the Solution Books roms are stored. You may want to use this version instead - let me know and I can send you the image file.

LBL "RFSC06" 	
TURBO50
"060>810 USPS page# 1
YMCPY
"061>811 USPS page# 2
YMCPY
"066>816 ALPHA ROM
YMCPY
"067>817 Astro-2010 - p#1
YMCPY
"060000"
YFERASE
"810>060
YFWR
"811>061
YFWR
"807>062 YFNZ 2B'
YFWR
"80D>063 41Z_L
YFWR
"80E>064 41Z_U
YFWR
"80C>062 CLUTILS 2E
YFWR
"816>066
YFWR
"817>067
YFWR
"YFNS"
PLUG1L
END


Edited: 24 Dec 2011, 10:54 a.m.


#20

Well, I went ahead and bit the bullet. I patched YFNS to XROM 15, and updated CLUT to CLUTILS 2E. The first part of the process is described in this document on the Wiki. However I refrained from patching anything other than the XROM number because it looked to me like the rest of the patch applied to an older version of YFNS. Monte's post confirmed this for me.

I had a bit of an adventure getting your newest CLUTILS onto my calculator though. I've mislaid the burner for my NoV64, which would have been the easiest way to get the bits onboard. What I resorted to was HEPAX + HPIL + PIL-Box. I converted the CLUTLS 2E ROM image to a packed 10 bit format using CLBIN41.EXE (part of JF's EMU41.) I then loaded it in EMU41 and wrote it to LIF using HEPAX's WRTROM. Over on the real calc, I read the image in with HEPAX's READROM. At this point I got a checksum error.

The ROM checksum isn't checked by the 41C's operating system, but the HEPAX complained, rightly or wrongly, that it was invalid. This is ironic since the first page of the HEPAX 1D module has an invalid checksum itself. But I was left wondering whether I had corrupted the image at some point during the transfer or if the checksum didn't actually match, or if HEPAX was crazy.

To resolve this, I decided to dump a disassembly of the ROM to my virtual IL console. I could then compare it to your source listing. Well, it turns out that the HEPAX DISASSEM command doesn't work on the CL for some reason. So I loaded the ZENROM and used MCED's disassembler. The process took a while, but I was left with a usable listing of the code. I grabbed the source code out of your "Blueprint" PDF and set about massaging the two so I could compare them.

Because the two listings used different mnemonics and were formatted very differently overall, I wrote a Perl script that found address offsets and the associated data in each. (I looked for patterns matching the page specific addresses plus 3 hex digits.) I produced two lists of these, one for each source listing. I then tried to compare the two. This was an adventure in chasing down subtle format differences and rationalizing other glitches. I finally decided that my image on the calculator contained the same bits that your listing contained.

Finally, back on the calculator, I followed the procedure you outlined above to update CLUTLS and a patched YFNS. I didn't know there was a new 41Z module, so here we go again. :) It should go much better with most of the wrinkles ironed out. I would very much like your updated CLUTLS. You can email me on gmail. I'm egbokalaka.

Thank you, and Merry Christmas!

Howard


#21

sorry you had to go through all that hassle! Truth is I never worry about the checksum byte, so… it´s never ¨correct¨.


#22

Nothing I do in pursuit of this hobby is ever a hassle! (I actually like writing text parsers in Perl, for example. :) Even if it were a hassle, the pleasure you have given me with your work over the years would far outweigh any trouble.

Thanks for the updated module!

Regards,
Howard


Possibly Related Threads...
Thread Author Replies Views Last Post
  DIY HP 30b WP 34s serial flash/programming cable Richard Wahl 2 265 12-04-2013, 11:14 AM
Last Post: Barry Mead
  HP-41CL setup troubleshooting Xavier A. (Brazil) 2 250 12-02-2013, 06:29 AM
Last Post: Xavier A. (Brazil)
  [41CL] New Extra Functions version Monte Dalrymple 0 151 11-08-2013, 04:32 PM
Last Post: Monte Dalrymple
  PRIME: re-format the flash drive to recover the operating system Harold A Climer 2 238 11-06-2013, 12:22 AM
Last Post: Michael de Estrada
  Bad Flash in HP Prime Han 11 515 09-27-2013, 12:38 PM
Last Post: Han
  So, latest 41CL / Library 4 config is... Gene Wright 4 297 09-22-2013, 02:59 AM
Last Post: Ángel Martin
  Flash Flood Warning: 9/16/2013 (One Week from HHC13) Eddie W. Shore 8 449 09-17-2013, 09:20 PM
Last Post: Craig Ruff
  HP-41CL anyone? Matt Agajanian 8 381 08-31-2013, 12:27 AM
Last Post: Sylvain Cote
  [41CL] A couple more rhetorical questions Monte Dalrymple 1 161 07-12-2013, 09:28 AM
Last Post: Ángel Martin
  41CL :TROUBLE IN FILE TRANsFER aurelio 22 916 06-18-2013, 03:44 PM
Last Post: aurelio

Forum Jump: