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.

CODECOMPOSER: GUI Composer can't connect to USB2ANY with SPI configuration.

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: USB2ANY

Tool/software:

I'm attempting to use the online GUI Composer to control a USB2ANY and use it's SPI capabilities.

I'm using the usage code for the gc-codec-usb2any-spi v3 component in the documentation:

<gc-codec-usb2any-spi id="spi"></gc-codec-usb2any-spi>

<gc-codec-usb2any id="usb2any"></gc-codec-usb2any>
<gc-codec-usb2any-power id="power"></gc-codec-usb2any-power>
<gc-transport-usb id="usb" hid></gc-transport-usb>
<gc-target-connection-manager auto-connect active-configuration="usb+usb2any(power,spi)"></gc-target-connection-manager>

When attempting to connect to the USB2ANY, I get the following error:

The device connects as expected when using I2C. I have also tried using USB2ANY firmware 2.7, 2.8.1, and 2.8.2 with no luck.

Below is the console when attempting to connect with the SPI configuration:

[gc-transport-usb::usb] info: Connecting to USB2ANY/OneDemo device ...
[gc-transport-usb::usb] log: Connecting codec id="usb2any"
[gc-transport-usb::usb] log: Connecting codec id="power"
[gc-transport-usb::usb] log: Connecting codec id="spi"
[gc-transport-usb::usb] log: codec id="spi" failed to connect: Parameter is out of range
[gc-transport-usb::usb] error: Failed to connect: Parameter is out of range
[gc-transport-usb::usb] debug: Transport id="usb" state changed to disconnecting.
[gc-transport-usb::usb] debug: Aborting connection.
[gc-transport-usb::usb] log: Disconnecting codec id="usb2any"
[gc-target-connection-manager] error: One or more transports failed to connect without error.
[gc-transport-usb::usb] log: Disconnecting transport id="usb"
[gc-transport-usb::usb] info: Hardware not connected.
[gc-transport-usb::usb] debug: Transport id="usb" state changed to disconnected.

Thank you!

  • Hello,

    I brought this thread to the attention of the GUI Composer experts. They should be able to assist further.

    Thanks

    ki

  • Hi Aidan, 

    Please see reply here on some suggestions related to SPI configuration. I don't see any SPI properties in your code snippet either: 

    (2) Connecting USB2ANY to GUI Composer - Code Composer StudioTm︎ - INTERNAL forum - Code Composer StudioTm︎ - INTERNAL - TI E2E support forums

  • I've updated my code with SPI properties based on the documentation for the component gc-codec-usb2any-spi:

    <gc-target-connection-manager auto-connect active-configuration="usb+usb2any(power,spi)">
    <gc-transport-usb id="usb" hid></gc-transport-usb>
    <gc-codec-usb2any id="usb2any"></gc-codec-usb2any>
    <gc-codec-usb2any-power id="power" v33></gc-codec-usb2any-power>
    <gc-codec-usb2any-spi id="spi" clockPhase="following" clockPolarity="low" latchPolarity="high" optional=false latchType="packet" readBitOffset=1 writeBitOffset=0 addressBits=7 addressBitsOffset=0 dataBits=8 dataBitsOffset=0 bitDirection='msb' characterLength=8 parity="even" parityBitsOffset=0 clockDivider=6></gc-codec-usb2any-spi>
    </gc-target-connection-manager>
    <gc-widget-port-selection-dialog id="serial_port_element"></gc-widget-port-selection-dialog>

    This still is not working. 

    Using the inspect tool, it seems that the parameters are not being passed in correctly since params.addressBits should be 7 not 6. See image below,

    Let me know if there is any additional information I can provide.

  • Hi Aiden, 

    You seem to be hitting a subtle difference between attributes and properties. Attributes are part of HTML tags (e.g. <gc-codec-usb2any-spi  .....  is a tag) and javascript object "properties". The infrastructure that we use performs auto conversion between attributes and properties, but their syntax is a bit different. 

    Component help only covers properties which can make it confusing about this difference. 

    e.g. 

    clock-phase="following"   : this is an attribute of an HTML tag

    clockPhase="following" : this is a property of a javascript object. 

    The issue is that you are using javascript object property syntax instead of attribute syntax. 


    The simplest way to avoid this is to add an empty spi tag (as you had it in your original post). Open .gui file in editor (to make it active)

    and then switch to tree layout viewer ( highlighted by green box)

    Select the spi tag (red box)

    Configure all settings in property page (Orange box)

    This approach should avoid using incorrect syntax. 

    Martin