Version 3 (Anthony Rowe, 05/10/2007 06:29 pm) → Version 4/13 (Anthony Rowe, 06/08/2007 07:03 pm)

= Static Configuration (nrk_cfg.h) =

Given the memory constraints of embedded sensor operating systems, Nano-RK uses a
static design-time framework. This approach is consistent with sensor networking assumptions
because as compared to traditional operating systems (where processes can
be dynamically spawned), the OS and the applications are co-located in a single address
space. In particular, admission control and real-time schedulability analysis tests
are carried out offline as compared to taking a dynamic online approach. We would
like to stress that a static approach does not mean that task properties and configuration
parameters cannot be reconfigured during run-time. Rather, a static approach enforces
the checks to ensure that the dynamic reconfiguration does not adversely affect application
and system guarantees in a pre-deployment offline setting as compared to running
dynamic admission control algorithms. Data (or control) dependent modifications to
the task code such as changing task periods, resource usage limits, resource priorities
and configuration of various parameters such as the network buffer sizes and stack
sizes of each task can be changed to accommodate mode changes. With current energy
and memory constraints, the run-time configurations will need to be verified offline at

Many of the static parameters are defined in nrk_cfg.h

// NRK_REPORT_ERRORS will cause the kernel to print out information about
// missed deadlines or reserve violations

// NRK_HALT_ON_ERRORS will cause the kernel to freeze on errors so that
// it is easier to see debugging messages.

// NRK_HALT_AND_LOOP_ON_ERRORS will cause the kernel to freeze on errors but
// unlike NRK_HALT_ON_ERROR, the kernel panic msg will continously be printed out.

// NRK_STACK_CHECK adds a little check to see if the bottom of the stack
// has been over written on all suspend calls

// Leave NRK_NO_POWER_DOWN define in if the target can not wake up from sleep
// because it has no asynchronously clocked

#define NRK_MAX_TASKS 2

// Max number of tasks in your application
// Be sure to include the idle task
// Making this the correct size will save on BSS memory which
// is both RAM and ROM...


// NRK_MAX_RESOURCE_CNT defines the number Number of semaphores in system tasks. You need at least the system.
// If you don't use any semaphores, set this to 0. Be sure that libraries
// you are using do not require semaphores. These should be stated in any
// documenation that comes with them.

idle task

// Idle task stack size min=32
// Used as a default for application tasks
// Size of kernel stack


A sample nrk_cfg.h that configures the static parameters for a particular
project. This includes stack sizes, number of resources, error handling etc.
Make sure tomake clean when you change any parameters in header files
or moved from another project directory.

| [wiki:nrk-api Contents] | [wiki:nrk-api-time-management Time Management] |