The testflash is a ST reserved flash area that contains device information, flash parameters
and the boot code. This boot code contains the protocol for In-System Programming and the
TM
routines for E3
factory before shipping and cannot be erased or programmed in user mode.
The purpose of this document is to give an sufficiently accurate description of the testflash
content to allow the user to access to the different parameters and routines included in the
testflash.
After an overview of the testflash content, the document describes the different routines that
can be called at any time by the user code. The last part of this document provides guidelines
on the way to handle an E3
initialization and management. The testflash is programmed by ST at the
TM
failure.
1 GLOSSARY AND ACRONYMS
The terms, abbreviations and acronyms used in this document are listed below and described
in alphabetical order.
The structure of the TestFlash content is shown by the following figure:
Figure 1. ST9 TestFlash content
230000h
230020h
230023h
230026h
230029h
23002Ch
23002Fh
230032h
230035h
Vec t o r Table
Powe r-On
routine
Code Update routine
(in-system programming)
SCI Interrupt
routines
E3TM Initialization
TM
E3
Management
routines
E3TM Swap Error:
Find Wrong Pages
E3TM Swap Error:
Find Wrong Bytes in given Page
E3TM Swap Error:
Complete aborted Swap phase
E3TM Reset
to delivery status
230E80h
231E80h
231F78h
231F80h
231FFCh
Not Used
(4 Kbytes)
Reserved for Testing
(248 bytes)
Otp area
124 bytes
Protections
3/18
2
ST92F120/F124/150/F250 TESTFLASH
2.1 VECTOR TABLE
The first 16 words of the TestFlash contain the Vector Table.
The Power-On Vector is read when exiting from Reset. The Monitor Vector is read in Embedded Emulation Mode after an ETRAP instruction or an external Break. The NMI Vector is
read if a Non Maskable Interrupt occurs. The SCI Interrupt Vectors are used for the In-System
Programming routine.
Figure 2. Vector Table
Vector Table
230000h
230002h
230004h
230006h
230008h
23000Ah
230010h
230012h
230014h
230016h
Powe r-On Vector
Monitor Vector
NMI Vector
Mask Set Number
Device Identifier
TestFlash Code Revision
SCI Error Vector
SCI Address Match Vector
SCI Receiving End Vector
SCI Transmitting End Vector
2.1.1 Device identifier
This identifier contains the information about the device, its flash size and its reset vector location.
2.1.2 Testflash code revision
The CheckSum is the sum of all the bytes from 230000h to 230E77h, it can be used to verify
if the actual TestFlash content is the most recent one, or if the TestFlash content is corrupted.
The 124 bytes of TestFlash from 231F80h to 231FFBh are available to the User application as
One Time Programmable area (not erasable).
4/18
ST92F120/F124/150/F250 TESTFLASH
2.3 PROTECTIONS
The TestFlash locations shown by the following figure have a special meaning related to the
Access and Write Flash Protection features (refer to the datasheets).
Figure 3. Protection Map
Protection
231FFCh
231FFDh
231FFEhNVPWD0
NVAPR
NVWPR
NVPWD1231FFFh
5/18
ST92F120/F124/150/F250 TESTFLASH
3 ROUTINES DESCRIPTION
3.1 POWER-ON ROUTINE (230020H)
Inputs: None.
Outputs: R0, R1.
Variables: R2-R47, R160-R223 (for Stack).
Goal: to perform the initializations of ST9 device (Boot Code).
The Power-On routine is executed automatically when exiting reset.
The Power-On routine performs the following operations:
■ initialize the Stack Pointer in the Register File (for this reason, this routine modifies the
Registers of group A, B, C and D).
■ call the “E3
■ initialize the MMU paged registers as shown by the following table.
TM
Initialization routine“ (230026h).
Table 1. MMU Registers Initialization
RegisterValueSegNotes
DPR0 - R24000h0h1st 16k-page
DPR1 - R24101h0h2nd 16k-page
DPR2 - R24202h0h3rd 16k-page
DPR3 - R24380h20h1st 16k-page
ISR - R24800h0h
DMASR - R24920h20h
MPSR - R25021h21h
MDPR0 - R25184h21h1st 32k-page
MDPR1 - R25286h21h2nd 32k-page
■ Set bit MEMSEL (bit 4) in the R246 (EMR2) register page 21
■ Set the Register Page Pointer to page 0.
■ Set Group 0 as working registers.
■ Set Program Memory.
■ read in 000000h the first word of segment 0h (Flash Memory), that is interpreted as the
Power-On Vector of the User application. (Warning: if the device identifier is equal to 0080h,
the User Reset Vector is read in 01E000h instead of in 000000h).
6/18
Loading...
+ 12 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.