Upper level wants me to update an older F1 design to use external Flash instead of external EPROM. They want to stay with the F1 because of the already debugged assembly code. I want to use the bootstrap mode to get the code into the uninitialized Flash in locations $8000-$FFFF; I assume the Config register is also in an unknown state. After loading the 1024 bytes into the internal RAM and starting at location 0, I assume I have to switch over to Special Test Mode to be able to turn EEON off so I can program Flash between $FE00 and $FFFF. I can turn also turn RBOOT off to program Flash between $BF00 and $BFFF. I can also program the CONFIG register to set EEON off for the next reset. The question I have is if I leave RBOOT on in Special Test Mode and enable interrupts, will the vectors in RBOOT be used, or will the uninitialized vectors in external Flash $BFC0-$BFFF be used? Mike |
|
Special Bootstrap/Test Mode and RBOOT
Started by ●November 5, 2004
Reply by ●November 5, 20042004-11-05
----- Original Message ----- From: "Michael Huslig" <> To: < > The question I have is if I leave RBOOT on in Special Test Mode and enable > interrupts, will the vectors in RBOOT be used, or will the uninitialized > vectors in external Flash $BFC0-$BFFF be used? The vectors will be fetched from the memory currently active. So, with Boot ROM disabled you will not be able to use interrupts unless you first program the appropriate range in the external memory with your own code. On the other hand, as you already noted, turning on the Boot ROM creates a hole in your external memory. > Mike |
Reply by ●November 6, 20042004-11-06
--- In , "Michael Huslig" <mhuslig@k...> wrote: > Upper level wants me to update an older F1 design to use external > Flash instead of external EPROM. They want to stay with the F1 > because of the already debugged assembly code. > > I want to use the bootstrap mode to get the code into the > uninitialized Flash in locations $8000-$FFFF; I assume the Config > register is also in an unknown state. After loading the 1024 > bytes into the internal RAM and starting at location 0, I assume I > have to switch over to Special Test Mode to be able to turn EEON > off so I can program Flash between $FE00 and $FFFF. I can turn > also turn RBOOT off to program Flash between $BF00 and $BFFF. I > can also program the CONFIG register to set EEON off for the next > reset. > > The question I have is if I leave RBOOT on in Special Test Mode > and enable interrupts, will the vectors in RBOOT be used, or will > the uninitialized vectors in external Flash $BFC0-$BFFF be used? Tony's response to your question is essentially complete and correct, I have just one more thing to mention. I *think* that the HC11 will 'write thru' any existing internal resource when an external bus is used. What I mean by 'write thru' is that a write operation performed in a region of the memory map where an internal resource is present (be it RAM, ROM, EEPROM, control registers, etc.) will appear on the external bus as a write operation as well. Thus, you could - at least in theory - keep the bootstrap ROM (and EEPROM) enabled in the memory map while you perform your FLASH programming operation, as long as your programming routine does not attempt to READ any region where an internal resource is mapped. The downside of this is that you will not be able to read-verify those regions of the FLASH where internal resources are mapped. Your best bet is to construct your bootloaded FLASH programming routine such that it writes appropriate values to the HPRIO and CONFIG registers on startup that turn off RBOOT and EEON, and configure the device for a 'special-test-like' mode. Some time ago, I wrote a HC11 application that could erase/program a 29F010 FLASH device - single sectors or entire device - via the SCI, that would accept S-record data. Everything you needed to do could be accomplished (once the app was started) with a terminal emulator that provided a ASCII transfer mode. The entire program (barely) fit into 512 bytes so it could be run out of a E-series internal EEPROM. Given that the F1 provides a fairly generous 1K of internal RAM to work with, it should not be difficult to make a bootloaded program that could program your FLASH using direct S-record input. Good luck. -- Mark |