nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

RAM Retention Example Application main file. More...

Macros

#define RAM_MEMORY_TEST_ADDRESS   (0x20002000UL)
 
#define RAM_MEMORY_TEST_WORD   (0xFEEDBEEFUL)
 
#define RESET_MEMORY_TEST_BYTE   (0x0DUL)
 
#define MAX_TEST_ITERATIONS   (1)
 
#define SUCCESS_OUTPUT_VALUE   (0xAB)
 
#define PIN_GPIO_WAKEUP   (7)
 

Functions

void HardFault_Handler ()
 Function for handling HardFaults. In case something went wrong or System OFF did not work and reached the end of the program.
 
static void gpio_config (void)
 Function for configuring I/O pins 8 - 16 as output, and pin 7 as wake up source.
 
static void display_failure (void)
 Function for indicating failure by turning on all LEDs.
 
int main (void)
 Function for application main entry.
 

Detailed Description

This file contains the source code for a sample application using RAM retention.

example_board_setup_a.jpg
Use board setup A for this example.

Macro Definition Documentation

#define RAM_MEMORY_TEST_ADDRESS   (0x20002000UL)

Address in RAM where test word (RAM_MEMORY_TEST_WORD) is written before System OFF and checked after System RESET.

#define RAM_MEMORY_TEST_WORD   (0xFEEDBEEFUL)

Test word that is written to RAM address RAM_MEMORY_TEST_ADDRESS.

#define RESET_MEMORY_TEST_BYTE   (0x0DUL)

Known sequence written to a special register to check if this wake up is from System OFF.

#define MAX_TEST_ITERATIONS   (1)

Maximum number of iterations this example will run.

#define SUCCESS_OUTPUT_VALUE   (0xAB)

If RAM retention is tested for MAX_TEST_ITERATIONS, this value will be given as output.

#define PIN_GPIO_WAKEUP   (7)

GPIO pin configured to wake up system from System OFF on falling edge. It can be connected to a button which is high when not pressed.