##// END OF EJS Templates
Bug 801 Don_Initialisation_P2
Bug 801 Don_Initialisation_P2

File last commit:

r320:6303d998f250 R3_plus
r320:6303d998f250 R3_plus
Show More
fsw_misc.c
995 lines | 36.3 KiB | text/x-c | CLexer
paul
Minor changes in .h inclusion
r45 /** General usage functions and RTEMS tasks.
*
* @file
* @author P. LEROY
*
*/
paul
Header files inclusion reworked...
r40 #include "fsw_misc.h"
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5
paul
STAT task removec...
r239 void timer_configure(unsigned char timer, unsigned int clock_divider,
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 unsigned char interrupt_level, rtems_isr (*timer_isr)() )
paul
Minor changes in .h inclusion
r45 {
/** This function configures a GPTIMER timer instantiated in the VHDL design.
*
* @param gptimer_regs points to the APB registers of the GPTIMER IP core.
* @param timer is the number of the timer in the IP core (several timers can be instantiated).
* @param clock_divider is the divider of the 1 MHz clock that will be configured.
* @param interrupt_level is the interrupt level that the timer drives.
* @param timer_isr is the interrupt subroutine that will be attached to the IRQ driven by the timer.
*
* Interrupt levels are described in the SPARC documentation sparcv8.pdf p.76
*
*/
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 rtems_status_code status;
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 rtems_isr_entry old_isr_handler;
paul
Bug #801 Don_Initialisation_P2
r320 old_isr_handler = NULL;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 gptimer_regs->timer[timer].ctrl = INIT_CHAR; // reset the control register
paul
SM simulator functionnal...
r100
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels
paul
Last commit before release 0-13...
r35 if (status!=RTEMS_SUCCESSFUL)
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 {
paul
Last commit before release 0-13...
r35 PRINTF("in configure_timer *** ERR rtems_interrupt_catch\n")
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 }
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5
paul
STAT task removec...
r239 timer_set_clock_divider( timer, clock_divider);
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 }
paul
STAT task removec...
r239 void timer_start(unsigned char timer)
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 {
paul
Minor changes in .h inclusion
r45 /** This function starts a GPTIMER timer.
*
* @param gptimer_regs points to the APB registers of the GPTIMER IP core.
* @param timer is the number of the timer in the IP core (several timers can be instantiated).
*
*/
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_CLEAR_IRQ;
gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_LD;
gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_EN;
gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_RS;
gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_IE;
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 }
paul
STAT task removec...
r239 void timer_stop(unsigned char timer)
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 {
paul
Minor changes in .h inclusion
r45 /** This function stops a GPTIMER timer.
*
* @param gptimer_regs points to the APB registers of the GPTIMER IP core.
* @param timer is the number of the timer in the IP core (several timers can be instantiated).
*
*/
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & GPTIMER_EN_MASK;
gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & GPTIMER_IE_MASK;
gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | GPTIMER_CLEAR_IRQ;
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 }
paul
STAT task removec...
r239 void timer_set_clock_divider(unsigned char timer, unsigned int clock_divider)
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 {
paul
Minor changes in .h inclusion
r45 /** This function sets the clock divider of a GPTIMER timer.
*
* @param gptimer_regs points to the APB registers of the GPTIMER IP core.
* @param timer is the number of the timer in the IP core (several timers can be instantiated).
* @param clock_divider is the divider of the 1 MHz clock that will be configured.
*
*/
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 gptimer_regs->timer[timer].reload = clock_divider; // base clock frequency is 1 MHz
}
paul
STAT task removec...
r239 // WATCHDOG
rtems_isr watchdog_isr( rtems_vector_number vector )
{
rtems_status_code status_code;
status_code = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_12 );
paul
sy_lfr_watchdog_enabled handled...
r262
PRINTF("watchdog_isr *** this is the end, exit(0)\n");
exit(0);
paul
STAT task removec...
r239 }
void watchdog_configure(void)
{
/** This function configure the watchdog.
*
* @param gptimer_regs points to the APB registers of the GPTIMER IP core.
* @param timer is the number of the timer in the IP core (several timers can be instantiated).
*
* The watchdog is a timer provided by the GPTIMER IP core of the GRLIB.
*
*/
LEON_Mask_interrupt( IRQ_GPTIMER_WATCHDOG ); // mask gptimer/watchdog interrupt during configuration
timer_configure( TIMER_WATCHDOG, CLKDIV_WATCHDOG, IRQ_SPARC_GPTIMER_WATCHDOG, watchdog_isr );
LEON_Clear_interrupt( IRQ_GPTIMER_WATCHDOG ); // clear gptimer/watchdog interrupt
}
void watchdog_stop(void)
{
LEON_Mask_interrupt( IRQ_GPTIMER_WATCHDOG ); // mask gptimer/watchdog interrupt line
timer_stop( TIMER_WATCHDOG );
LEON_Clear_interrupt( IRQ_GPTIMER_WATCHDOG ); // clear gptimer/watchdog interrupt
}
void watchdog_reload(void)
{
/** This function reloads the watchdog timer counter with the timer reload value.
*
paul
EDAC information fetching functions added.
r251 * @param void
*
* @return void
paul
STAT task removec...
r239 *
*/
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 gptimer_regs->timer[TIMER_WATCHDOG].ctrl = gptimer_regs->timer[TIMER_WATCHDOG].ctrl | GPTIMER_LD;
paul
STAT task removec...
r239 }
void watchdog_start(void)
{
/** This function starts the watchdog timer.
*
* @param gptimer_regs points to the APB registers of the GPTIMER IP core.
* @param timer is the number of the timer in the IP core (several timers can be instantiated).
*
*/
LEON_Clear_interrupt( IRQ_GPTIMER_WATCHDOG );
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 gptimer_regs->timer[TIMER_WATCHDOG].ctrl = gptimer_regs->timer[TIMER_WATCHDOG].ctrl | GPTIMER_CLEAR_IRQ;
gptimer_regs->timer[TIMER_WATCHDOG].ctrl = gptimer_regs->timer[TIMER_WATCHDOG].ctrl | GPTIMER_LD;
gptimer_regs->timer[TIMER_WATCHDOG].ctrl = gptimer_regs->timer[TIMER_WATCHDOG].ctrl | GPTIMER_EN;
gptimer_regs->timer[TIMER_WATCHDOG].ctrl = gptimer_regs->timer[TIMER_WATCHDOG].ctrl | GPTIMER_IE;
paul
STAT task removec...
r239
LEON_Unmask_interrupt( IRQ_GPTIMER_WATCHDOG );
}
paul
Snapshot resynchro rewritten, drift is measured one snapshot in two...
r253 int enable_apbuart_transmitter( void ) // set the bit 1, TE Transmitter Enable to 1 in the APBUART control register
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 {
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
paul
Sync
r95 apbuart_regs->ctrl = APBUART_CTRL_REG_MASK_TE;
paul
Minor changes
r94
return 0;
}
paul
Header files inclusion reworked...
r40 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value)
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 {
paul
Header files inclusion reworked...
r40 /** This function sets the scaler reload register of the apbuart module
*
* @param regs is the address of the apbuart registers in memory
* @param value is the value that will be stored in the scaler register
*
* The value shall be set by the software to get data on the serial interface.
*
*/
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
apbuart_regs->scaler = value;
paul
Snapshot resynchro rewritten, drift is measured one snapshot in two...
r253
paul
Last commit before release 0-13...
r35 BOOT_PRINTF1("OK *** apbuart port scaler reload register set to 0x%x\n", value)
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 }
//************
// RTEMS TASKS
paul
STAT task removec...
r239 rtems_task load_task(rtems_task_argument argument)
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 {
paul
STAT task removec...
r239 BOOT_PRINTF("in LOAD *** \n")
rtems_status_code status;
unsigned int i;
unsigned int j;
rtems_name name_watchdog_rate_monotonic; // name of the watchdog rate monotonic
rtems_id watchdog_period_id; // id of the watchdog rate monotonic period
paul
Bug #801 Don_Initialisation_P2
r320 watchdog_period_id = RTEMS_ID_NONE;
paul
STAT task removec...
r239 name_watchdog_rate_monotonic = rtems_build_name( 'L', 'O', 'A', 'D' );
status = rtems_rate_monotonic_create( name_watchdog_rate_monotonic, &watchdog_period_id );
if( status != RTEMS_SUCCESSFUL ) {
PRINTF1( "in LOAD *** rtems_rate_monotonic_create failed with status of %d\n", status )
}
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 i = 0;
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 j = 0;
paul
STAT task removec...
r239
watchdog_configure();
watchdog_start();
paul
sy_lfr_watchdog_enabled handled...
r262 set_sy_lfr_watchdog_enabled( true );
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 while(1){
paul
STAT task removec...
r239 status = rtems_rate_monotonic_period( watchdog_period_id, WATCHDOG_PERIOD );
watchdog_reload();
i = i + 1;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 if ( i == WATCHDOG_LOOP_PRINTF )
paul
STAT task removec...
r239 {
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 i = 0;
paul
STAT task removec...
r239 j = j + 1;
PRINTF1("%d\n", j)
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 }
paul
sync before modifying the snapshot resynchronization
r246 #ifdef DEBUG_WATCHDOG
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 if (j == WATCHDOG_LOOP_DEBUG )
paul
STAT task removec...
r239 {
status = rtems_task_delete(RTEMS_SELF);
}
paul
sync before modifying the snapshot resynchronization
r246 #endif
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 }
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5 }
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
rtems_task hous_task(rtems_task_argument argument)
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 {
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 rtems_status_code status;
paul
Many corrections done after Logiscope analysis
r166 rtems_status_code spare_status;
paul
Last commit before release 0-13...
r35 rtems_id queue_id;
paul
rev 1.0.0.2...
r104 rtems_rate_monotonic_period_status period_status;
paul
Bug #803 Tr_BoucleSortie...
r319 bool isSynchronized;
paul
Bug #801 Don_Initialisation_P2
r320 queue_id = RTEMS_ID_NONE;
memset(&period_status, 0, sizeof(rtems_rate_monotonic_period_status));
paul
Bug #803 Tr_BoucleSortie...
r319 isSynchronized = false;
paul
packet emission task added...
r33
paul
fsw-1-0...
r82 status = get_message_queue_id_send( &queue_id );
paul
Last commit before release 0-13...
r35 if (status != RTEMS_SUCCESSFUL)
{
paul
fsw-1-0...
r82 PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status)
paul
Last commit before release 0-13...
r35 }
paul
ASM restart sequence updated at the interrupt service routine level...
r259 BOOT_PRINTF("in HOUS ***\n");
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17
paul
Ignore doc files...
r46 if (rtems_rate_monotonic_ident( name_hk_rate_monotonic, &HK_id) != RTEMS_SUCCESSFUL) {
status = rtems_rate_monotonic_create( name_hk_rate_monotonic, &HK_id );
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 if( status != RTEMS_SUCCESSFUL ) {
paul
ASM restart sequence updated at the interrupt service routine level...
r259 PRINTF1( "rtems_rate_monotonic_create failed with status of %d\n", status );
paul@pc-solar1.lab-lpp.local
Updates of the ICD taken into account...
r18 }
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 }
status = rtems_rate_monotonic_cancel(HK_id);
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 if( status != RTEMS_SUCCESSFUL ) {
paul
ASM restart sequence updated at the interrupt service routine level...
r259 PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_cancel(HK_id) ***code: %d\n", status );
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
else {
paul
ASM restart sequence updated at the interrupt service routine level...
r259 DEBUG_PRINTF("OK *** in HOUS *** rtems_rate_monotonic_cancel(HK_id)\n");
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 }
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
paul
rev 1.0.0.2...
r104 // startup phase
status = rtems_rate_monotonic_period( HK_id, SY_LFR_TIME_SYN_TIMEOUT_in_ticks );
status = rtems_rate_monotonic_get_status( HK_id, &period_status );
DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state)
paul
Bug #803 Tr_BoucleSortie...
r319 while( (period_status.state != RATE_MONOTONIC_EXPIRED)
&& (isSynchronized == false) ) // after SY_LFR_TIME_SYN_TIMEOUT ms, starts HK anyway
paul
rev 1.0.0.2...
r104 {
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 if ((time_management_regs->coarse_time & VAL_LFR_SYNCHRONIZED) == INT32_ALL_0) // check time synchronization
paul
rev 1.0.0.2...
r104 {
paul
Bug #803 Tr_BoucleSortie...
r319 isSynchronized = true;
paul
rev 1.0.0.2...
r104 }
else
{
status = rtems_rate_monotonic_get_status( HK_id, &period_status );
paul
Many corrections, mainly related to #807 Don_Enumeration
r318
status = rtems_task_wake_after( HK_SYNC_WAIT ); // wait HK_SYNCH_WAIT 100 ms = 10 * 10 ms
paul
rev 1.0.0.2...
r104 }
}
status = rtems_rate_monotonic_cancel(HK_id);
DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state)
paul
reset cause set to POWER_ON, no other value
r280 set_hk_lfr_reset_cause( POWER_ON );
paul
correction de Bug #514, lfr_reset_cause = power_on
r226
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 while(1){ // launch the rate monotonic task
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 status = rtems_rate_monotonic_period( HK_id, HK_PERIOD );
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 if ( status != RTEMS_SUCCESSFUL ) {
paul
priority modifications...
r50 PRINTF1( "in HOUS *** ERR period: %d\n", status);
paul
Many corrections done after Logiscope analysis
r166 spare_status = rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 );
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 }
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23 else {
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.packetSequenceControl[BYTE_0] = (unsigned char) (sequenceCounterHK >> SHIFT_1_BYTE);
housekeeping_packet.packetSequenceControl[BYTE_1] = (unsigned char) (sequenceCounterHK );
paul
Bug #117
r149 increment_seq_counter( &sequenceCounterHK );
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.time[BYTE_0] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_3_BYTES);
housekeeping_packet.time[BYTE_1] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_2_BYTES);
housekeeping_packet.time[BYTE_2] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_1_BYTE);
housekeeping_packet.time[BYTE_3] = (unsigned char) (time_management_regs->coarse_time);
housekeeping_packet.time[BYTE_4] = (unsigned char) (time_management_regs->fine_time >> SHIFT_1_BYTE);
housekeeping_packet.time[BYTE_5] = (unsigned char) (time_management_regs->fine_time);
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
paul
modifications following #634:...
r279 spacewire_update_hk_lfr_link_state( &housekeeping_packet.lfr_status_word[0] );
paul
spacewire statistics management modified...
r264 spacewire_read_statistics();
paul@pc-solar1.lab-lpp.local
All modes implemented for the waveforms...
r23
paul
spacewire statistics management modified...
r264 update_hk_with_grspw_stats();
paul
snapshot synchronization slightly upgraded...
r263
paul
hk_lfr_time_not_synchro is updated each time the synchro is lost....
r249 set_hk_lfr_time_not_synchro();
paul
fifo occupation reported in the HK packet
r197 housekeeping_packet.hk_lfr_q_sd_fifo_size_max = hk_lfr_q_sd_fifo_size_max;
housekeeping_packet.hk_lfr_q_rv_fifo_size_max = hk_lfr_q_rv_fifo_size_max;
housekeeping_packet.hk_lfr_q_p0_fifo_size_max = hk_lfr_q_p0_fifo_size_max;
housekeeping_packet.hk_lfr_q_p1_fifo_size_max = hk_lfr_q_p1_fifo_size_max;
housekeeping_packet.hk_lfr_q_p2_fifo_size_max = hk_lfr_q_p2_fifo_size_max;
paul
R2 parameter added to TC_LFR_LOAD_COMMON_PAR...
r195 housekeeping_packet.sy_lfr_common_parameters_spare = parameter_dump_packet.sy_lfr_common_parameters_spare;
housekeeping_packet.sy_lfr_common_parameters = parameter_dump_packet.sy_lfr_common_parameters;
paul
2.0.2.1
r185 get_temperatures( housekeeping_packet.hk_lfr_temp_scm );
get_v_e1_e2_f3( housekeeping_packet.hk_lfr_sc_v_f3 );
paul
cpu_load added to the housekeeping packets
r134 get_cpu_load( (unsigned char *) &housekeeping_packet.hk_lfr_cpu_load );
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129
paul
#601 corrected: hk_lfr_le_me_he_update moved
r261 hk_lfr_le_me_he_update();
paul
ICD 4.1 taken into account
r283 housekeeping_packet.hk_lfr_sc_rw_f_flags = cp_rpw_sc_rw_f_flags;
paul
SID corrected in TM_LFR_TC_EXE packets...
r31 // SEND PACKET
paul
New version of the waveform picker packet transmission...
r172 status = rtems_message_queue_send( queue_id, &housekeeping_packet,
paul
Ignore doc files...
r46 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
paul
packet emission task added...
r33 if (status != RTEMS_SUCCESSFUL) {
paul
priority modifications...
r50 PRINTF1("in HOUS *** ERR send: %d\n", status)
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 }
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21 }
}
paul@pc-solar1.lab-lpp.local
Naming convention changed...
r5
paul@pc-solar1.lab-lpp.local
automatic reconnexion of the spacewire link...
r17 PRINTF("in HOUS *** deleting task\n")
paul@pc-solar1.lab-lpp.local
Current version with modes NORMAL and SBM1 operational
r21
status = rtems_task_delete( RTEMS_SELF ); // should not return
paul
printf removed or replaced by PRINTF macros...
r227
paul
Minor changes in .h inclusion
r45 return;
paul@pc-solar1.lab-lpp.local
fsw-0-2 delivery to LESIA...
r16 }
paul
AVGV task added...
r298 rtems_task avgv_task(rtems_task_argument argument)
{
#define MOVING_AVERAGE 16
rtems_status_code status;
unsigned int v[MOVING_AVERAGE];
unsigned int e1[MOVING_AVERAGE];
unsigned int e2[MOVING_AVERAGE];
float average_v;
float average_e1;
float average_e2;
unsigned char k;
unsigned char indexOfOldValue;
BOOT_PRINTF("in AVGV ***\n");
if (rtems_rate_monotonic_ident( name_avgv_rate_monotonic, &HK_id) != RTEMS_SUCCESSFUL) {
status = rtems_rate_monotonic_create( name_avgv_rate_monotonic, &AVGV_id );
if( status != RTEMS_SUCCESSFUL ) {
PRINTF1( "rtems_rate_monotonic_create failed with status of %d\n", status );
}
}
status = rtems_rate_monotonic_cancel(AVGV_id);
if( status != RTEMS_SUCCESSFUL ) {
PRINTF1( "ERR *** in AVGV *** rtems_rate_monotonic_cancel(AVGV_id) ***code: %d\n", status );
}
else {
DEBUG_PRINTF("OK *** in AVGV *** rtems_rate_monotonic_cancel(AVGV_id)\n");
}
// initialize values
k = 0;
indexOfOldValue = MOVING_AVERAGE - 1;
for (k = 0; k < MOVING_AVERAGE; k++)
{
v[k] = 0;
e1[k] = 0;
e2[k] = 0;
average_v = 0.;
average_e1 = 0.;
average_e2 = 0.;
}
k = 0;
while(1){ // launch the rate monotonic task
status = rtems_rate_monotonic_period( AVGV_id, AVGV_PERIOD );
if ( status != RTEMS_SUCCESSFUL ) {
PRINTF1( "in AVGV *** ERR period: %d\n", status);
}
else {
// store new value in buffer
v[k] = waveform_picker_regs->v;
e1[k] = waveform_picker_regs->e1;
e2[k] = waveform_picker_regs->e2;
if (k == (MOVING_AVERAGE - 1))
{
indexOfOldValue = 0;
}
else
{
indexOfOldValue = k + 1;
}
average_v = average_v + v[k] - v[indexOfOldValue];
average_e1 = average_e1 + e1[k] - e1[indexOfOldValue];
average_e2 = average_e2 + e2[k] - e2[indexOfOldValue];
}
if (k == (MOVING_AVERAGE-1))
{
k = 0;
printf("tick\n");
}
else
{
k++;
}
}
PRINTF("in AVGV *** deleting task\n")
status = rtems_task_delete( RTEMS_SELF ); // should not return
return;
}
paul
Minor changes in .h inclusion
r45 rtems_task dumb_task( rtems_task_argument unused )
paul
packet emission task added...
r33 {
paul
Minor changes in .h inclusion
r45 /** This RTEMS taks is used to print messages without affecting the general behaviour of the software.
*
* @param unused is the starting argument of the RTEMS task
*
* The DUMB taks waits for RTEMS events and print messages depending on the incoming events.
*
*/
paul
Last commit before release 0-13...
r35
paul
Minor changes in .h inclusion
r45 unsigned int i;
unsigned int intEventOut;
unsigned int coarse_time = 0;
unsigned int fine_time = 0;
rtems_event_set event_out;
paul
packet emission task added...
r33
paul
Bug #801 Don_Initialisation_P2
r320 event_out = EVENT_SETS_NONE_PENDING;
paul
Minor modifications to meet Logiscope requirements
r77
paul
Minor changes in .h inclusion
r45 BOOT_PRINTF("in DUMB *** \n")
paul
Last commit before release 0-13...
r35
paul
Minor changes in .h inclusion
r45 while(1){
paul
HK emission using the directive...
r55 rtems_event_receive(RTEMS_EVENT_0 | RTEMS_EVENT_1 | RTEMS_EVENT_2 | RTEMS_EVENT_3
paul
the function asm_reorganize format the spectral matrix to the ICD format
r103 | RTEMS_EVENT_4 | RTEMS_EVENT_5 | RTEMS_EVENT_6 | RTEMS_EVENT_7
paul
ASM restart sequence updated at the interrupt service routine level...
r259 | RTEMS_EVENT_8 | RTEMS_EVENT_9 | RTEMS_EVENT_12 | RTEMS_EVENT_13
| RTEMS_EVENT_14,
paul
Minor changes in .h inclusion
r45 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT
intEventOut = (unsigned int) event_out;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 for ( i=0; i<NB_RTEMS_EVENTS; i++)
paul
Commit before working on the ERR 4 due to message queue...
r34 {
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 if ( ((intEventOut >> i) & 1) != 0)
paul
Last commit before release 0-13...
r35 {
paul
Minor changes in .h inclusion
r45 coarse_time = time_management_regs->coarse_time;
fine_time = time_management_regs->fine_time;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 if (i==EVENT_12)
paul
1.0.0.7...
r135 {
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 PRINTF1("%s\n", DUMB_MESSAGE_12)
paul
1.0.0.7...
r135 }
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 if (i==EVENT_13)
paul
timecode handling modified:...
r248 {
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 PRINTF1("%s\n", DUMB_MESSAGE_13)
paul
timecode handling modified:...
r248 }
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 if (i==EVENT_14)
paul
ASM restart sequence updated at the interrupt service routine level...
r259 {
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 PRINTF1("%s\n", DUMB_MESSAGE_1)
paul
ASM restart sequence updated at the interrupt service routine level...
r259 }
paul
Commit before working on the ERR 4 due to message queue...
r34 }
}
paul
packet emission task added...
r33 }
}
paul
Commit before working on the ERR 4 due to message queue...
r34
paul
Ignore doc files...
r46 //*****************************
// init housekeeping parameters
paul
Commit before working on the ERR 4 due to message queue...
r34
paul
Ignore doc files...
r46 void init_housekeeping_parameters( void )
{
/** This function initialize the housekeeping_packet global variable with default values.
*
*/
unsigned int i = 0;
paul
ICD 2.0...
r92 unsigned char *parameters;
paul
fifo occupation reported in the HK packet
r197 unsigned char sizeOfHK;
paul
Commit before working on the ERR 4 due to message queue...
r34
paul
fifo occupation reported in the HK packet
r197 sizeOfHK = sizeof( Packet_TM_LFR_HK_t );
parameters = (unsigned char*) &housekeeping_packet;
for(i = 0; i< sizeOfHK; i++)
paul
Ignore doc files...
r46 {
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 parameters[i] = INIT_CHAR;
paul
Ignore doc files...
r46 }
paul
fifo occupation reported in the HK packet
r197
housekeeping_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
housekeeping_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
housekeeping_packet.reserved = DEFAULT_RESERVED;
housekeeping_packet.userApplication = CCSDS_USER_APP;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.packetID[0] = (unsigned char) (APID_TM_HK >> SHIFT_1_BYTE);
paul
fifo occupation reported in the HK packet
r197 housekeeping_packet.packetID[1] = (unsigned char) (APID_TM_HK);
housekeeping_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
housekeeping_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> SHIFT_1_BYTE);
paul
fifo occupation reported in the HK packet
r197 housekeeping_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
housekeeping_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
housekeeping_packet.serviceType = TM_TYPE_HK;
housekeeping_packet.serviceSubType = TM_SUBTYPE_HK;
housekeeping_packet.destinationID = TM_DESTINATION_ID_GROUND;
housekeeping_packet.sid = SID_HK;
paul
Ignore doc files...
r46 // init status word
housekeeping_packet.lfr_status_word[0] = DEFAULT_STATUS_WORD_BYTE0;
housekeeping_packet.lfr_status_word[1] = DEFAULT_STATUS_WORD_BYTE1;
// init software version
housekeeping_packet.lfr_sw_version[0] = SW_VERSION_N1;
housekeeping_packet.lfr_sw_version[1] = SW_VERSION_N2;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_sw_version[BYTE_2] = SW_VERSION_N3;
housekeeping_packet.lfr_sw_version[BYTE_3] = SW_VERSION_N4;
paul
ICD 2.0...
r92 // init fpga version
paul
Bug #104
r144 parameters = (unsigned char *) (REGS_ADDR_VHDL_VERSION);
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_fpga_version[BYTE_0] = parameters[BYTE_1]; // n1
housekeeping_packet.lfr_fpga_version[BYTE_1] = parameters[BYTE_2]; // n2
housekeeping_packet.lfr_fpga_version[BYTE_2] = parameters[BYTE_3]; // n3
paul
fifo occupation reported in the HK packet
r197
housekeeping_packet.hk_lfr_q_sd_fifo_size = MSG_QUEUE_COUNT_SEND;
housekeeping_packet.hk_lfr_q_rv_fifo_size = MSG_QUEUE_COUNT_RECV;
housekeeping_packet.hk_lfr_q_p0_fifo_size = MSG_QUEUE_COUNT_PRC0;
housekeeping_packet.hk_lfr_q_p1_fifo_size = MSG_QUEUE_COUNT_PRC1;
housekeeping_packet.hk_lfr_q_p2_fifo_size = MSG_QUEUE_COUNT_PRC2;
paul
Ignore doc files...
r46 }
paul
Commit before working on the ERR 4 due to message queue...
r34
paul
Bug #117
r149 void increment_seq_counter( unsigned short *packetSequenceControl )
{
paul
TC_LFR_LOAD_KCOEFFICIENTS...
r194 /** This function increment the sequence counter passes in argument.
paul
Bug #117
r149 *
* The increment does not affect the grouping flag. In case of an overflow, the counter is reset to 0.
*
*/
paul
Bug #171
r151 unsigned short segmentation_grouping_flag;
paul
Bug #117
r149 unsigned short sequence_cnt;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << SHIFT_1_BYTE; // keep bits 7 downto 6
sequence_cnt = (*packetSequenceControl) & SEQ_CNT_MASK; // [0011 1111 1111 1111]
paul
Bug #117
r149
if ( sequence_cnt < SEQ_CNT_MAX)
{
sequence_cnt = sequence_cnt + 1;
}
else
{
sequence_cnt = 0;
}
*packetSequenceControl = segmentation_grouping_flag | sequence_cnt ;
}
paul
fsw-0-23...
r75 void getTime( unsigned char *time)
{
paul
Minor modifications to meet Logiscope requirements
r77 /** This function write the current local time in the time buffer passed in argument.
*
*/
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 time[0] = (unsigned char) (time_management_regs->coarse_time>>SHIFT_3_BYTES);
time[1] = (unsigned char) (time_management_regs->coarse_time>>SHIFT_2_BYTES);
time[2] = (unsigned char) (time_management_regs->coarse_time>>SHIFT_1_BYTE);
paul
fsw-0-23...
r75 time[3] = (unsigned char) (time_management_regs->coarse_time);
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 time[4] = (unsigned char) (time_management_regs->fine_time>>SHIFT_1_BYTE);
paul
fsw-0-23...
r75 time[5] = (unsigned char) (time_management_regs->fine_time);
}
paul
sequence counters management added
r56
paul
Sync...
r117 unsigned long long int getTimeAsUnsignedLongLongInt( )
{
/** This function write the current local time in the time buffer passed in argument.
*
*/
unsigned long long int time;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 time = ( (unsigned long long int) (time_management_regs->coarse_time & COARSE_TIME_MASK) << SHIFT_2_BYTES )
paul
Sync...
r117 + time_management_regs->fine_time;
return time;
}
paul
rev 1.0.0.4
r110 void send_dumb_hk( void )
{
Packet_TM_LFR_HK_t dummy_hk_packet;
unsigned char *parameters;
unsigned int i;
rtems_id queue_id;
paul
Bug #801 Don_Initialisation_P2
r320 queue_id = RTEMS_ID_NONE;
paul
rev 1.0.0.4
r110 dummy_hk_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
dummy_hk_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
dummy_hk_packet.reserved = DEFAULT_RESERVED;
dummy_hk_packet.userApplication = CCSDS_USER_APP;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 dummy_hk_packet.packetID[0] = (unsigned char) (APID_TM_HK >> SHIFT_1_BYTE);
paul
Sync...
r116 dummy_hk_packet.packetID[1] = (unsigned char) (APID_TM_HK);
paul
rev 1.0.0.4
r110 dummy_hk_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
dummy_hk_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 dummy_hk_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> SHIFT_1_BYTE);
paul
rev 1.0.0.4
r110 dummy_hk_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
dummy_hk_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
dummy_hk_packet.serviceType = TM_TYPE_HK;
dummy_hk_packet.serviceSubType = TM_SUBTYPE_HK;
dummy_hk_packet.destinationID = TM_DESTINATION_ID_GROUND;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 dummy_hk_packet.time[0] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_3_BYTES);
dummy_hk_packet.time[1] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_2_BYTES);
dummy_hk_packet.time[BYTE_2] = (unsigned char) (time_management_regs->coarse_time >> SHIFT_1_BYTE);
dummy_hk_packet.time[BYTE_3] = (unsigned char) (time_management_regs->coarse_time);
dummy_hk_packet.time[BYTE_4] = (unsigned char) (time_management_regs->fine_time >> SHIFT_1_BYTE);
dummy_hk_packet.time[BYTE_5] = (unsigned char) (time_management_regs->fine_time);
paul
rev 1.0.0.4
r110 dummy_hk_packet.sid = SID_HK;
// init status word
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 dummy_hk_packet.lfr_status_word[0] = INT8_ALL_F;
dummy_hk_packet.lfr_status_word[1] = INT8_ALL_F;
paul
rev 1.0.0.4
r110 // init software version
dummy_hk_packet.lfr_sw_version[0] = SW_VERSION_N1;
dummy_hk_packet.lfr_sw_version[1] = SW_VERSION_N2;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 dummy_hk_packet.lfr_sw_version[BYTE_2] = SW_VERSION_N3;
dummy_hk_packet.lfr_sw_version[BYTE_3] = SW_VERSION_N4;
paul
rev 1.0.0.4
r110 // init fpga version
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 parameters = (unsigned char *) (REGS_ADDR_WAVEFORM_PICKER + APB_OFFSET_VHDL_REV);
dummy_hk_packet.lfr_fpga_version[BYTE_0] = parameters[BYTE_1]; // n1
dummy_hk_packet.lfr_fpga_version[BYTE_1] = parameters[BYTE_2]; // n2
dummy_hk_packet.lfr_fpga_version[BYTE_2] = parameters[BYTE_3]; // n3
paul
rev 1.0.0.4
r110
parameters = (unsigned char *) &dummy_hk_packet.hk_lfr_cpu_load;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 for (i=0; i<(BYTE_POS_HK_REACTION_WHEELS_FREQUENCY - BYTE_POS_HK_LFR_CPU_LOAD); i++)
paul
rev 1.0.0.4
r110 {
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 parameters[i] = INT8_ALL_F;
paul
rev 1.0.0.4
r110 }
get_message_queue_id_send( &queue_id );
paul
New version of the waveform picker packet transmission...
r172 rtems_message_queue_send( queue_id, &dummy_hk_packet,
paul
rev 1.0.0.4
r110 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
}
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129
paul
2.0.2.1
r185 void get_temperatures( unsigned char *temperatures )
{
unsigned char* temp_scm_ptr;
unsigned char* temp_pcb_ptr;
unsigned char* temp_fpga_ptr;
paul
2.0.2.2...
r187 // SEL1 SEL0
// 0 0 => PCB
// 0 1 => FPGA
// 1 0 => SCM
paul
2.0.2.1
r185 temp_scm_ptr = (unsigned char *) &time_management_regs->temp_scm;
temp_pcb_ptr = (unsigned char *) &time_management_regs->temp_pcb;
temp_fpga_ptr = (unsigned char *) &time_management_regs->temp_fpga;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 temperatures[ BYTE_0 ] = temp_scm_ptr[ BYTE_2 ];
temperatures[ BYTE_1 ] = temp_scm_ptr[ BYTE_3 ];
temperatures[ BYTE_2 ] = temp_pcb_ptr[ BYTE_2 ];
temperatures[ BYTE_3 ] = temp_pcb_ptr[ BYTE_3 ];
temperatures[ BYTE_4 ] = temp_fpga_ptr[ BYTE_2 ];
temperatures[ BYTE_5 ] = temp_fpga_ptr[ BYTE_3 ];
paul
2.0.2.1
r185 }
paul
1.0.0.7...
r135 void get_v_e1_e2_f3( unsigned char *spacecraft_potential )
{
paul
Integration of basic parameters functions in the flight software...
r179 unsigned char* v_ptr;
unsigned char* e1_ptr;
unsigned char* e2_ptr;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
paul
Integration of basic parameters functions in the flight software...
r179 v_ptr = (unsigned char *) &waveform_picker_regs->v;
e1_ptr = (unsigned char *) &waveform_picker_regs->e1;
e2_ptr = (unsigned char *) &waveform_picker_regs->e2;
paul
The flight software is now compatible with the VHDL 0.1.32...
r171
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 spacecraft_potential[ BYTE_0 ] = v_ptr[ BYTE_2 ];
spacecraft_potential[ BYTE_1 ] = v_ptr[ BYTE_3 ];
spacecraft_potential[ BYTE_2 ] = e1_ptr[ BYTE_2 ];
spacecraft_potential[ BYTE_3 ] = e1_ptr[ BYTE_3 ];
spacecraft_potential[ BYTE_4 ] = e2_ptr[ BYTE_2 ];
spacecraft_potential[ BYTE_5 ] = e2_ptr[ BYTE_3 ];
paul
The flight software is now compatible with the VHDL 0.1.32...
r171 }
paul
cpu_load added to the housekeeping packets
r134 void get_cpu_load( unsigned char *resource_statistics )
{
unsigned char cpu_load;
cpu_load = lfr_rtems_cpu_usage_report();
// HK_LFR_CPU_LOAD
resource_statistics[0] = cpu_load;
// HK_LFR_CPU_LOAD_MAX
if (cpu_load > resource_statistics[1])
{
resource_statistics[1] = cpu_load;
}
// CPU_LOAD_AVE
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 resource_statistics[BYTE_2] = 0;
paul
cpu_load added to the housekeeping packets
r134
#ifndef PRINT_TASK_STATISTICS
rtems_cpu_usage_reset();
#endif
}
paul
Rev 3.0.0.4...
r212 void set_hk_lfr_sc_potential_flag( bool state )
{
if (state == true)
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] | STATUS_WORD_SC_POTENTIAL_FLAG_BIT; // [0100 0000]
paul
Rev 3.0.0.4...
r212 }
else
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] & STATUS_WORD_SC_POTENTIAL_FLAG_MASK; // [1011 1111]
paul
Rev 3.0.0.4...
r212 }
}
paul
The HK packet contains v, e1 and e2 valid data at f3....
r129
paul
commit before going back to 3.1.0.2 for LESIA compilation
r295 void set_sy_lfr_pas_filter_enabled( bool state )
{
if (state == true)
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] | STATUS_WORD_SC_POTENTIAL_FLAG_BIT; // [0010 0000]
paul
commit before going back to 3.1.0.2 for LESIA compilation
r295 }
else
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] & STATUS_WORD_SC_POTENTIAL_FLAG_MASK; // [1101 1111]
paul
commit before going back to 3.1.0.2 for LESIA compilation
r295 }
}
paul
sy_lfr_watchdog_enabled handled...
r262 void set_sy_lfr_watchdog_enabled( bool state )
{
if (state == true)
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] | STATUS_WORD_WATCHDOG_BIT; // [0001 0000]
paul
sy_lfr_watchdog_enabled handled...
r262 }
else
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] & STATUS_WORD_WATCHDOG_MASK; // [1110 1111]
paul
sy_lfr_watchdog_enabled handled...
r262 }
}
paul
Rev 3.0.0.4...
r212 void set_hk_lfr_calib_enable( bool state )
{
if (state == true)
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] | STATUS_WORD_CALIB_BIT; // [0000 1000]
paul
Rev 3.0.0.4...
r212 }
else
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] & STATUS_WORD_CALIB_MASK; // [1111 0111]
paul
Rev 3.0.0.4...
r212 }
}
paul
bug #456 pa_bia_status_info byte is updated upon the reception of...
r224
paul
correction de Bug #514, lfr_reset_cause = power_on
r226 void set_hk_lfr_reset_cause( enum lfr_reset_cause_t lfr_reset_cause )
{
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.lfr_status_word[1] =
housekeeping_packet.lfr_status_word[1] & STATUS_WORD_RESET_CAUSE_MASK; // [1111 1000]
paul
modifications following #634:...
r279
paul
correction de Bug #514, lfr_reset_cause = power_on
r226 housekeeping_packet.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1]
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 | (lfr_reset_cause & STATUS_WORD_RESET_CAUSE_BITS ); // [0000 0111]
paul
modifications following #634:...
r279
paul
correction de Bug #514, lfr_reset_cause = power_on
r226 }
paul
minor updates on documentation
r240
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 void increment_hk_counter( unsigned char newValue, unsigned char oldValue, unsigned int *counter )
paul
minor updates on documentation
r240 {
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 int delta;
delta = 0;
paul
minor updates on documentation
r240
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 if (newValue >= oldValue)
{
delta = newValue - oldValue;
}
else
{
delta = 255 - oldValue + newValue;
}
*counter = *counter + delta;
}
paul
minor updates on documentation
r240
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 void hk_lfr_le_update( void )
{
static hk_lfr_le_t old_hk_lfr_le = {0};
hk_lfr_le_t new_hk_lfr_le;
unsigned int counter;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 counter = (((unsigned int) housekeeping_packet.hk_lfr_le_cnt[0]) * 256) + housekeeping_packet.hk_lfr_le_cnt[1];
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317
// DPU
new_hk_lfr_le.dpu_spw_parity = housekeeping_packet.hk_lfr_dpu_spw_parity;
new_hk_lfr_le.dpu_spw_disconnect= housekeeping_packet.hk_lfr_dpu_spw_disconnect;
new_hk_lfr_le.dpu_spw_escape = housekeeping_packet.hk_lfr_dpu_spw_escape;
new_hk_lfr_le.dpu_spw_credit = housekeeping_packet.hk_lfr_dpu_spw_credit;
new_hk_lfr_le.dpu_spw_write_sync= housekeeping_packet.hk_lfr_dpu_spw_write_sync;
// TIMECODE
new_hk_lfr_le.timecode_erroneous= housekeeping_packet.hk_lfr_timecode_erroneous;
new_hk_lfr_le.timecode_missing = housekeeping_packet.hk_lfr_timecode_missing;
new_hk_lfr_le.timecode_invalid = housekeeping_packet.hk_lfr_timecode_invalid;
// TIME
new_hk_lfr_le.time_timecode_it = housekeeping_packet.hk_lfr_time_timecode_it;
new_hk_lfr_le.time_not_synchro = housekeeping_packet.hk_lfr_time_not_synchro;
new_hk_lfr_le.time_timecode_ctr = housekeeping_packet.hk_lfr_time_timecode_ctr;
//AHB
new_hk_lfr_le.ahb_correctable = housekeeping_packet.hk_lfr_ahb_correctable;
paul
#601 corrected: hk_lfr_le_me_he_update moved
r261 // housekeeping_packet.hk_lfr_dpu_spw_rx_ahb => not handled by the grspw driver
// housekeeping_packet.hk_lfr_dpu_spw_tx_ahb => not handled by the grspw driver
paul
minor updates on documentation
r240
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 // update the le counter
// DPU
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 increment_hk_counter( new_hk_lfr_le.dpu_spw_parity, old_hk_lfr_le.dpu_spw_parity, &counter );
increment_hk_counter( new_hk_lfr_le.dpu_spw_disconnect,old_hk_lfr_le.dpu_spw_disconnect, &counter );
increment_hk_counter( new_hk_lfr_le.dpu_spw_escape, old_hk_lfr_le.dpu_spw_escape, &counter );
increment_hk_counter( new_hk_lfr_le.dpu_spw_credit, old_hk_lfr_le.dpu_spw_credit, &counter );
increment_hk_counter( new_hk_lfr_le.dpu_spw_write_sync,old_hk_lfr_le.dpu_spw_write_sync, &counter );
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 // TIMECODE
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 increment_hk_counter( new_hk_lfr_le.timecode_erroneous,old_hk_lfr_le.timecode_erroneous, &counter );
increment_hk_counter( new_hk_lfr_le.timecode_missing, old_hk_lfr_le.timecode_missing, &counter );
increment_hk_counter( new_hk_lfr_le.timecode_invalid, old_hk_lfr_le.timecode_invalid, &counter );
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 // TIME
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 increment_hk_counter( new_hk_lfr_le.time_timecode_it, old_hk_lfr_le.time_timecode_it, &counter );
increment_hk_counter( new_hk_lfr_le.time_not_synchro, old_hk_lfr_le.time_not_synchro, &counter );
increment_hk_counter( new_hk_lfr_le.time_timecode_ctr, old_hk_lfr_le.time_timecode_ctr, &counter );
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 // AHB
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 increment_hk_counter( new_hk_lfr_le.ahb_correctable, old_hk_lfr_le.ahb_correctable, &counter );
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317
// DPU
old_hk_lfr_le.dpu_spw_parity = new_hk_lfr_le.dpu_spw_parity;
old_hk_lfr_le.dpu_spw_disconnect= new_hk_lfr_le.dpu_spw_disconnect;
old_hk_lfr_le.dpu_spw_escape = new_hk_lfr_le.dpu_spw_escape;
old_hk_lfr_le.dpu_spw_credit = new_hk_lfr_le.dpu_spw_credit;
old_hk_lfr_le.dpu_spw_write_sync= new_hk_lfr_le.dpu_spw_write_sync;
// TIMECODE
old_hk_lfr_le.timecode_erroneous= new_hk_lfr_le.timecode_erroneous;
old_hk_lfr_le.timecode_missing = new_hk_lfr_le.timecode_missing;
old_hk_lfr_le.timecode_invalid = new_hk_lfr_le.timecode_invalid;
// TIME
old_hk_lfr_le.time_timecode_it = new_hk_lfr_le.time_timecode_it;
old_hk_lfr_le.time_not_synchro = new_hk_lfr_le.time_not_synchro;
old_hk_lfr_le.time_timecode_ctr = new_hk_lfr_le.time_timecode_ctr;
//AHB
old_hk_lfr_le.ahb_correctable = new_hk_lfr_le.ahb_correctable;
// housekeeping_packet.hk_lfr_dpu_spw_rx_ahb => not handled by the grspw driver
// housekeeping_packet.hk_lfr_dpu_spw_tx_ahb => not handled by the grspw driver
// update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
// LE
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.hk_lfr_le_cnt[0] = (unsigned char) ((counter & BYTE0_MASK) >> SHIFT_1_BYTE);
housekeeping_packet.hk_lfr_le_cnt[1] = (unsigned char) (counter & BYTE1_MASK);
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 }
void hk_lfr_me_update( void )
{
static hk_lfr_me_t old_hk_lfr_me = {0};
hk_lfr_me_t new_hk_lfr_me;
unsigned int counter;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 counter = (((unsigned int) housekeeping_packet.hk_lfr_me_cnt[0]) * 256) + housekeeping_packet.hk_lfr_me_cnt[1];
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317
// get the current values
new_hk_lfr_me.dpu_spw_early_eop = housekeeping_packet.hk_lfr_dpu_spw_early_eop;
new_hk_lfr_me.dpu_spw_invalid_addr = housekeeping_packet.hk_lfr_dpu_spw_invalid_addr;
new_hk_lfr_me.dpu_spw_eep = housekeeping_packet.hk_lfr_dpu_spw_eep;
new_hk_lfr_me.dpu_spw_rx_too_big = housekeeping_packet.hk_lfr_dpu_spw_rx_too_big;
// update the me counter
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 increment_hk_counter( new_hk_lfr_me.dpu_spw_early_eop, old_hk_lfr_me.dpu_spw_early_eop, &counter );
increment_hk_counter( new_hk_lfr_me.dpu_spw_invalid_addr, old_hk_lfr_me.dpu_spw_invalid_addr, &counter );
increment_hk_counter( new_hk_lfr_me.dpu_spw_eep, old_hk_lfr_me.dpu_spw_eep, &counter );
increment_hk_counter( new_hk_lfr_me.dpu_spw_rx_too_big, old_hk_lfr_me.dpu_spw_rx_too_big, &counter );
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317
// store the counters for the next time
old_hk_lfr_me.dpu_spw_early_eop = new_hk_lfr_me.dpu_spw_early_eop;
old_hk_lfr_me.dpu_spw_invalid_addr = new_hk_lfr_me.dpu_spw_invalid_addr;
old_hk_lfr_me.dpu_spw_eep = new_hk_lfr_me.dpu_spw_eep;
old_hk_lfr_me.dpu_spw_rx_too_big = new_hk_lfr_me.dpu_spw_rx_too_big;
// update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
// ME
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.hk_lfr_me_cnt[0] = (unsigned char) ((counter & BYTE0_MASK) >> SHIFT_1_BYTE);
housekeeping_packet.hk_lfr_me_cnt[1] = (unsigned char) (counter & BYTE1_MASK);
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 }
void hk_lfr_le_me_he_update()
{
unsigned int hk_lfr_he_cnt;
hk_lfr_he_cnt = ((unsigned int) housekeeping_packet.hk_lfr_he_cnt[0]) * 256 + housekeeping_packet.hk_lfr_he_cnt[1];
//update the low severity error counter
hk_lfr_le_update( );
paul
minor updates on documentation
r240 //update the medium severity error counter
paul
Bug #703 hk_lfr_le and hk_lfr_me handling corrected
r317 hk_lfr_me_update();
paul
minor updates on documentation
r240
//update the high severity error counter
hk_lfr_he_cnt = 0;
// update housekeeping packet counters, convert unsigned int numbers in 2 bytes numbers
// HE
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.hk_lfr_he_cnt[0] = (unsigned char) ((hk_lfr_he_cnt & BYTE0_MASK) >> SHIFT_1_BYTE);
housekeeping_packet.hk_lfr_he_cnt[1] = (unsigned char) (hk_lfr_he_cnt & BYTE1_MASK);
paul
minor updates on documentation
r240
}
paul
hk_lfr_time_not_synchro is updated each time the synchro is lost....
r249
void set_hk_lfr_time_not_synchro()
{
paul
the first desynchro state is not counted in the hk_lfr_time_not_synchro counter
r252 static unsigned char synchroLost = 1;
paul
hk_lfr_time_not_synchro is updated each time the synchro is lost....
r249 int synchronizationBit;
// get the synchronization bit
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 synchronizationBit =
(time_management_regs->coarse_time & VAL_LFR_SYNCHRONIZED) >> BIT_SYNCHRONIZATION; // 1000 0000 0000 0000
paul
hk_lfr_time_not_synchro is updated each time the synchro is lost....
r249
switch (synchronizationBit)
{
case 0:
if (synchroLost == 1)
{
synchroLost = 0;
}
break;
case 1:
if (synchroLost == 0 )
{
synchroLost = 1;
increase_unsigned_char_counter(&housekeeping_packet.hk_lfr_time_not_synchro);
paul
snapshot synchronization slightly upgraded...
r263 update_hk_lfr_last_er_fields( RID_LE_LFR_TIME, CODE_NOT_SYNCHRO );
paul
hk_lfr_time_not_synchro is updated each time the synchro is lost....
r249 }
break;
default:
PRINTF1("in hk_lfr_time_not_synchro *** unexpected value for synchronizationBit = %d\n", synchronizationBit);
break;
}
}
paul
ASM restart sequence updated at the interrupt service routine level...
r259
paul
ahb_correctable counter handling updated...
r290 void set_hk_lfr_ahb_correctable() // CRITICITY L
paul
ASM restart sequence updated at the interrupt service routine level...
r259 {
/** This function builds the error counter hk_lfr_ahb_correctable using the statistics provided
* by the Cache Control Register (ASI 2, offset 0) and in the Register Protection Control Register (ASR16) on the
* detected errors in the cache, in the integer unit and in the floating point unit.
*
* @param void
*
* @return void
*
* All errors are summed to set the value of the hk_lfr_ahb_correctable counter.
*
*/
unsigned int ahb_correctable;
unsigned int instructionErrorCounter;
unsigned int dataErrorCounter;
unsigned int fprfErrorCounter;
unsigned int iurfErrorCounter;
paul
Bug #801 Don_Initialisation_P2
r320 instructionErrorCounter = 0;
dataErrorCounter = 0;
fprfErrorCounter = 0;
iurfErrorCounter = 0;
paul
ASM restart sequence updated at the interrupt service routine level...
r259 CCR_getInstructionAndDataErrorCounters( &instructionErrorCounter, &dataErrorCounter);
ASR16_get_FPRF_IURF_ErrorCounters( &fprfErrorCounter, &iurfErrorCounter);
ahb_correctable = instructionErrorCounter
+ dataErrorCounter
+ fprfErrorCounter
+ iurfErrorCounter
+ housekeeping_packet.hk_lfr_ahb_correctable;
paul
Many corrections, mainly related to #807 Don_Enumeration
r318 housekeeping_packet.hk_lfr_ahb_correctable = (unsigned char) (ahb_correctable & INT8_ALL_F); // [1111 1111]
paul
ASM restart sequence updated at the interrupt service routine level...
r259
}