11.12.1 Specifying the Security Model

The application security model (including the sizes of various secure segments in FLASH, RAM, and EEDATA) can be specified in two ways:

  1. In source code using #pragma config for the FBS, FSS, FGS configuration words.
  2. Using linker command options (see 9.6 Options that Specify CodeGuard Security Features).

    If both methods are used to provide conflicting information, the linker will issue a diagnostic. Likewise, a diagnostic will be issued if a security model is specified that can not be supported by the target device. The security model will be encoded by the linker into the executable file as contents for the FBS, FSS, and FGS configuration words.

    A summary of CodeGuard Security options and segment sizes is written to the link map file. For example:

    Selected CodeGuard Options:
      FBS:BSS:STRD_SMALL_BOOT_CODE
      FSS:SSS:STRD_SMALL_SEC_CODE
    CodeGuard FLASH Memory:
      boot    0x100 to 0x3fe
      secure  0x400 to 0x1ffe
      general 0x2000 to 0x17ffe
    CodeGuard RAM Memory:
      general 0x800 to 0x279f
      secure  (none)
      boot    (none)