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.

TMS320F28375D: Endpoint0 support and vendor commands

Part Number: TMS320F28375D


Tool/software:

Hi,  I have developed several boards based on the TMS32F28375D.  I would like to use vendor commands to communicated with endpoint0  The host side of the software is mature and I would like to make these new boards compatible with existing Windows software..  It seems that the basics for vendor commands exist in the C2000 USB library, but I have found no examples and sparse description in the documentation.  Section 2.37.2 describes using pfnRequestHandler, which is what I think I need.  Do I connect  the Request Handler through a bluffer like the endpoint handlers?  I haven't found any indication that the endpoint 0 buffer is already created with a request handler.  If it already exists, how do I link to it?

  • After reading the F2837xD_USBL_UG.pdf, section 2.37 more carefully, I recognize that my questions were poorly stated.  Section 2.37 clearly states "The application must populate the table (structure of type tCustomHandlers) with a valid function pointer for each event that it wishes to be informed of."  Therefore I need to provide a valid function pointer for pfnRequestHandler.  The source code for the USB library creates the table with (const tCustomHandlers g_sBulkHandlers), and inserts "0" for the the pfnRequestHandler.  I can create the Request Handler in my application, the question is, how can an application populate the table with a function pointer after the library sets the value to zero. This constant is not exposed in the header file, and I have not found a healper function to assist in this change either at compile time or runtime.  

    At this point, it seems I am left with two options for inserting a Request Handler into the table.

    1) Create a helper functiuon in the USB Library that could dynamically insert a function pointer into the table. I could call this helper function before USBInit after ompiling my own version of the USB Library.  The advantage of this is that I could debug the Request Handler in the application not the USB Library.  Also the Request Handler could be changed for different applications.

    2) Simply put the Request Handler in the USB Library and insert the function pointer into the talbe.  The disadvantge is that I would be debuging the USB Library for specific Vendor commands.  Further, I would have to develop a Request Handler for all applications if the Vendor commands change with the application.

    Am I missing something here?  Which option seems preferable?

  • James

    I would prefer to option 1 . You can create  a helper function which inserts the function pointer into the table.

    Best Regards

    Siddharth