AnsweredAssumed Answered

Issues with TDM_LOOPBACK_TEST within TDM Driver - SDK1.9

Question asked by Naum Grutman on Dec 2, 2016
Latest reply on Dec 30, 2016 by Naum Grutman

In reference to  the TDM_LOOPBACK_TEST.c  within  TDM driver of SDK1.9

 

TDM_LOOPBACK_TEST is not dependable…

 

The way TDM_LOOPBACK_TEST.c  is written one is bound to get erroneous results claiming that this test is PASSing when indeed it does not… 

Since, if too many poll cycles where shortened by continue;  j variable might never get higher than BUF_COUNT which is equal 5 in which case tdm_check_data() never gets entered thus data is not compared and test returns PASSing results… If one will redefine POLL_COUNT to be 60 or higher I assure you that you will see this test FAILing every time…

 

#define POLL_COUNT         15

#define BUF_COUNT          5

static int poll_count = POLL_COUNT;

...

int poll = 0;

...

while ( ( poll < poll_count ) && !kthread_should_stop() )

   {

   poll++;

   ret = tdm_ch_poll( h_channel1, 10 );

     

   if ( ret != TDM_E_OK )

      continue;

   ...

   ...

   if ( ++j >= BUF_COUNT )

      error_count += tdm_check_data( tx_data[ ( index + 1 ) % BUF_COUNT ], rx_data[ index ] );

 

  index++;

  index = index % BUF_COUNT;

  }

 

...

if ( ( error_count == 0 ) && ( j != 0 ) )

   pr_info( "%s TDM loopback test PASSED!\n", in_loopback ? "Internal" : "External" );

else

   pr_info( "%s TDM loopback test FAILED!\n", in_loopback ? "Internal" : "External" );

 

 

Thanks

Naum

 

Outcomes