English
Language : 

CYRF69213_13 Datasheet, PDF (22/86 Pages) Cypress Semiconductor – Programmable Radio on Chip Low Power
CYRF69213
executed, plus three. If either of the keys do not match the
expected values, the M8C halts (with the exception of the
SWBootReset function). The following code puts the correct
value in KEY1 and KEY2. The code starts with a halt, to force the
program to jump directly into the setup code and not run into it.
halt
SSCOP: mov [KEY1], 3ah
mov X, SP
mov A, X
add A, 3
mov [KEY2], A
Table 25. SROM Function Parameters
Variable Name
Key1/Counter/Return Code
Key2/TMP
BlockID
Pointer
Clock
SRAM Address
0,F8h
0,F9h
0,FAh
0,FBh
0,FCh
Mode
Delay
PCL
0,FDh
0,FEh
0,FFh
The SROM also features Return Codes and Lockouts.
Return Codes
Return codes aid in the determination of success or failure of a
particular function. The return code is stored in KEY1’s position
in the parameter block. The CheckSum and TableRead functions
do not have return codes because KEY1’s position in the
parameter block is used to return other data.
SROM Function Descriptions
All SROM functions are described in the following sections.
SWBootReset Function
The SROM function, SWBootReset, is the function that is
responsible for transitioning the device from a reset state to
running user code. The SWBootReset function is executed
whenever the SROM is entered with an M8C accumulator value
of 00h; the SRAM parameter block is not used as an input to the
function. This happens, by design, after a hardware reset,
because the M8C's accumulator is reset to 00h or when user
code executes the SSC instruction with an accumulator value of
00h. The SWBootReset function does not execute when the
SSC instruction is executed with a bad key value and a nonzero
function code. A CYRF69213 device executes the HALT
instruction if a bad value is given for either KEY1 or KEY2.
The SWBootReset function verifies the integrity of the calibration
data by way of a 16-bit checksum, before releasing the M8C to
run user code.
ReadBlock Function
The ReadBlock function is used to read 64 contiguous bytes
from Flash — a block.
The first thing this function does is to check the protection bits
and determine if the desired BLOCKID is readable. If read
protection is turned on, the ReadBlock function exits, setting the
accumulator and KEY2 back to 00h. KEY1 has a value of 01h,
indicating a read failure. If read protection is not enabled, the
function reads 64 bytes from the Flash using a ROMX instruction
and store the results in SRAM using an MVI instruction. The first
of the 64 bytes is stored in SRAM at the address indicated by the
value of the POINTER parameter. When the ReadBlock
completes successfully, the accumulator, KEY1, and KEY2 all
have a value of 00h.
Table 26. SROM Return Codes
Return Code
Description
00h
Success
01h
Function not allowed due to level of protection
on block
02h
Software reset without hardware reset
03h
Fatal error, SROM halted
Read, write, and erase operations may fail if the target block is
read or write protected. Block protection levels are set during
device programming.
The EraseAll function overwrites data in addition to leaving the
entire user Flash in the erase state. The EraseAll function loops
through the number of Flash macros in the product, executing
the following sequence: erase, bulk program all zeros, erase.
After all the user space in all the Flash macros are erased, a
second loop erases and then programs each protection block
with zeros.
Table 27. ReadBlock Parameters
Name
KEY1
KEY2
BLOCKID
POINTER
Address
0,F8h
0,F9h
0,FAh
0,FBh
Description
3Ah
Stack Pointer value, when SSC is
executed
Flash block number
First of 64 addresses in SRAM where
returned data should be stored
WriteBlock Function
The WriteBlock function is used to store data in the Flash. Data
is moved 64 bytes at a time from SRAM to Flash using this
function. The first thing the WriteBlock function does is to check
the protection bits and determine if the desired BLOCKID is
writable. If write protection is turned on, the WriteBlock function
exits, setting the accumulator and KEY2 back to 00h. KEY1 has
a value of 01h, indicating a write failure. The configuration of the
WriteBlock function is straightforward. The BLOCKID of the
Flash block, where the data is stored, must be determined and
stored at SRAM address FAh.
Document Number: 001-07552 Rev. *H
Page 22 of 86