Post Reply 
41CL MMU Backup
05-30-2020, 06:47 PM
Post: #13
RE: 41CL MMU Backup
There is a chicken-and-egg problem no matter what you do:

Any code writing to Flash MUST be executed out of RAM, because Flash memory does not support simultaneous reading and writing. Flash writes require a SEQUENCE of write transactions on the bus, which requires that the CPU fetch a bunch of instructions to create the sequence. This sequence cannot be interleaved with instruction fetches, so the code doing the write MUST be resident in RAM.

In YFNZ, the way to make the code resident in RAM is to copy the entire image to a RAM page and then reprogram the MMU to use that page. Saving page 804, which contains the MMU registers, is going to capture this MMU reprogramming. So when this capture is restored YFNZ better be resident in RAM, in the same page as before, when you enable the MMU or you will be screwed. Or, you have to manually change the MMU back to point at the Flash version of YFNZ BEFORE you enable the MMU.

In YFNX, the code automatically copies a very small section (128 bytes) of code to RAM, reprograms the MMU to point Page 4 at this code, and then executes that code to do the Flash write. Once done, the MMU is reprogrammed back to what it was and the user is none the wiser. But the same problem still exists: this time it's the Page 4 MMU programming that is screwed up on the restore.
So in this case you have to manually change the MMU for Page 4, either to something innocuous (0000) or to point at Library-4 (8120).

In either case, only ONE location needs to be repaired, and everything else should be fine.

There IS a way to avoid these problems that I just thought of: Copy the entire page 804 to another page of RAM and THEN backup THAT copy. If you do this BEFORE you start the RAM version of YFNZ everything is fine. And everything is fine when using YFNX because you are again backing up a snapshot of Page 804 rather than the actual Page 804.

As far as determining what kind of Flash device you have, if you are running the latest version of YFNX, simply run "41CL" for a report on the size and organization of the Flash device on the board.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
41CL MMU Backup - twoweims - 05-28-2020, 10:15 PM
RE: 41CL MMU Backup - Monte Dalrymple - 05-29-2020, 04:07 PM
RE: 41CL MMU Backup - twoweims - 05-29-2020, 04:44 PM
RE: 41CL MMU Backup - Monte Dalrymple - 05-29-2020, 05:49 PM
RE: 41CL MMU Backup - twoweims - 05-29-2020, 08:50 PM
RE: 41CL MMU Backup - Monte Dalrymple - 05-29-2020, 10:09 PM
RE: 41CL MMU Backup - twoweims - 05-30-2020, 01:05 AM
RE: 41CL MMU Backup - Ángel Martin - 05-30-2020, 05:22 AM
RE: 41CL MMU Backup - twoweims - 05-30-2020, 02:32 PM
RE: 41CL MMU Backup - Ángel Martin - 05-30-2020, 03:45 PM
RE: 41CL MMU Backup - Ángel Martin - 05-31-2020, 06:09 AM
RE: 41CL MMU Backup - grsbanks - 05-30-2020, 08:27 AM
RE: 41CL MMU Backup - Ángel Martin - 05-30-2020, 03:52 PM
RE: 41CL MMU Backup - Monte Dalrymple - 05-30-2020 06:47 PM
RE: 41CL MMU Backup - rprosperi - 05-30-2020, 10:36 PM
RE: 41CL MMU Backup - Monte Dalrymple - 05-30-2020, 11:58 PM
RE: 41CL MMU Backup - rprosperi - 05-31-2020, 03:00 AM
RE: 41CL MMU Backup - Monte Dalrymple - 08-07-2021, 02:07 AM
RE: 41CL MMU Backup - Ángel Martin - 05-31-2020, 06:55 AM
RE: 41CL MMU Backup - Monte Dalrymple - 05-31-2020, 06:22 PM
RE: 41CL MMU Backup - twoweims - 05-30-2020, 08:26 PM
RE: 41CL MMU Backup - Monte Dalrymple - 05-30-2020, 10:07 PM
RE: 41CL MMU Backup - twoweims - 05-31-2020, 06:30 PM
RE: 41CL MMU Backup - rprosperi - 05-31-2020, 06:51 PM
RE: 41CL MMU Backup - twoweims - 05-31-2020, 07:44 PM
RE: 41CL MMU Backup - rprosperi - 05-31-2020, 08:09 PM
RE: 41CL MMU Backup - twoweims - 06-01-2020, 09:24 PM
RE: 41CL MMU Backup - Monte Dalrymple - 06-01-2020, 10:48 PM
RE: 41CL MMU Backup - twoweims - 06-01-2020, 11:48 PM
RE: 41CL MMU Backup - Monte Dalrymple - 06-02-2020, 01:42 AM
RE: 41CL MMU Backup - grsbanks - 06-04-2020, 07:14 PM
RE: 41CL MMU Backup - Monte Dalrymple - 06-04-2020, 08:50 PM



User(s) browsing this thread: 1 Guest(s)