Skip to content

Commit 0648a47

Browse files
authored
Merge pull request #615 from nasa/integration-candidate
Integration Candidate 2020-04-08
2 parents 60a5f65 + 3b44a41 commit 0648a47

11 files changed

+138
-68
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ This repository contains NASA's Core Flight Executive (cFE), which is a framewor
77
This is a collection of services and associated framework to be located in the `cfe` subdirectory of a cFS Mission Tree. The Core Flight System is bundled at https://github.com/nasa/cFS, which includes build and execution instructions.
88

99
## Version Notes
10-
10+
- 6.7.13: DEVELOPMENT
11+
- RTEMS builds without error.
12+
- Use the INTERFACE_COMPILE_DEFINITIONS and INTERFACE_INCLUDE_DIRECTORIES properties from the osal target and apply them to the entire CFE build as a directory-scope property. No impact until these are set in OSAL.
13+
- Minor other updates (see https://github.com/nasa/cFE/pull/615)
1114
- 6.7.12: DEVELOPMENT
1215
- Cmd code (and checksum) are always in the same place (matches GSFC spec for command secondary header)
1316
- No impact to behavior. Previously the perf log dump file frequently contained errors due to out of order or otherwise corrupted entries, which is now fixed.

cmake/arch_build.cmake

+14
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,20 @@ function(process_arch SYSVAR)
339339
include_directories(${MISSION_SOURCE_DIR}/cfe/fsw/cfe-core/src/inc)
340340
include_directories(${MISSION_SOURCE_DIR}/cfe/cmake/target/inc)
341341

342+
# propagate any OSAL interface compile definitions and include directories to this build
343+
# This is set as a directory property here at the top level so it will apply to all code.
344+
# This includes MODULE libraries that do not directly/statically link with OSAL but still
345+
# should be compiled with these flags.
346+
get_target_property(OSAL_COMPILE_DEFINITIONS osal INTERFACE_COMPILE_DEFINITIONS)
347+
get_target_property(OSAL_INCLUDE_DIRECTORIES osal INTERFACE_INCLUDE_DIRECTORIES)
348+
349+
if (OSAL_COMPILE_DEFINITIONS)
350+
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS "${OSAL_COMPILE_DEFINITIONS}")
351+
endif (OSAL_COMPILE_DEFINITIONS)
352+
if (OSAL_INCLUDE_DIRECTORIES)
353+
include_directories(${OSAL_INCLUDE_DIRECTORIES})
354+
endif (OSAL_INCLUDE_DIRECTORIES)
355+
342356
# Append the PSP and OSAL selections to the Doxyfile so it will be included
343357
# in the generated documentation automatically.
344358
# Also extract the "-D" options within CFLAGS and inform Doxygen about these

cmake/sample_defs/toolchain-i686-rtems4.11.cmake

+43-21
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,41 @@
1010
# the pc-rtems PSP.
1111

1212
# Basic cross system configuration
13-
SET(RTEMS_TOOLS_TOP "/opt/rtems-4.11")
14-
SET(RTEMS_BSP_TOP "/opt/x-tools/rtems-4.11" CACHE PATH "Rtems install directory")
13+
set(CMAKE_SYSTEM_NAME RTEMS)
14+
set(CMAKE_SYSTEM_PROCESSOR i386)
15+
set(CMAKE_SYSTEM_VERSION 4.11)
1516

16-
SET(CMAKE_SYSTEM_NAME RTEMS)
17-
SET(CMAKE_SYSTEM_VERSION 1)
18-
SET(CMAKE_SYSTEM_PROCESSOR i686)
17+
# The TOOLS and BSP are allowed to be installed in different locations.
18+
# If the README was followed they will both be installed under $HOME
19+
# By default it is assumed the BSP is installed to the same directory as the tools
20+
SET(RTEMS_TOOLS_PREFIX "$ENV{HOME}/rtems-${CMAKE_SYSTEM_VERSION}" CACHE PATH
21+
"RTEMS tools install directory")
22+
SET(RTEMS_BSP_PREFIX "${RTEMS_TOOLS_PREFIX}" CACHE PATH
23+
"RTEMS BSP install directory")
1924

20-
# specify the cross compiler
21-
SET(CMAKE_C_COMPILER ${RTEMS_TOOLS_TOP}/bin/i386-rtems4.11-gcc)
22-
SET(CMAKE_CXX_COMPILER ${RTEMS_TOOLS_TOP}/bin/i386-rtems4.11-g++)
23-
SET(CMAKE_LINKER ${RTEMS_TOOLS_TOP}/bin/i386-rtems4.11-ld)
25+
# The BSP that will be used for this build
26+
set(RTEMS_BSP "pc686")
2427

25-
# where is the target environment
26-
SET(CMAKE_FIND_ROOT_PATH ${RTEMS_TOOLS_TOP}/i386-rtems4.11
27-
${RTEMS_TOOLS_TOP}/lib/gcc/i386-rtems4.11/4.8.2 ${RTEMS_BSP_TOP}/i386-rtems4.11/pc686)
28+
# specify the cross compiler - adjust accord to compiler installation
29+
# This uses the compiler-wrapper toolchain that buildroot produces
30+
SET(SDKHOSTBINDIR "${RTEMS_TOOLS_PREFIX}/bin")
31+
set(TARGETPREFIX "${CMAKE_SYSTEM_PROCESSOR}-rtems${CMAKE_SYSTEM_VERSION}-")
32+
set(RTEMS_BSP_C_FLAGS "-march=i686 -mtune=i686 -fno-common")
33+
set(RTEMS_BSP_CXX_FLAGS ${RTEMS_BSP_C_FLAGS})
34+
35+
SET(CMAKE_C_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}gcc")
36+
SET(CMAKE_CXX_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}g++")
37+
SET(CMAKE_LINKER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ld")
38+
SET(CMAKE_ASM_COMPILER "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}as")
39+
SET(CMAKE_STRIP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}strip")
40+
SET(CMAKE_NM "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}nm")
41+
SET(CMAKE_AR "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}ar")
42+
SET(CMAKE_OBJDUMP "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objdump")
43+
SET(CMAKE_OBJCOPY "${RTEMS_TOOLS_PREFIX}/bin/${TARGETPREFIX}objcopy")
44+
45+
# Note that CEXP is not a shared library loader - it will not support code compiled with -fPIC
46+
# Also exception handling is very iffy. These two options disable eh_frame creation.
47+
set(CMAKE_C_COMPILE_OPTIONS_PIC -fno-exceptions -fno-asynchronous-unwind-tables)
2848

2949
# search for programs in the build host directories
3050
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
@@ -41,14 +61,16 @@ SET(CFE_SYSTEM_PSPNAME pc-rtems)
4161
SET(OSAL_SYSTEM_BSPTYPE pc-rtems)
4262
SET(OSAL_SYSTEM_OSTYPE rtems)
4363

44-
# Forces the "Init" symbol to be undefined so it can be defined in a library
45-
SET(CFE_ENTRY_SYM Init)
46-
47-
SET(CMAKE_C_FLAGS_INIT "-march=i686 -B${RTEMS_BSP_TOP}/i386-rtems4.11/pc686/lib"
48-
CACHE STRING "C Flags required by platform")
64+
# Info regarding the RELOCADDR:
65+
#+--------------------------------------------------------------------------+
66+
#| Set the value of RELOCADDR to the address where you want your image to
67+
#| load. If you'll be using GRUB to load the images it will have to be >=
68+
#| 0x100000 (1024K). If you are using NetBoot to load the images it can be
69+
#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory
70+
#| top is of course another limit. Make sure there is enough space before the
71+
#| upper memory limits for the image and the memory allocated by it to fit.
72+
#| Make sure the value you choose is aligned to 4 bytes.
73+
#+--------------------------------------------------------------------------+
74+
set(RTEMS_RELOCADDR 0x00100000)
4975

50-
# For RTEMS also install rtems-grub.cfg that allows booting using QEMU
51-
macro(target_add_hook TGTNAME)
52-
install(FILES ${MISSION_DEFS}/${TGTNAME}_rtems-grub.cfg DESTINATION ${TGTNAME} RENAME rtems-grub.cfg)
53-
endmacro()
5476

fsw/cfe-core/src/inc/cfe_sb.h

+23
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@
5555

5656
#define CFE_SB_INVALID_MSG_ID 0xFFFF /**< \brief Initializer for #CFE_SB_MsgId_t values that will not match any real MsgId */
5757

58+
/**
59+
* \defgroup CFESBPktTypeDefs cFE SB Packet Type Defines
60+
* \{
61+
*/
62+
#define CFE_SB_PKTTYPE_INVALID 0 /**< \brief #CFE_SB_GetPktType response if message type can not be determined */
63+
#define CFE_SB_PKTTYPE_CMD 1 /**< \brief #CFE_SB_GetPktType response for command packets */
64+
#define CFE_SB_PKTTYPE_TLM 2 /**< \brief #CFE_SB_GetPktType response for telemetry packets */
65+
/** \} */
66+
5867
/*
5968
** Macro Definitions
6069
*/
@@ -1358,6 +1367,20 @@ static inline CFE_SB_MsgId_t CFE_SB_ValueToMsgId(CFE_SB_MsgId_Atom_t MsgIdValue)
13581367
{
13591368
return MsgIdValue;
13601369
}
1370+
1371+
/*****************************************************************************/
1372+
/**
1373+
* \brief Identifies packet type given message ID
1374+
*
1375+
* Provides the packet type associated with the given message ID
1376+
*
1377+
* \return Packet type
1378+
* \retval #CFE_SB_PKTTYPE_CMD Command packet type
1379+
* \retval #CFE_SB_PKTTYPE_TLM Telemetry packet type
1380+
* \retval #CFE_SB_PKTTYPE_INVALID Invalid/unknown packet type
1381+
*/
1382+
uint32 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId);
1383+
13611384
/**@}*/
13621385

13631386
#endif /* _cfe_sb_ */

fsw/cfe-core/src/inc/cfe_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
*/
9696
#define CFE_MAJOR_VERSION 6
9797
#define CFE_MINOR_VERSION 7
98-
#define CFE_REVISION 12
98+
#define CFE_REVISION 13
9999

100100

101101
#endif /* _cfe_version_ */

fsw/cfe-core/src/sb/cfe_sb_api.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,7 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,
12961296
RtgTblPtr = CFE_SB_GetRoutePtrFromIdx(RtgTblIdx);
12971297

12981298
/* For Tlm packets, increment the seq count if requested */
1299-
if((CFE_SB_GetPktType(MsgId)==CFE_SB_TLM) &&
1299+
if((CFE_SB_GetPktType(MsgId)==CFE_SB_PKTTYPE_TLM) &&
13001300
(TlmCntIncrements==CFE_SB_INCREMENT_TLM)){
13011301
RtgTblPtr->SeqCnt++;
13021302
CFE_SB_SetMsgSeqCnt((CFE_SB_Msg_t *)BufDscPtr->Buffer,

fsw/cfe-core/src/sb/cfe_sb_msg_id_util.c

+37-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
** combination of bits from the primary header SID (StreamId) and the secondary header APID Qualifiers
3434
**
3535
** Implementation is based on CCSDS Space Packet Protocol 133.0.B-1 with Technical Corrigendum 2, September 2012
36-
** The extended secondary header is expected in an upcoming revision of 133.0.B-1
36+
** Multi-mission Interoperable extended secondary headers should be registered in Space
37+
** Assigned Numbers Authority (SANA). The process for SANA registration is documented in
38+
** 133.0.B-2. Mission specific headers need not be registered
3739
**
3840
** For MESSAGE_FORMAT_IS_CCSDS_VER_2 the default setup will combine:
3941
** 1 bit for the command/telemetry flag
@@ -185,3 +187,37 @@ void CFE_SB_SetMsgId(CFE_SB_MsgPtr_t MsgPtr,
185187

186188
#endif
187189
}/* end CFE_SB_SetMsgId */
190+
191+
/*
192+
* Function: CFE_SB_GetPktType - See API and header file for details
193+
*/
194+
uint32 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId)
195+
{
196+
197+
CFE_SB_MsgId_Atom_t Val = MsgId;
198+
uint8 PktType;
199+
200+
if (CFE_SB_IsValidMsgId(MsgId))
201+
{
202+
#ifndef MESSAGE_FORMAT_IS_CCSDS_VER_2
203+
if (CFE_TST(Val,12))
204+
{
205+
PktType = CFE_SB_PKTTYPE_CMD;
206+
} else {
207+
PktType = CFE_SB_PKTTYPE_TLM;
208+
}
209+
#else
210+
if (CFE_SB_RD_TYPE_FROM_MSGID(Val) == 1)
211+
{
212+
PktType = CFE_SB_PKTTYPE_CMD;
213+
} else {
214+
PktType = CFE_SB_PKTTYPE_TLM;
215+
}
216+
#endif /* MESSAGE_FORMAT_IS_CCSDS_VER_2 */
217+
} else {
218+
PktType = CFE_SB_PKTTYPE_INVALID;
219+
}
220+
221+
return PktType;
222+
223+
}/* end CFE_SB_GetPktType */

fsw/cfe-core/src/sb/cfe_sb_priv.c

-30
Original file line numberDiff line numberDiff line change
@@ -659,36 +659,6 @@ char *CFE_SB_GetAppTskName(uint32 TaskId,char *FullName){
659659

660660
}/* end CFE_SB_GetAppTskName */
661661

662-
663-
/******************************************************************************
664-
** Function: CFE_SB_GetPktType()
665-
**
666-
** Purpose:
667-
** For CCSDS packets, this function returns the state of the cmd/tlm bit(12).
668-
** For cmd pkts, the state is 1. For tlm pkts, the state is 0.
669-
**
670-
** Arguments:
671-
**
672-
** Return:
673-
** None
674-
*/
675-
uint8 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId)
676-
{
677-
678-
#ifdef MESSAGE_FORMAT_IS_CCSDS
679-
CFE_SB_MsgId_Atom_t Val = MsgId;
680-
681-
#ifndef MESSAGE_FORMAT_IS_CCSDS_VER_2
682-
return CFE_TST(Val,12);
683-
#else
684-
return CFE_SB_RD_TYPE_FROM_MSGID(Val);
685-
#endif /* MESSAGE_FORMAT_IS_CCSDS_VER_2 */
686-
687-
#endif /* MESSAGE_FORMAT_IS_CCSDS */
688-
689-
}/* end CFE_SB_GetPktType */
690-
691-
692662
/******************************************************************************
693663
** Function: CFE_SB_RequestToSendEvent()
694664
**

fsw/cfe-core/src/sb/cfe_sb_priv.h

-4
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@
6363
#define CFE_SB_GLOBAL 0
6464
#define CFE_SB_LOCAL 1
6565

66-
#define CFE_SB_TLM 0
67-
#define CFE_SB_CMD 1
68-
6966
#define CFE_SB_SEND_ZEROCOPY 0
7067
#define CFE_SB_SEND_ONECOPY 1
7168

@@ -391,7 +388,6 @@ int32 CFE_SB_ZeroCopyReleaseAppId(uint32 AppId);
391388
int32 CFE_SB_DecrBufUseCnt(CFE_SB_BufferD_t *bd);
392389
int32 CFE_SB_ValidateMsgId(CFE_SB_MsgId_t MsgId);
393390
int32 CFE_SB_ValidatePipeId(CFE_SB_PipeId_t PipeId);
394-
uint8 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId);
395391
void CFE_SB_IncrCmdCtr(int32 status);
396392
void CFE_SB_FileWriteByteCntErr(const char *Filename,uint32 Requested,uint32 Actual);
397393
void CFE_SB_SetSubscriptionReporting(uint32 state);

fsw/cfe-core/unit-test/CMakeLists.txt

+6-9
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ foreach(MODULE ${CFE_CORE_MODULES})
4242

4343
# Compile the unit(s) under test as an object library
4444
# this allows easy configuration of special flags and include paths
45-
# in particular this should use the UT_C_FLAGS for coverage instrumentation
45+
# in particular this should use the UT_COVERAGE_COMPILE_FLAGS for coverage instrumentation
4646
add_library(ut_${UT_TARGET_NAME}_object OBJECT
4747
${CFE_MODULE_FILES})
4848

49-
# Apply the UT_C_FLAGS to the units under test
49+
# Apply the UT_COVERAGE_COMPILE_FLAGS to the units under test
5050
# This should enable coverage analysis on platforms that support this
51-
set_target_properties(ut_${UT_TARGET_NAME}_object PROPERTIES
52-
COMPILE_FLAGS "${UT_C_FLAGS}")
51+
target_compile_options(ut_${UT_TARGET_NAME}_object PRIVATE ${UT_COVERAGE_COMPILE_FLAGS})
5352

5453
# For this object target only, the "override" includes should be injected
5554
# into the include path BEFORE any other include path. This is so the
@@ -61,16 +60,14 @@ foreach(MODULE ${CFE_CORE_MODULES})
6160
${MODULE}_UT.c
6261
$<TARGET_OBJECTS:ut_${UT_TARGET_NAME}_object>)
6362

63+
# Also add the UT_COVERAGE_LINK_FLAGS to the link command
64+
# This should enable coverage analysis on platforms that support this
6465
target_link_libraries(${UT_TARGET_NAME}_UT
66+
${UT_COVERAGE_LINK_FLAGS}
6567
ut_${CFE_CORE_TARGET}_support
6668
ut_cfe-core_stubs
6769
ut_assert)
6870

69-
# Also add the C FLAGS to the link command
70-
# This should enable coverage analysis on platforms that support this
71-
set_target_properties(${UT_TARGET_NAME}_UT PROPERTIES
72-
LINK_FLAGS "${UT_C_FLAGS}")
73-
7471
add_test(${UT_TARGET_NAME}_UT ${UT_TARGET_NAME}_UT)
7572
install(TARGETS ${UT_TARGET_NAME}_UT DESTINATION ${TGTNAME}/${UT_INSTALL_SUBDIR})
7673
endforeach(MODULE ${CFE_CORE_MODULES})

fsw/cfe-core/ut-stubs/ut_sb_stubs.c

+9
Original file line numberDiff line numberDiff line change
@@ -873,3 +873,12 @@ void CFE_SB_SetTotalMsgLength (CFE_SB_MsgPtr_t MsgPtr,uint16 TotalLength)
873873
UT_Stub_CopyFromLocal(UT_KEY(CFE_SB_SetTotalMsgLength), &TotalLength, sizeof(TotalLength));
874874
}
875875

876+
uint32 CFE_SB_GetPktType(CFE_SB_MsgId_t MsgId)
877+
{
878+
int32 status;
879+
880+
status = UT_DEFAULT_IMPL(CFE_SB_GetPktType);
881+
882+
return status;
883+
}
884+

0 commit comments

Comments
 (0)