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.

TAS1020B - problem in code combilation with SDCC.

Hi.

I am trying to combile the example c code given in 'TAS1020b Firmware development kit'.  I found that it is not compatible to SDCC combiler.  So I used some pearl script to make it as SDCC compatible from Keil compatible.  Then I combiled the code in SDCC.  The code didn't work when I downloaded it to the device.  So I manually modified the required things to make it SDCC compatible.  Now the something is happening.  The PC identifies that some application device is attached to it.  But it is not recognize it as an Audio class device.

When I downloaded the hex file provided in the 'TAS1020b Firmware development kit.zip' It opens two pop-ups in the right corner of the devices, (one is  "found new hardware, TAS****....."  and the other one is related to the successful installation of audio device".  When I download the hex file generated using SDCC, I see the pop-ups But it says that it has detected some unknown devices.  It is not showing that "device name", "Vendor name' or anything.

Has anyone else had the same issues?  Can anyone tell me how can I solve this issue?  Does anyone have the working code compatible to SDCC?

Regards,
M. John Rupert

  • John Rupert said:

    Hi.

    I am trying to combile the example c code given in 'TAS1020b Firmware development kit'.  I found that it is not compatible to SDCC combiler.  So I used some pearl script to make it as SDCC compatible from Keil compatible.  Then I combiled the code in SDCC.  The code didn't work when I downloaded it to the device.  So I manually modified the required things to make it SDCC compatible.  Now the something is happening.  The PC identifies that some application device is attached to it.  But it is not recognize it as an Audio class device.

    When I downloaded the hex file provided in the 'TAS1020b Firmware development kit.zip' It opens two pop-ups in the right corner of the devices, (one is  "found new hardware, TAS****....."  and the other one is related to the successful installation of audio device".  When I download the hex file generated using SDCC, I see the pop-ups But it says that it has detected some unknown devices.  It is not showing that "device name", "Vendor name' or anything.

    Has anyone else had the same issues?  Can anyone tell me how can I solve this issue?  Does anyone have the working code compatible to SDCC?

    Regards,
    M. John Rupert

    The biggest difference between Keil and SDCC is that the former is big-endian and the latter is little-endian. So any variable declared as an integer (or short, both are 16 bits) will need special consideration if you need to access its individual bytes. I've taken to using an enum and a typedef to make sure I get the correct byte when I need it:

    #ifdef SDCC

    enum { LSB, MSB };  // endian-LSB first

    #else

    enum { MSB, LSB };  // endian-MSB first

    #endif

    typedef union _uword {
        unsigned int w;
        unsigned char b[2];
    } uword_t;

    So instead of declaring unsigned shorts, declare the necessary variables as uword_ts and use the usual union access to get the bytes or the word.

    -a