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.

TUSB8041: How to use custom strings via I2C

Part Number: TUSB8041

Hello,

I would like to override the product & other strings using the I2C interface.

In our application the I2C lines are kept high so the device boots in 'unconfigured state'.

After this we can write data to register 0x0B to select correct USB2 polarity mapping, followed by writing 0x01 to register 0xF8 after which the device boots and enumerates without issue.

However we would also like to override the product strings so our device is more recognisable.

Before enabling the device by setting 0xF8 we now:

  • Write register 0x05 with 0x90 to enable custom strings.
  • Write register 0x24 with non-zero value to set product string length
  • Write register 0x90+ with the string

However as soon as 0x24 is non-zero the device enumerates with 'USB device not recognised'.

After this, in device manager, we have a 'Generic USB hub' that is OK (but no change in string) and 'Generic SuperSpeed USB hub'  for which windows can't load drivers.

For test we use:

  • register 0x24 = 0x04
  • register 0x90 = 0x4D
  • register 0x91 = 0x00
  • register 0x92 = 0x61
  • register 0x93 =0x00

When repeating the same procedure for manufacturer string, the device enumerates OK but doesn't show a custom string.

Do we need to create a own driver/inf file in order for this to work or is there something else going on?

  • Hi,

    What is the state of the SMBUSz pin? You are not using a EEPROM correct? 

  • Hi Malik,

    We have SMBUSz connected to GND using a 1k resistor. We are indeed not using an EEPROM.

    We have to first configure the device from our MCU using the SMBus (we drive this as I2C, after checking the datasheet in our case the bus of course is an SMBUS, but as far as I know the only difference is in time-out behavior which is not an issue in the way we drive it)

    All actions I mention above are of course before clearing the CFG_ACTIVE bit by writing 0x01 to 0xF8.

    I can also read back the register settings above after writing them.

  • Hi,

    So you can see TUSB8041 attempt enumeration before clearing the CFG_ACTIVE bit? To answer you earlier question, driver is assigned based on VID/PID combination so I do not believe this is the issue. Have you set customStrings bit appropriately (0x05 bit 7 = 1)?

  • Hi Malik,

    Sorry for the late reply. For the proto-tpye batch we were starting up for deliveries I was trying to get a name into the hub to make testing our proto's a bit easier. They have two of these hubs and with a name it is easer to check if they enumerated OK. At this time the issue has a lower priority but I will pick this up again soon for the next batch, planned delivery mid dec 2021

    The TUSB doesn't attempt to enumerate before CFG_ACTIVE is cleared. It also remains in active mode until that time drawing ~200mA from 3V3 which we convert to 1.1V with a step down. (Now checking the spec.. this is also strange.. Behavior is normal when specified current 'after reset' refers to 'after CFG_ACTIVE cleared'. We keep it in pre-config mode by connecting I2C lines)

    I also set the customStrings bit. It still works fine when I set this bit and keep the string 'empty' with default settings (0x24 value 0). Only when I set lenght and some data enumeration fails.

    My suspicion is that windows rejects the string data. I am currently developing some tools for electronics development (protoworkbench), this includes an executable pseudo code scripting language. Below is the code I run to initialise the TUSB after supplying it with power. It looks like C but I can have constant arrays in function calls.

    The WriteRepRead function arguments are:

    •  address
    • bytes to write
    • #bytes to read

    All works fine as long as I keep 0x24 at value 0. With the script as it is, enumaration fails (device not recognised).

    // Hub board

    // Enumaration info
    // techcommunity.microsoft.com/.../270685

    // Disable hub configuration in 'Boot hub-board before using this'

    // Configure hub ports
    pcb3PCB200009B10_Hub.busI2C.WriteRepRead(0x44,{0x0B,0x83},0);


    // Set custom strings
    pcb3PCB200009B10_Hub.busI2C.WriteRepRead(0x44,{0x05,0x90},0);  // Enable custom strings

    //For example, these 3 Unicode characters, U+004D, U+0061 and U+10000
    // will be converted into 0x4D00 6100 00D8 00DC when UTF-16LE is used.

      // Product string
      pcb3PCB200009B10_Hub.busI2C.WriteRepRead(0x44,{0x24,0x04},0);  // String length
     
      pcb3PCB200009B10_Hub.busI2C.WriteRepRead(0x44,{0x90,0x4D},0);  // String 'A'
      pcb3PCB200009B10_Hub.busI2C.WriteRepRead(0x44,{0x91,0x00},0);  // String 'A'  
      pcb3PCB200009B10_Hub.busI2C.WriteRepRead(0x44,{0x92,0x61},0);  // String 'A'
      pcb3PCB200009B10_Hub.busI2C.WriteRepRead(0x44,{0x93,0x00},0);  // String 'A'  

    // Activate hub
    pcb3PCB200009B10_Hub.busI2C.WriteRepRead(0x44,{0xF8,0x01},0);

  • Hi,

    I will have to look into this and get back to you next week.