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.

General Modifications Required For TAS1020B FDK v1.8 for Adopting to a New Hardware.

Other Parts Discussed in Thread: TLV320ADC3101, TLV320AIC3254, TLV320AIC3254EVM-KHi, I am working with TLV320AIC3254EVM-K and my own designed hardware containing TAS1020B and TLV320AIC3254 chips. Also I am using the FDK v1.8, which is originally written for 'TAS1020 Evaluation Module' by Indesign. After going through the data-sheet of TAS1020B, TAS1020 Firmware Application Note, the code within the 'Application'/'ROM' directories and few threads on TAS1020B community, I concluded following things: 1. FDK v1.8 cannot directly be used for my hardware and TLV320AIC3254EVM-K. 2. FDK v1.8 addresses AC97 Codec interface and my hardware uses TLV320AIC3254, which has an I2S Codec interface. 3. FDK v1.8 has an HID Class for giving the status of Mute, volume up/down buttons which I don't require. So now I am on a mission to modify the FDK v1.8 accordingly and make it work for my hardware. As TLV320AIC3254EVM-K gets enumerated as 'USB Composite device', 'USB HID device' and 'USB Audio Device', I can record and play music using this EVM. I want my hardware to behave in similar manner i.e it gets identified as 'USB Audio Device' (I don't need HID class as of now). So to start with, I made use of the default binary named 'APP116.bin', by putting it in the EEPROM of my own designed hardware. With this binary, my hardware only gets identified as 'USB composite device' but no longer as an 'USB Audio Device' (I felt some modification to the code are required). But when I used the compiled binary (generated by uVision4 and without any changes done to the code) instead of APP116.bin, then the my hardware doesn't enumerates at all, not even as 'unknown device'. I had expected it to enumerate similar to the one using APP116.bin. I proceeded with modifying the code in order to get my hardware identified as 'USB Audio Device' but in vain. Below I am describing my understating of the code and the corresponding modification done by me (Please correct me if I am doing it wrong): 1. The Devices.c file has the main function which does the USB engine initialization a then keeps infinitely looping, giving out status of volume buttons. All the USB requests to device i.e Setup, Descriptors, and data are serviced by the USB modules utilities in the ROM code via interrupt service routines. 2. As all the USB requests are handled via interrupt service routines and the required code is already present in ROM, I am required to modify only the Devices.c and Codec.c files. 3. Even if the Audio Codec chip is absent, that shouldn't stop the hardware from being identified as 'USB Audio Device'. So I began to look for portions which actually set dependencies on availability of Audio Codec chip and remove this dependencies. I found one in the file Devices.c on line no.126, and I commented it out. 4. To the end, after commenting the unwanted portions (which I felt to be) in the Devices.c, I had a minimum setup required in accordance to section 7.1 of TAS1020 Firmware Application Note. Below is the code after modification : File Devices.c (line 075 - line 184) void main() { // Give the XRAM time to powered up as the MCU of the emulator is faster #ifdef _EMULATOR_ delay(80); GLOBCTL |= 0x04; delay(100); #else delay(80); GLOBCTL |= 0x04; delay(10); #endif IE = 0; //CoAc97ModePin0 = CoAc97ModePin1 = 0; COMMENTED BY ME //DEV_TURN_OFF_AMP; // ROM code using PDATA starting at 0xFA00 P2 = 0xFA; RomRecord.state = ROM_APP_RUNNING; // Just a dummy code to force the compiler to keep // DevFunctionEntryParser() in the final codes AppDevice.dummy = 0; if(AppDevice.dummy) DevFunctionEntryParser(0, 0); devInit(); //softPllInit(); COMMENTED BY ME (for the moment I dont want to generate clocks for codec) // using ROM DFU handler //devRomFunction(ROM_INIT_DFU_STATE); COMMENTED BY ME // Take Codec out of reset CPTCTL = 0x01; // Turn external interrupt off devTurnOffRemoteWakeUp(); // Reinitialize flags AppResetFlag1 = AppSleepModeOn = AppSuspendFlag = AppResetFlag = FALSE; // Setup USB engine for connection USBENGINE_EP0_SIZE = DEV_MAX_EP0_PKT; devRomFunction(ROM_ENG_USB_INIT); // Turn on SOF ISR USBIMSK |= 0x10; // wait till codec inited //DevAmpCounter = 1500; COMMENTED BY ME // while (AppDevice.configSetting == 0) COMMENTED BY ME devCheckReset(); //DevAmpCounter = 0; COMMENTED BY ME AppResetFlag1 = AppSleepModeOn = AppSuspendFlag = AppResetFlag = FALSE; // wait for the host to settle down if needed while(1) { // Check for USB Reset // devCheckReset(); COMMENTED BY ME // butChkUpdate(); COMMENTED BY ME // devUpdate(); COMMENTED BY ME if ((AppSuspendFlag == TRUE) && (AppResetFlag == FALSE) && (USBFADR != 0)) { devSleepModeOn(); AppSleepModeOn = TRUE; // For fremote wake up // devSetRemoteWakeUp(); COMMENTED BY ME #ifdef _EMULATOR_ while (AppSuspendFlag == TRUE); #else PCON = 0x09; #endif while (AppSleepModeOn == TRUE); devCheckReset(); AppSuspendFlag = FALSE; // Delay a bit (approx. 5 ms) to account for button debounce if it was used to // do a remote wake up. delay(20); } }; } Has anyone modified the FDK v1.8 code for his hardware OR can anyone suggest the general modification required for FDK v1.8 code to make suitable for other hardware. The As far as I understand the Codec related settings shouldn't stop any hardware from being identified as 'USB Audio Device'. For time being, I require the Codec Chip to be configure for one particular setting at the start and all the USB request for setting the device profile(according to USB Audio Class Standard) be accepted and simply ignored. Once my hardware becomes capable as 'USB Audio Device' I can later deal with USB request for setting device profile. So till the point where an general hardware is identified as 'USB Audio Device', what are the basic required modification to FDK v1.8 ? Thanks in Advance :)
  • brontok, > 1. FDK v1.8 cannot directly be used for my hardware and TLV320AIC3254EVM-K. True. > 2. FDK v1.8 addresses AC97 Codec interface and my hardware uses TLV320AIC3254, which has an I2S Codec interface. True. > 3. FDK v1.8 has an HID Class for giving the status of Mute, volume up/down buttons which I don't require. Ok. You _could_ leave this capability in until later (e.g., you might need the code RAM space, for example, and be forced to excise it). > I want my hardware to behave in similar manner i.e it gets identified as 'USB Audio Device' (I don't need HID class as of now). You could modify the USB Device Descriptor to identify the Device as an Audio Class 1.0 device. > So to start with, I made use of the default binary named 'APP116.bin', by putting it in the EEPROM of my own designed hardware. With this binary, my hardware only gets identified as 'USB composite device' but no longer as an 'USB Audio Device' Even when running on the TAS1020BEVM, usbView indicates that it is a USB composite device, because the Device Descriptor does not identify the DeviceClass. It's only at the Interface level that Audio Class is made visible. If you know you don't want anything other than an Audio Class device, you could do it in the Device descriptor. > But when I used the compiled binary (generated by uVision4 and without any changes done to the code) instead of APP116.bin, then the my hardware doesn't enumerates at all, not even as 'unknown device'. This is a major problem. If you can't build an application from the FDK that matches the behavior of the pre-built app116.bin, then there's something going wrong in your build environment. Note that the 'hex2bin.exe' that is provided in the FDK is a 16-bit application, which will not run on 64-bit Windows currently. I can provide an 'alpha' 32-bit hex2bin.exe that can run on 64-bit Windows if you need one. I have previously done something like what you are looking for (at least in regard to using I2S instead of AC97). The target was a system with four analog inputs, using two TLV320ADC3101, and no analog outputs. The attached zip represents an intermediate step in the transformation from the code initially in the USB-MODEVM to the final version. I think it represents the point wherein no custom driver was required, but still had support for stereo in and out. Regards, Frank
  • Hi Frank,  can you please provide the 'aplha 32-bit hex2bin.exe'.

    Regards, Brontok.

     

  • Brontok,

    Here's a zip with the source and executable for the alpha version, compiled using a 32-bit compiler.  Please report any problems.

    Thanks,

    Frank

  • Hi Frank,

    Thanks for the code.

    When I used the try6.bin from the freshly extracted try6.zip file, my hardware got enumerated as USB Composite, USB Audio Device, USB HID Device  and finally a string said something similar to "Device ready to use" .

    But when I use the try6.bin generated after compiling the project using uVision4, I see no enumeration.

    It seems to me that some additional changes OR extra settings are required than merely opening and building a project in uVision4, which was originally created in uVision2 or uVision3. Can I know details of your tools and development environment used for compiling try6 files.

    I also gave a try by replacing the hex2bin.exe with its cousin (the one compiled with 32 bit compiler), still there is no improvement in the situation.

    I am attaching the snapshot of the uVision4 with the try6 project files.

    Any idea what must be going wrong ?

    Regards,

    Brontok

  • Hi Brontok,

    did you got answers to your last question?

    I have exactly the same problem with uVision2 conversion to uVision4.

    The Build works with uVision3 but when I compile the same project files with uVision4, BIN files does not work correctly.

    Best regards

    Kari