This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

bios6 function Timestamp_getFreq()

Hello expert.

We have customized board, base on DM385, use CBB RDK 1.5

mcfw/src_bios6/utils/src/utils.c function, Timestamp_getFreq(&cpuHz)

the return value is set at double.

e.g I set 200Mhz, but read value is 400Mhz.

is something wrong?

  • This is correct value. The frequency returned is the frequency of the unicache CTM timer which operates at 2x the Ducati M3 frequency.

  • Hi Badri Narayana, thank you for your reply.

    ok, but I use Utils_getCurTimeInMsec() get time is wrong.

    the actual value obtained was twice,

    I write a test function is attached ->

    //#define USE_LINUX_API
    
    unsigned int AUDIO_GetTimeStamp(void)
    {
    #if defined USE_LINUX_API
    	struct timeval timeval;
    
    	gettimeofday(&timeval, NULL);
    	return (timeval.tv_sec * 1000) + (timeval.tv_usec + 500) / 1000;
    #else
    	return (Vcam_getCurVpssM3Time());
    #endif	
    }
    
    //------------------------------------------------------------------------------------------------------
    Void Audio_recordMain(Void * arg)
    {
    	int runCount = 0;
    	int startTime = AUDIO_GetTimeStamp();
    
    	while(1) {
            	runCount++;
    
    		if ((AUDIO_GetTimeStamp()-startTime) >= 1000) {	// time >= 1 sec
    			printf("#### startTime: %d, runCount: %d\n", startTime, runCount);
    			runCount = 0;
    			startTime = AUDIO_GetTimeStamp();
    		}
    	}
    
    }
    

    both the linux api gettimeofday(&timeval, NULL) and Vcam_getCurVpssM3Time() to compare,

    the m3Time 1sec actual was 2sec.