# HG changeset patch # User paul # Date 2016-06-30 14:03:42 # Node ID 16a2669a01ce0ebd8d579262e8b10678b334233b # Parent 3df41b40fc0623941a1927cefa73fce07b9c21e2 commit before going back to 3.1.0.2 for LESIA compilation diff --git a/.hgsubstate b/.hgsubstate --- a/.hgsubstate +++ b/.hgsubstate @@ -1,2 +1,2 @@ 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters -c378fa14eadd80b3b873ca7c8f9f387893c07692 header/lfr_common_headers +1ffa3d630b9ced4a87a362dafb10d9838e9cc0d9 header/lfr_common_headers diff --git a/FSW-qt/fsw-qt.pro b/FSW-qt/fsw-qt.pro --- a/FSW-qt/fsw-qt.pro +++ b/FSW-qt/fsw-qt.pro @@ -15,6 +15,8 @@ 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 diff --git a/FSW-qt/sparc.pri b/FSW-qt/sparc.pri --- a/FSW-qt/sparc.pri +++ b/FSW-qt/sparc.pri @@ -13,7 +13,8 @@ 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 +INCLUDEPATH += /opt/rtems-4.10/sparc-rtems/leon3/lib/include QMAKE_CFLAGS_DEBUG= -g QMAKE_CFLAGS_RELEASE="" @@ -61,15 +62,16 @@ contains( TEMPLATE, app ) { #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 +#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 diff --git a/header/fsw_misc.h b/header/fsw_misc.h --- a/header/fsw_misc.h +++ b/header/fsw_misc.h @@ -61,6 +61,7 @@ void get_temperatures( unsigned char *te void get_v_e1_e2_f3( unsigned char *spacecraft_potential ); void get_cpu_load( unsigned char *resource_statistics ); void set_hk_lfr_sc_potential_flag( bool state ); +void set_sy_lfr_pas_filter_enabled( bool state ); void set_sy_lfr_watchdog_enabled( bool state ); void set_hk_lfr_calib_enable( bool state ); void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause ); diff --git a/src/fsw_config.c b/src/fsw_config.c --- a/src/fsw_config.c +++ b/src/fsw_config.c @@ -1,25 +1,35 @@ #include +#include // GRSPW0 resources -struct drvmgr_key grlib_grspw_0n1_res[] = { +struct drvmgr_key grlib_grspw_0n1_res[] = +{ {"txBdCnt", KEY_TYPE_INT, {(unsigned int)50}}, // 7 SWF_F0, 7 SWF_F1, 7 SWF_F2, 7 CWF_F3, 7 CWF_F1 ou 7 CWF_F2 {"rxBdCnt", KEY_TYPE_INT, {(unsigned int)10}}, {"txDataSize", KEY_TYPE_INT, {(unsigned int)4096}}, {"txHdrSize", KEY_TYPE_INT, {(unsigned int)34}}, - {"rxPktSize", KEY_TYPE_INT, {(unsigned int)228+4}}, + {"rxPktSize", KEY_TYPE_INT, {(unsigned int)200}}, KEY_EMPTY }; // If RTEMS_DRVMGR_STARTUP is defined we override the "weak defaults" that is defined by the LEON3 BSP. -struct drvmgr_bus_res grlib_drv_resources = { - .next = NULL, - .resource = { +//struct drvmgr_bus_res grlib_drv_resources = +//{ +// .next = NULL, +// .resource = { +// {DRIVER_AMBAPP_GAISLER_GRSPW_ID, 0, &grlib_grspw_0n1_res[0]}, +// {DRIVER_AMBAPP_GAISLER_GRSPW_ID, 1, &grlib_grspw_0n1_res[0]}, +// RES_EMPTY /* Mark end of resource array */ +// } +//}; + +struct drvmgr_bus_res grlib_drv_resources = +{ + NULL, + { {DRIVER_AMBAPP_GAISLER_GRSPW_ID, 0, &grlib_grspw_0n1_res[0]}, -// {DRIVER_AMBAPP_GAISLER_APBUART_ID, 0, &grlib_drv_res_apbuart0[0]}, -// {DRIVER_AMBAPP_GAISLER_APBUART_ID, 1, &grlib_drv_res_apbuart1[0]}, - RES_EMPTY /* Mark end of device resource array */ + {DRIVER_AMBAPP_GAISLER_GRSPW_ID, 1, &grlib_grspw_0n1_res[0]}, + RES_EMPTY /* Mark end of resource array */ } }; - - diff --git a/src/fsw_init.c b/src/fsw_init.c --- a/src/fsw_init.c +++ b/src/fsw_init.c @@ -45,17 +45,21 @@ /* If --drvmgr was enabled during the configuration of the RTEMS kernel */ #ifdef RTEMS_DRVMGR_STARTUP - #ifdef LEON3 - /* Add Timer and UART Driver */ - #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER - #endif - #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART - #endif - #endif - #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */ - #include +#ifdef LEON3 +/* Add Timer and UART Driver */ + +#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER +#endif + +#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART +#endif + +#endif +#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */ + +#include #endif #include "fsw_init.h" diff --git a/src/fsw_misc.c b/src/fsw_misc.c --- a/src/fsw_misc.c +++ b/src/fsw_misc.c @@ -645,6 +645,18 @@ void set_hk_lfr_sc_potential_flag( bool } } +void set_sy_lfr_pas_filter_enabled( bool state ) +{ + if (state == true) + { + housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] | 0x20; // [0010 0000] + } + else + { + housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1] & 0xdf; // [1101 1111] + } +} + void set_sy_lfr_watchdog_enabled( bool state ) { if (state == true) diff --git a/src/fsw_spacewire.c b/src/fsw_spacewire.c --- a/src/fsw_spacewire.c +++ b/src/fsw_spacewire.c @@ -158,6 +158,7 @@ rtems_task recv_task( rtems_task_argumen PRINTF("in RECV *** packet lenght too short\n") } else { + PRINTF1("incoming TC with len: %d\n", len); estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> 8); currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength ); @@ -168,7 +169,7 @@ rtems_task recv_task( rtems_task_argumen || (parserCode == ILL_SUBTYPE) || (parserCode == WRONG_APP_DATA) || (parserCode == WRONG_SRC_ID) ) { // send TM_LFR_TC_EXE_CORRUPTED - PRINTF1("TC corrupted received, with code: %d\n", parserCode) + PRINTF1("TC corrupted received, with code: %d\n", parserCode); if ( !( (currentTC.serviceType==TC_TYPE_TIME) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_TIME) ) && !( (currentTC.serviceType==TC_TYPE_GEN) && (currentTC.serviceSubType==TC_SUBTYPE_UPDT_INFO)) diff --git a/src/tc_load_dump_parameters.c b/src/tc_load_dump_parameters.c --- a/src/tc_load_dump_parameters.c +++ b/src/tc_load_dump_parameters.c @@ -347,6 +347,7 @@ int action_load_filter_par(ccsdsTelecomm // store PAS filter parameters // sy_lfr_pas_filter_enabled filterPar.spare_sy_lfr_pas_filter_enabled = parameter_dump_packet.spare_sy_lfr_pas_filter_enabled; + set_sy_lfr_pas_filter_enabled( parameter_dump_packet.spare_sy_lfr_pas_filter_enabled & 0x01 ); // sy_lfr_pas_filter_modulus filterPar.sy_lfr_pas_filter_modulus = parameter_dump_packet.sy_lfr_pas_filter_modulus; // sy_lfr_pas_filter_tbad