Maxim Integrated Secure Microcontroller User Manual

Page 32

Advertising
background image

Secure Microcontroller User’s Guide

32 of 187

If the device is in a nonpartitionable configuration, an extra step is required. To perform a soft reload of
the program in a nonpartitionable mode, the software must temporarily convert the microprocessor to a
partitionable mode using the access-enable bit (RPCTL.4). Setting the AE bit to a logic 1 converts the
DS5001/DS5002 into a partitionable mode for as long as it is set. This means that regardless of the
original setting, once AE = 1, the memory map is a 64kB partitionable mode. The partition is set to 1000h
(4kB) when AE = 1, so the loader routine must reside in this area. The user can then perform the soft
reload as previously discussed. When loading is complete, the software should clear the AE bit. Note that
AE requires software to use a timed-access procedure to alter it. This method allows a user to alter
program memory in a nonpartitionable mode. Data memory can be initialized by application software at
any time. Since full read/write access is available, no special provisions are needed.

Note: MOVX instructions using the data pointer as an operand must be used when executing a soft reload
(AE = 1) from any of the nonpartitionable memory modes. The use of MOVX instructions using R0 or
R1 as an operand does not write or read the correct address.

To summarize the soft reload for a DS5001/DS5002, the procedure goes as follows:

Partitionable Mode
1) Write a value to PA3–0 using a timed-access that gives access to the target area of memory.
2) Load new contents into program memory at addresses above the partition using MOVX instructions.
3) Define a new partition address if necessary and write the appropriate bits into PA3–0 in the MCON

SFR using a timed access.

4) Resume operation.

Nonpartitionable Mode
1) Set the AE bit to 1 using a timed-access procedure.
2) Load new contents into program memory at addresses above the partition (4kB) using MOVX

instructions.

3) Clear the AE bit using a timed-access procedure.
4) Resume operation.

The following illustrates an example where a soft reload is performed for a partitionable mode. The
original program requires a partition of 4000h (16kB). The new program is larger, requiring a partition of
A000h (40kB). A loader routine resides below address 1000h. The code that performs these steps is
shown below. Note that the timed-access procedure is performed, but is described in a later section.

MOV TA, #0Aah

; TIMED ACCESS

MOV TA, #55h

; TIMED ACCESS 2

MOV MCON, #00011000b ; SET PARTITION TO 1000h
.
. ; USER’S CODE TO LOAD RAM USING MOVX GOES HERE
.
MOV TA, #0Aah

; TIMED ACCESS

MOV TA, #55h

; TIMED ACCESS 2

MOV MCON, #10101000b ; LOAD NEW PARTITION OF A000h+

Advertising