diff --git a/cmake/sample_defs/cpu1_platform_cfg.h b/cmake/sample_defs/cpu1_platform_cfg.h index a613f821b..9d8bf01f8 100644 --- a/cmake/sample_defs/cpu1_platform_cfg.h +++ b/cmake/sample_defs/cpu1_platform_cfg.h @@ -152,27 +152,25 @@ ** \cfesbcfg Highest Valid Message Id ** ** \par Description: -** The value of this constant dictates the size of the SB message map. The SB -** message map is a lookup table that provides the routing table index for -** fast access into the routing table. The default setting of 0x1FFF was chosen -** to save memory. This reduces the message map from 128Kbytes to 16Kbytes. -** See CFE_FSW_DCR 504 for more details. -** -** If this value is different in a distributed architecture some platforms may not -** be able to subscribe to messages generated on other platforms since the message id -** would exceed the mapping table's highest index. Care would have to be taken to ensure the -** constrained platform did not subscribe to message Ids that exceed -** CFE_PLATFORM_SB_HIGHEST_VALID_MSGID -** -** The recommended case to to have this value the same across all mission platforms -** -** \par Limits -** This parameter has a lower limit of 1 and an upper limit of 0xFFFF. Note -** for current implementations, V2/Extended headers assign 0xFFFFFFFF as the invalid -** message ID value, and default headers assigns 0xFFFF as the invalid value. This -** means for default headers, 0xFFFF is invalid even if you set the value -** below to it's maximum of 0xFFFF. -** The allocated message table is this size + 1 (could change based on implementaiton). +** The value of this constant dictates the range of valid message ID's, from 0 +** to CFE_PLATFORM_SB_HIGHEST_VALID_MSGID (inclusive). +** +** Altough this can be defined differently across platforms, each platform can +** only publish/subscribe to message ids within their allowable range. Typically +** this value is set the same across all mission platforms to avoid this complexity. +** +** \par Limits +** CFE_SB_INVALID_MSG is set to the maxumum representable number of type CFE_SB_MsgId_t. +** CFE_PLATFORM_SB_HIGHEST_VALID_MSGID lower limit is 1, up to CFE_SB_INVALID_MSG_ID - 1. +** +** When using the direct message map implementation for software bus routing, this +** value is used to size the map where a value of 0x1FFF results in a 16 KBytes map +** and 0xFFFF is 128 KBytes. +** +** When using the hash implementation for software bus routing, a multiple of the +** CFE_PLATFORM_SB_MAX_MSG_IDS is used to size the message map. In that case +** the range selected here does not impact message map memory use, so it's +** resonable to use up to the full range supported by the message ID implementation. */ #define CFE_PLATFORM_SB_HIGHEST_VALID_MSGID 0x1FFF diff --git a/fsw/cfe-core/src/sb/cfe_sb_verify.h b/fsw/cfe-core/src/sb/cfe_sb_verify.h index b14bc92c6..a328d406e 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_verify.h +++ b/fsw/cfe-core/src/sb/cfe_sb_verify.h @@ -58,8 +58,8 @@ #error CFE_PLATFORM_SB_HIGHEST_VALID_MSGID cannot be less than 1! #endif -#if CFE_PLATFORM_SB_HIGHEST_VALID_MSGID > 0xFFFF - #error CFE_PLATFORM_SB_HIGHEST_VALID_MSGID cannot be greater than 0xFFFF! +#if CFE_PLATFORM_SB_HIGHEST_VALID_MSGID > 0xFFFFFFFE + #error CFE_PLATFORM_SB_HIGHEST_VALID_MSGID cannot be > 0xFFFFFFFE #endif #if CFE_PLATFORM_SB_BUF_MEMORY_BYTES < 512