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.

USBSTK5505_I2S_writeLeft / USBSTK5505_I2S_readLeft not working in c5505

Other Parts Discussed in Thread: TMS320C5505

I am using TMS320C5505 eZdsp USB Stick and USBSTK5505_I2S_writeLeft / USBSTK5505_I2S_readLeft are not working. they just hang at their while loops waiting for interrupts:

while((CSL_I2S_I2SINTFL_XMITSTFL_MASK & regs->I2SINTFL) == 0);  // Wait for transmit interrupt to be pending

This is the Code i am using:

#include <stdio.h>
#include "csl_gpt.h"
#include "csl_intc.h"

#include "usbstk5505.h"
#include "usbstk5505_i2s.h"

#include <csl_general.h>

extern void VECSTART(void);

void CSL_gptIntr(void);

interrupt void gpt0Isr(void);

int i;
Int16 data;

void main(void)
{
i = 0;
CSL_gptIntr();
USBSTK5505_init();
data = USBSTK5505_I2S_init();
printf("%d\n",data);
while(1);
}

void CSL_gptIntr(void)
{
CSL_Handle hGpt;
CSL_Status status;
CSL_Config hwConfig;
CSL_GptObj gptObj;

hGpt = GPT_open (GPT_0, &gptObj, &status);

GPT_reset(hGpt);
IRQ_clearAll();
IRQ_disableAll();

IRQ_setVecs((Uint32)(&VECSTART));
IRQ_plug(TINT_EVENT, &gpt0Isr);
IRQ_enable(TINT_EVENT);

hwConfig.autoLoad = GPT_AUTO_ENABLE;
hwConfig.ctrlTim = GPT_TIMER_ENABLE;
hwConfig.preScaleDiv = GPT_PRE_SC_DIV_1;
hwConfig.prdLow = 0x0C35;
hwConfig.prdHigh = 0x0000;

GPT_config(hGpt, &hwConfig);
IRQ_globalEnable();
GPT_start(hGpt);
}

interrupt void gpt0Isr(void)
{
IRQ_clear(TINT_EVENT);
i++;
data = 5;
if(i==256)
{
i = 0;
USBSTK5505_I2S_writeLeft(data);
printf("%d\n",data);
USBSTK5505_I2S_readLeft(&data);
}
CSL_SYSCTRL_REGS->TIAFR = 0x01;
}

Can you please tell me what i am doing wrong?