AnsweredAssumed Answered

about Xil_DCacheInvalidateRange function

Question asked by hly0407 on Jan 30, 2016
Latest reply on Feb 1, 2016 by DragosB

hello everyone 

     i use ad9361 with no-os system at fmcomms2+zc706. i set rx2tx2 as 0. and i select TDD mode to receive and transmit, in the main.c, after defualt setup i just do this:


  int32_t len = 8000;

  int32_t loop_num = 3;

  int32_t *rdata = (int32_t *)malloc( sizeof(int32_t)*len*loop_num );

  int32_t j = 0;


  while( j < loop_num )



        ad9361_ensm_set_state(ad9361_phy, ENSM_STATE_ALERT, false);

        ad9361_ensm_set_state(ad9361_phy, ENSM_STATE_RX, false);



         adc_capture(len ,ADC_DDR_BASEADDR);



        memcpy( rdata+(j*len), (volatile u32 *)( (u32)ADC_DDR_BASEADDR ), len*sizeof(int32_t) );




        ad9361_ensm_set_state(ad9361_phy, ENSM_STATE_ALERT, false);

        ad9361_ensm_set_state(ad9361_phy, ENSM_STATE_TX, false);







     All I want to do is enter the launch immediately after the collection. but the function Xil_DCacheInvalidateRange() spend too much time. just about 65us, is too much to me.

     there are my problems.

     1. i don't know the meaning of the function parameter Xil_DCacheInvalidateRange(addr,size);, if i capture len, what size should I set for Xil_DCacheInvalidateRange.

     2. in function Xil_DCacheInvalidateRange, i see this:


         int32_t cacheline = 32;

         while( tempadr < tempend )


              _asm_ _volatile_( "mcr".......


               tempadr += cacheline;


         it must perform so much loops. so it will spend much time. so what can i do to reduce time. because when i tune to Rx, and capture 100us, i need tune to TX Immediately, and then transmit 100us too. then tune to Rx...

         the function memcpy is already spend too much time, so I want to reduce the time on function Xil_DCacheInvalidateRange.


         please help me. thankyou