Maxim Integrated Secure Microcontroller User Manual

Page 30

Advertising
background image

Secure Microcontroller User’s Guide

30 of 187

that includes this loader routine. Once the partition is moved to this temporary location, the software
loader can reprogram new code as before.

When loading is complete, the partition must be either restored or set to a new value that is appropriate
for the new software. If the PA3–0 bits were not modified, the PAA bit can simply be cleared. This
restores the old partition. If the PAA3–0 were modified during loading or software has grown
significantly, a new partition is needed. The PA3–0 bits must be written while PAA is set to 1.

To summarize the soft reload, the procedure goes as follows:

1) Ensure that current program execution is in the range of 0000h to 0800h.
2) Set the PAA bit using a timed-access procedure.
3) Load new contents into program memory at addresses above 0800h using MOVX instructions.
4) Define a new partition address if necessary and write the appropriate bits into PA3–0 in the MCON

SFR.

5) Restore the current partition by clearing the PAA bit with a timed-access procedure.
6) Resume operation.

The following example illustrates the soft reload procedure. The original program requires a partition of
4000h (16kB). The new program is larger, requiring a partition of 6000h (24kB). The code that performs
these steps is shown below. This routine must be located below 0800h in program memory.

MOV TA, #0Aah

; TIMED ACCESS

MOV TA, #55h

; TIMED ACCESS 2

MOV MCON, #10001010b ; SET PAA BIT
.
. ; USER’S CODE TO LOAD RAM USING MOVX GOES HERE
.
MOV TA, #0Aah

; TIMED ACCESS

MOV TA, #55h

; TIMED ACCESS 2

MOV MCON, #11001000b ; LOAD NEW PARTITION AND CLEAR PAA BIT

Advertising