This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USB descriptor for Product, Manufacturer, VID etc define as macro from sdkconfig to other file.

Hi,

I would like to extern  APP_USBD_STRING_ID_PRODUCTAPP_USBD_STRINGS_PRODUCT APP_USBD_DEVICE_VER_MAJOR etc. from sdk_config.h to macro like USB_PRODUCT_ID_STRING in  file main.c i.e similar to one in BLE examples.

#define DEVICE_NAME                     "Nordic_Blinky"
#define MANUFACTURER_NAME               "NordicSemiconductor"

Are there some example files to define USB related macro in main file or other file?

SDK 15.2, SD 140, NRF52840.

Regards

Parents
  • Hi 

    We don't have any examples for this unfortunately. 

    In order to change this behavior you would have to change the API of the USBD driver to allow you to pass the information from main.c rather than have it included from the sdk_config.h file. 

    This data eventually ends up in the m_device_dsc struct instance in app_usbd_core.c, and is used on line 687 of app_usbd_core.c. Maybe you can add a function in app_usbd_core.c that modifies this struct, and call this function from app_usbd_init in app_usbd.c, so that the data is updated before the m_device_dsc instance is used. 

    The problem of doing something like this is that if you want to update to a later SDK in the future you will have to make the same changes again. 

    Best regards
    Torbjørn

  • Hi,

    As you suggested the problem to be faced while updating SDK, it would be little difficult to do so.

    I found this macro

    #define APP_USBD_STRINGS_MANUFACTURER_EXTERN 1

    Using this is it possible to extern it?

    General Question:

    Are you planning to include this feature in coming SDK?

  • Hi

    You can use the _EXTERN define to allow the parameter to be configured externally to sdk_config.h, that is correct. 

    "Are you planning to include this feature in coming SDK?"

    What do you mean, if we plan to add the _EXTERN option to all the parameters you mentioned earlier?

    Best regards
    Torbjørn

Reply Children
No Data
Related