Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CONFIG_USB_DEVICE_INTERFACES_NUMBER set to erroneous value. #20

Open
nitz opened this issue May 24, 2022 · 0 comments
Open

CONFIG_USB_DEVICE_INTERFACES_NUMBER set to erroneous value. #20

nitz opened this issue May 24, 2022 · 0 comments

Comments

@nitz
Copy link

nitz commented May 24, 2022

I've configured my project graph as such:

image

The code generated in usb_device_init_data.c that describes the configuration erroneously was set to the number 75, rather than 2, as expected.

In my project's mc3 file, I see the following setting:

      <entry>
         <key class="com.microchip.mcc.core.tokenManager.CustomKey" moduleName="usb_device" name="CONFIG_USB_DEVICE_INTERFACES_NUMBER"/>
         <value>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;usb_device&gt;
  &lt;usb_device dnOrder=&quot;0&quot; id=&quot;CONFIG_USB_DEVICE_INTERFACES_NUMBER&quot;&gt;
    &lt;Values dnOrder=&quot;0&quot;&gt;
      &lt;Dynamic dnOrder=&quot;0&quot; id=&quot;usb_device&quot; value=&quot;75&quot;/&gt;
    &lt;/Values&gt;
  &lt;/usb_device&gt;
&lt;/usb_device&gt;
</value>
      </entry>

The value specifies it's a dynamic one (and thus should be calculated), but that value is not displayed anywhere in the configuration Options for the USB Device layer, (where as Number of Functions and Number of Endpoints does seem to generate correct):

image

I removed and re-added the "USB Device Layer" component, but that caused the generated code to instead think it has 0 configurations/functions/endpoints.

image

Upon removing and re-adding the CDC Function driver, the values seem to have all been correctly re-calculated.

I've not yet been able to reproduce how that value of "75" was generated.

MPLAB Code Configurator version: v5.1.4
Target device: ATSAMD21G18A (DFP 3.6.144)
Target toolchain: XC32 4.00.

Let me know if there's any other info I could provide for potentially tracking down this issue.

Edit to add:

Upon further exploration, since re-creating the configuration, the number of bytes to describe the configuration generated as '58' instead of the 67 it should have been. Deleting both the USB Device Layer and the CDC Function Driver, and then re-adding them in that order seems to have resolved that particular issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant