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.

Upp_Ioctl_QUERY_STATS

We are trying to use "Upp_Ioctl_QUERY_STATS".

The UPP driver comes from pspdrivers_01_30_01

The source code is as follows:

    Upp_devStats stats;

    SIO_ctrl(uppInHandle, Upp_Ioctl_QUERY_STATS, (Arg) &stats);

The return value is 6, which seems to be SYS_EBADIO.  The handle is valid and works for calls to SIO_reclaim().

What needs to be done to enable Upp_Ioctl_QUERY_STATS?

Thank you

  • Hi Mitch,

    As mentioned in the C6748_BIOSPSP_Userguide(section: 18.2.2), for collecting the Statistics in the driver, you need to first enable the "Upp_STATISTICS_ENABLE" build option in the driver(Upp.pjt) and the application(uppSample.pjt) build files.  Accordingly, edit the .pjt files by adding the above compiler options and build both the driver and the application.

    ["Compiler" Settings: "Debug"]

    Options=-g -mo -pdr -fr"$(Proj_dir)\Debug" -i"$(Proj_dir)\..\..\..\..\..\..\" -d"CHIP_C6748" -d"BIOS_PWRM_ENABLE" -d"Upp_STATISTICS_ENABLE" -mv6740

    While building the driver, the compiler will throw few compilation errors. There is a typo and a syntax error in the Upp_ioctl.c file. Attached is the difference report of the original file and the modified file. Please make the appropriate changes and build the UPP driver. 

    After all the above modifications and build, you should be able to use the "Upp_Ioctl_QUERY_STATS". Please try this and let us know the results..

    In the meanwhile I will raise an IR to track this.

    Sincere apologies for the inconvenience..

    Thanks & regards,

    Raghavendra

  • Thanks, Raghavendra.   I just tripped over the exact same thing, and your suggestion and diff fixed it for me, too.

     

    Just to be pedantic, you might also want to remove the D from ENABLED in the comment on the corresponding #endif.

     

    Also, would there be any issue if my application disabled interrupts itself before calling SIO_ctrl(), so that I could do a Upp_Ioctl_QUERY_STATS and Upp_Ioctl_CLEAR_STATS back-to-back to get an atomic read-and-clear on all the counters?

     

    Thanks much!

     

    ------Carl

  • Found a slight error in Upp statistics I figured I should make you aware of.  The byteCnt always comes back zero for me, even though I see the line and packet counts working properly.  I traced it back to line 2125 of Upp.c.  First, I think += was intended rather than =.  But even that won't work -- by the time that line executes, ioPacket->size is always zeroed out just above if there was no error.

     

    Just for grins, I tried changing the = to a +=, and commenting out the explicit zero of ioPacket->size just above.  That fixed TWO bugs for me!  Not only does the byteCnt field of Upp statistics work now, but my SIO_reclaim() calls on my uPP receive channel are now returning the proper received byte count of the reclaimed buffer!  Before now, SIO_reclaim() calls on my uPP receive channel had always been returning zero (unless they timed out), which I was scratching my head over, as that seemed to contradict the DSP/BIOS API reference guide.

     

    :o)

     

    ------Carl

     

  • Hi Carl,

    Thanks for pointing us on this. Let me check this..

     

    Best Regards,

    Raghavendra