##// END OF EJS Templates
Bug 649 corrected, TC with Length > 228 are dropped by the driver, not parsed
paul -
r316:f8bdd7f20886 R3_plus draft
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 57edc38eadba4601cf0b1e2fa1eeab85082e9f41 header/lfr_common_headers
2 3e4216a0e6981bead8bcb201012ebadb53f60dff header/lfr_common_headers
@@ -158,8 +158,8 rtems_task recv_task( rtems_task_argumen
158 PRINTF("in RECV *** packet lenght too short\n")
158 PRINTF("in RECV *** packet lenght too short\n")
159 }
159 }
160 else {
160 else {
161 // PRINTF1("incoming TC with len: %d\n", len);
162 estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes
161 estimatedPacketLength = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes
162 PRINTF1("incoming TC with Length (byte): %d\n", len - 3);
163 currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> 8);
163 currentTC_LEN_RCV[ 0 ] = (unsigned char) (estimatedPacketLength >> 8);
164 currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength );
164 currentTC_LEN_RCV[ 1 ] = (unsigned char) (estimatedPacketLength );
165 // CHECK THE TC
165 // CHECK THE TC
@@ -445,6 +445,11 int spacewire_configure_link( int fd )
445
445
446 spacewire_set_NP(1, REGS_ADDR_GRSPW); // [N]o [P]ort force
446 spacewire_set_NP(1, REGS_ADDR_GRSPW); // [N]o [P]ort force
447 spacewire_set_RE(1, REGS_ADDR_GRSPW); // [R]MAP [E]nable, the dedicated call seems to break the no port force configuration
447 spacewire_set_RE(1, REGS_ADDR_GRSPW); // [R]MAP [E]nable, the dedicated call seems to break the no port force configuration
448 spw_ioctl_packetsize packetsize;
449
450 packetsize.rxsize = 228;
451 packetsize.txdsize = 4096;
452 packetsize.txhsize = 34;
448
453
449 status = ioctl(fd, SPACEWIRE_IOCTRL_SET_RXBLOCK, 1); // sets the blocking mode for reception
454 status = ioctl(fd, SPACEWIRE_IOCTRL_SET_RXBLOCK, 1); // sets the blocking mode for reception
450 if (status!=RTEMS_SUCCESSFUL) {
455 if (status!=RTEMS_SUCCESSFUL) {
@@ -480,6 +485,11 int spacewire_configure_link( int fd )
480 if (status!=RTEMS_SUCCESSFUL) {
485 if (status!=RTEMS_SUCCESSFUL) {
481 PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TCODE_CTRL,\n")
486 PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TCODE_CTRL,\n")
482 }
487 }
488 //
489 status = ioctl(fd, SPACEWIRE_IOCTRL_SET_PACKETSIZE, packetsize); // set rxsize, txdsize and txhsize
490 if (status!=RTEMS_SUCCESSFUL) {
491 PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_PACKETSIZE,\n")
492 }
483
493
484 return status;
494 return status;
485 }
495 }
@@ -151,7 +151,7 int tc_parser(ccsdsTelecommandPacket_t *
151 }
151 }
152 if (status == CCSDS_TM_VALID) // CHECK THAT THE PACKET DOES NOT EXCEED THE MAX SIZE
152 if (status == CCSDS_TM_VALID) // CHECK THAT THE PACKET DOES NOT EXCEED THE MAX SIZE
153 {
153 {
154 if ( packetLength >= CCSDS_TC_PKT_MAX_SIZE ) {
154 if ( packetLength > CCSDS_TC_PKT_MAX_SIZE ) {
155 status = WRONG_LEN_PKT;
155 status = WRONG_LEN_PKT;
156 }
156 }
157 }
157 }
@@ -300,6 +300,9 int action_update_info(ccsdsTelecommandP
300 getReactionWheelsFrequencies( TC );
300 getReactionWheelsFrequencies( TC );
301 build_sy_lfr_rw_masks();
301 build_sy_lfr_rw_masks();
302
302
303 // once the masks are built, they have to be merged with the fbins_mask
304 merge_fbins_masks();
305
303 result = status;
306 result = status;
304
307
305 return result;
308 return result;
@@ -307,6 +307,9 int action_load_fbins_mask(ccsdsTelecomm
307
307
308 flag = set_sy_lfr_fbins( TC );
308 flag = set_sy_lfr_fbins( TC );
309
309
310 // once the fbins masks have been stored, they have to be merged with the masks which handle the reaction wheels frequencies filtering
311 merge_fbins_masks();
312
310 return flag;
313 return flag;
311 }
314 }
312
315
@@ -503,7 +506,6 int action_dump_par( ccsdsTelecommandPac
503 */
506 */
504
507
505 int status;
508 int status;
506 int k;
507
509
508 increment_seq_counter_destination_id_dump( parameter_dump_packet.packetSequenceControl, TC->sourceID );
510 increment_seq_counter_destination_id_dump( parameter_dump_packet.packetSequenceControl, TC->sourceID );
509 parameter_dump_packet.destinationID = TC->sourceID;
511 parameter_dump_packet.destinationID = TC->sourceID;
@@ -516,25 +518,6 int action_dump_par( ccsdsTelecommandPac
516 parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
518 parameter_dump_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
517 parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
519 parameter_dump_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
518 // SEND DATA
520 // SEND DATA
519 printf("f0\n");
520 for (k = 0; k<16; k++)
521 {
522 printf("%x ", parameter_dump_packet.sy_lfr_rw_mask.fx.f0_word1[k]);
523 }
524 printf("\n");
525 printf("f1\n");
526 for (k = 0; k<16; k++)
527 {
528 printf("%x ", parameter_dump_packet.sy_lfr_rw_mask.fx.f1_word1[k]);
529 }
530 printf("\n");
531 printf("f2\n");
532 for (k = 0; k<16; k++)
533 {
534 printf("%x ", parameter_dump_packet.sy_lfr_rw_mask.fx.f2_word1[k]);
535 }
536 printf("\n");
537
538 status = rtems_message_queue_send( queue_id, &parameter_dump_packet,
521 status = rtems_message_queue_send( queue_id, &parameter_dump_packet,
539 PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
522 PACKET_LENGTH_PARAMETER_DUMP + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
540 if (status != RTEMS_SUCCESSFUL) {
523 if (status != RTEMS_SUCCESSFUL) {
@@ -1153,8 +1136,6 void build_sy_lfr_rw_masks( void )
1153 build_sy_lfr_rw_mask( 0 );
1136 build_sy_lfr_rw_mask( 0 );
1154 build_sy_lfr_rw_mask( 1 );
1137 build_sy_lfr_rw_mask( 1 );
1155 build_sy_lfr_rw_mask( 2 );
1138 build_sy_lfr_rw_mask( 2 );
1156
1157 merge_fbins_masks();
1158 }
1139 }
1159
1140
1160 void merge_fbins_masks( void )
1141 void merge_fbins_masks( void )
@@ -1493,6 +1474,9 void init_parameter_dump( void )
1493 {
1474 {
1494 parameter_dump_packet.sy_lfr_rw_mask.raw[k] = 0xff;
1475 parameter_dump_packet.sy_lfr_rw_mask.raw[k] = 0xff;
1495 }
1476 }
1477
1478 // once the reaction wheels masks have been initialized, they have to be merged with the fbins masks
1479 merge_fbins_masks();
1496 }
1480 }
1497
1481
1498 void init_kcoefficients_dump( void )
1482 void init_kcoefficients_dump( void )
General Comments 0
You need to be logged in to leave comments. Login now