5.2.4 SRAM Use
The RCM4510W module has a battery-backed data SRAM and a program-execution SRAM.
Dynamic C provides the
battery-backed SRAM. The compiler generates code that maintains two copies of each protected
variable in the battery-backed SRAM. The compiler also generates a flag to indicate which copy of
the protected variable is valid at the current time. This flag is also stored in the battery-backed
SRAM. When a protected variable is updated, the "inactive" copy is modified, and is made
"active" only when the update is 100% complete. This assures the integrity of the data in case a
reset or a power failure occurs during the update process. At power-on the application program
uses the active copy of the variable pointed to by its associated flag.
The sample code below shows how a protected variable is defined and how its value can be
restored.
main() {
protected int state1, state2, state3;
...
_sysIsSoftReset();
Additional information on
5.2.5 RCM4510W Cloning
The RCM4510W does not have a pull-up resistor on the PB1 (CLKA) line of the programming
port. Because of this, the procedure to generate clones from the RCM4510W differs from that
used for other RabbitCore modules and single-boards computers. You must set the
macro to 1 in the Dynamic C
MASTER_MODE
library to use the RCM4510W as a master for cloning. An RCM4510W master will not run the
application, and further debugging is not possible as long as the
macro is set to 1. Any cloned RCM4510W modules will be "sterile," meaning that they cannot be
used as a master for cloning. To develop and debug an application on an RCM4510W, comment
out the
CL_FORCE_MASTER_MODE
NOTE: Instead of defining this macro is your application, you may simply add the line CL_
FORCE_MASTER_MODE=1 under the Dynamic C Options > Project Options "Defines"
tab, then click OK. When you recompile your program, this will have the same effect as setting
the macro to 1 within the CLONECONFIG.LIB library.
See Technical Note TN207, Rabbit Cloning Board, for additional information on Rabbit's clon-
ing board and how cloning is done.
User's Manual
keyword to identify variables that are to be placed into the
protected
// restore any protected variables
variables is available in the Dynamic C User's Manual.
protected
LIB\Rabbit4000\BIOSLIB\CLONECONFIG.LIB
macro or set it to 0.
CL_FORCE_
CL_FORCE_MASTER_MODE
45
Need help?
Do you have a question about the RCM4500W and is the answer not in the manual?