diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -20,3 +20,4 @@ run2/src run2/trace run3/src run3/trace +*CMakeLists.txt.user diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required (VERSION 2.6) +project (LFR_FSW) + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING + "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) +endif(NOT CMAKE_BUILD_TYPE) + +set(LFR_BP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/LFR_basic-parameters/basic_parameters.c) + +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/sparc/") + +include_directories("header" + "header/lfr_common_headers" + "header/processing" + "LFR_basic-parameters" + "src") + +add_subdirectory(src) + + + +option(test "Build all tests." ON) # Makes boolean 'test' available. + + +if (test) + + +endif() diff --git a/FSW-qt/fsw-qt.pro b/FSW-qt/fsw-qt.pro deleted file mode 100644 --- a/FSW-qt/fsw-qt.pro +++ /dev/null @@ -1,125 +0,0 @@ -TEMPLATE = app -# CONFIG += console v8 sim -# CONFIG options = -# verbose -# boot_messages -# debug_messages -# cpu_usage_report -# stack_report -# vhdl_dev -# debug_tch -# lpp_dpu_destid /!\ REMOVE BEFORE DELIVERY TO LESIA /!\ -# debug_watchdog -CONFIG += console verbose lpp_dpu_destid cpu_usage_report -CONFIG -= qt - -include(./sparc.pri) - -INCLUDEPATH += /opt/rtems-4.10/sparc-rtems/leon3/lib/include - -# flight software version -SWVERSION=-1-0 -DEFINES += SW_VERSION_N1=3 # major -DEFINES += SW_VERSION_N2=1 # minor -DEFINES += SW_VERSION_N3=0 # patch -DEFINES += SW_VERSION_N4=4 # internal - -# -#QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage -#LIBS += -lgcov /opt/GCOV/01A/lib/overload.o -lc -# - -# -contains( CONFIG, lpp_dpu_destid ) { - DEFINES += LPP_DPU_DESTID -} -# - -contains( CONFIG, debug_tch ) { - DEFINES += DEBUG_TCH -} -DEFINES += MSB_FIRST_TCH - -contains( CONFIG, vhdl_dev ) { - DEFINES += VHDL_DEV -} - -contains( CONFIG, verbose ) { - DEFINES += PRINT_MESSAGES_ON_CONSOLE -} - -contains( CONFIG, debug_messages ) { - DEFINES += DEBUG_MESSAGES -} - -contains( CONFIG, cpu_usage_report ) { - DEFINES += PRINT_TASK_STATISTICS -} - -contains( CONFIG, stack_report ) { - DEFINES += PRINT_STACK_REPORT -} - -contains( CONFIG, boot_messages ) { - DEFINES += BOOT_MESSAGES -} - -contains( CONFIG, debug_watchdog ) { - DEFINES += DEBUG_WATCHDOG -} - -#doxygen.target = doxygen -#doxygen.commands = doxygen ../doc/Doxyfile -#QMAKE_EXTRA_TARGETS += doxygen - -TARGET = fsw - -INCLUDEPATH += \ - $${PWD}/../src \ - $${PWD}/../header \ - $${PWD}/../header/lfr_common_headers \ - $${PWD}/../header/processing \ - $${PWD}/../LFR_basic-parameters - -SOURCES += \ - ../src/wf_handler.c \ - ../src/tc_handler.c \ - ../src/fsw_misc.c \ - ../src/fsw_init.c \ - ../src/fsw_globals.c \ - ../src/fsw_spacewire.c \ - ../src/tc_load_dump_parameters.c \ - ../src/tm_lfr_tc_exe.c \ - ../src/tc_acceptance.c \ - ../src/processing/fsw_processing.c \ - ../src/processing/avf0_prc0.c \ - ../src/processing/avf1_prc1.c \ - ../src/processing/avf2_prc2.c \ - ../src/lfr_cpu_usage_report.c \ - ../LFR_basic-parameters/basic_parameters.c - -HEADERS += \ - ../header/wf_handler.h \ - ../header/tc_handler.h \ - ../header/grlib_regs.h \ - ../header/fsw_misc.h \ - ../header/fsw_init.h \ - ../header/fsw_spacewire.h \ - ../header/tc_load_dump_parameters.h \ - ../header/tm_lfr_tc_exe.h \ - ../header/tc_acceptance.h \ - ../header/processing/fsw_processing.h \ - ../header/processing/avf0_prc0.h \ - ../header/processing/avf1_prc1.h \ - ../header/processing/avf2_prc2.h \ - ../header/fsw_params_wf_handler.h \ - ../header/lfr_cpu_usage_report.h \ - ../header/lfr_common_headers/ccsds_types.h \ - ../header/lfr_common_headers/fsw_params.h \ - ../header/lfr_common_headers/fsw_params_nb_bytes.h \ - ../header/lfr_common_headers/fsw_params_processing.h \ - ../header/lfr_common_headers/tm_byte_positions.h \ - ../LFR_basic-parameters/basic_parameters.h \ - ../LFR_basic-parameters/basic_parameters_params.h \ - ../header/GscMemoryLPP.hpp - diff --git a/FSW-qt/fsw-qt.pro.user.cdbf9cd b/FSW-qt/fsw-qt.pro.user.cdbf9cd deleted file mode 100644 --- a/FSW-qt/fsw-qt.pro.user.cdbf9cd +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - true - 1 - true - 0 - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - Desktop-Qt 4.8.3 in PATH (System) - Desktop-Qt 4.8.3 in PATH (System) - {be73cf6a-f9d8-4d5a-8adf-adc2d83e2e44} - 0 - 0 - 0 - - - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - false - - false - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - -w - -r - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - true - - 1 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Deploy locally - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - fsw-qt - - Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro - - fsw-qt.pro - false - true - - 3768 - true - false - false - false - true - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.EnvironmentId - {cdbf9cdc-1e84-406e-889b-c4feef49e75c} - - - ProjectExplorer.Project.Updater.FileVersion - 15 - - diff --git a/FSW-qt/sparc.pri b/FSW-qt/sparc.pri deleted file mode 100644 --- a/FSW-qt/sparc.pri +++ /dev/null @@ -1,99 +0,0 @@ -CONFIG += console -CONFIG -= qt -QMAKE_CC=sparc-rtems-gcc -message(C compiler forced to: $$QMAKE_CC) -QMAKE_CXX=sparc-rtems-g++ -message(C++ compiler forced to: $$QMAKE_CXX) -QMAKE_AR=sparc-rtems-ar rcs -message(Archiver forced to: $$QMAKE_AR) -QMAKE_LINK=sparc-rtems-g++ -message(Linker forced to: $$QMAKE_LINK) -QMAKE_LINK_SHLIB=sparc-rtems-g++ -QMAKE_OBJCOPY= sparc-rtems-objcopy -QMAKE_STRIP=sparc-rtems-strip -QMAKE_GDB=sparc-rtems-gdb - -#INCLUDEPATH += /opt/rtems-4.10 -INCLUDEPATH += /opt/rtems-4.10/sparc-rtems/leon3/lib/include - -QMAKE_CFLAGS_DEBUG= -g -QMAKE_CFLAGS_RELEASE="" -QMAKE_CXXFLAGS_DEBUG= -g -QMAKE_CXXFLAGS_RELEASE="" -QMAKE_LFLAGS_RELEASE="" -QMAKE_LFLAGS_DEBUG= -g -QMAKE_CXXFLAGS_DEPS = -QMAKE_CXXFLAGS_WARN_ON = -Wall -QMAKE_CXXFLAGS_WARN_OFF = -w -QMAKE_CXXFLAGS_RELEASE = -QMAKE_CXXFLAGS_DEBUG = -QMAKE_CXXFLAGS_YACC = -QMAKE_CXXFLAGS_THREAD = -QMAKE_CXXFLAGS_RTTI_ON = -QMAKE_CXXFLAGS_RTTI_OFF = -QMAKE_CXXFLAGS_EXCEPTIONS_ON = -QMAKE_CXXFLAGS_EXCEPTIONS_OFF = -QMAKE_CFLAGS_WARN_ON = -Wall -QMAKE_CFLAGS_WARN_OFF = -w -QMAKE_CFLAGS_RELEASE = -QMAKE_CFLAGS_YACC = -QMAKE_LFLAGS_EXCEPTIONS_ON = -QMAKE_LFLAGS_EXCEPTIONS_OFF = -QMAKE_LFLAGS_RELEASE = -Xlinker -Map=output.map -QMAKE_LFLAGS_CONSOLE = -QMAKE_LFLAGS_WINDOWS = -QMAKE_LFLAGS_DLL = -QMAKE_INCDIR_QT = -QMAKE_INCDIR = -QMAKE_CFLAGS_SHLIB = -QMAKE_CFLAGS_STATIC_LIB = -QMAKE_CXXFLAGS_SHLIB = -QMAKE_CXXFLAGS_STATIC_LIB = -QMAKE_LIBS="" -INCLUDEPATH="" -DEFINES="" - -contains( TEMPLATE, app ) { - OBJECTS_DIR=obj - DESTDIR=bin -} - -#QMAKE_CFLAGS_RELEASE += -O0 -#QMAKE_CFLAGS_DEBUG += -O0 -#QMAKE_CXXFLAGS_RELEASE += -O0 -#QMAKE_CXXFLAGS_DEBUG += -O0 - -QMAKE_CFLAGS_RELEASE += -O3 -QMAKE_CFLAGS_DEBUG += -O3 -QMAKE_CXXFLAGS_RELEASE += -O3 -QMAKE_CXXFLAGS_DEBUG += -O3 - -#QMAKE_CFLAGS_RELEASE += -O3 -std=c99 -#QMAKE_CFLAGS_DEBUG += -O3 -std=c99 -#QMAKE_CXXFLAGS_RELEASE += -O3 -std=c99 -#QMAKE_CXXFLAGS_DEBUG += -O3 -std=c99 - -contains( TEMPLATE, app ) { - grmon.target = grmon - grmon.commands = cd $$DESTDIR && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u - QMAKE_EXTRA_TARGETS += grmon -} - - - - - - - - - - - - - - - - - - - diff --git a/sparc/sparc-rtems.cmake b/sparc/sparc-rtems.cmake new file mode 100644 --- /dev/null +++ b/sparc/sparc-rtems.cmake @@ -0,0 +1,8 @@ +set(CMAKE_SYSTEM_NAME rtems) + +set(CMAKE_C_COMPILER /opt/rtems-4.10/bin/sparc-rtems-gcc) +set(CMAKE_CXX_COMPILER /opt/rtems-4.10/bin/sparc-rtems-g++) +set(CMAKE_LINKER /opt/rtems-4.10/bin/sparc-rtems-g++) +SET(CMAKE_EXE_LINKER_FLAGS "-static") +set(CMAKE_C_LINK_EXECUTABLE " -o ") +include_directories("/opt/rtems-4.10/sparc-rtems/leon3/lib/include") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,72 @@ +cmake_minimum_required (VERSION 2.6) +project (FSW) + +include(sparc-rtems) + + +set(SOURCES wf_handler.c + tc_handler.c + fsw_misc.c + fsw_init.c + fsw_globals.c + fsw_spacewire.c + tc_load_dump_parameters.c + tm_lfr_tc_exe.c + tc_acceptance.c + processing/fsw_processing.c + processing/avf0_prc0.c + processing/avf1_prc1.c + processing/avf2_prc2.c + lfr_cpu_usage_report.c + ${LFR_BP_SRC} +) + + +option(verbose "Enable verbose LFR" ON) +option(boot_messages "Enable LFR boot messages" ON) +option(debug_messages "Enable LFR debug messages" ON) +option(cpu_usage_report "Enable LFR cpu usage report" OFF) +option(stack_report "Enable LFR stack report" OFF) +option(vhdl_dev "?" OFF) +option(lpp_dpu_destid "Set to debug at LPP" ON) +option(debug_watchdog "Enable debug watchdog" OFF) +option(debug_tch "?" OFF) + + +if (verbose) + add_definitions(-DPRINT_MESSAGES_ON_CONSOLE) +endif() +if (boot_messages) + add_definitions(-DBOOT_MESSAGES) +endif() +if (debug_messages) + add_definitions(-DDEBUG_MESSAGES) +endif() +if (cpu_usage_report) + add_definitions(-DPRINT_TASK_STATISTICS) +endif() +if (stack_report) + add_definitions(-DPRINT_STACK_REPORT) +endif() +if (vhdl_dev) + add_definitions(-DVHDL_DEV) +endif() +if (lpp_dpu_destid) + add_definitions(-DLPP_DPU_DESTID) +endif() +if (debug_watchdog) + add_definitions(-DDEBUG_WATCHDOG) +endif() +if (debug_tch) + add_definitions(-DDEBUG_TCH) +endif() + +add_definitions(-DMSB_FIRST_TCH) + +add_definitions(-DSWVERSION=-1-0) +add_definitions(-DSW_VERSION_N1=3) +add_definitions(-DSW_VERSION_N2=1) +add_definitions(-DSW_VERSION_N3=0) +add_definitions(-DSW_VERSION_N4=4) + +add_executable(FSW ${SOURCES}) diff --git a/src/fsw_init.c b/src/fsw_init.c --- a/src/fsw_init.c +++ b/src/fsw_init.c @@ -313,7 +313,7 @@ void init_local_mode_parameters( void ) BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max) BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max) - BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) + //BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) // init sequence counters