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.

Endless loop in GIO_Write()

Hi,

I had an application developed with DSP/BIOs 5.41 for C6747 DSP. In this application, I have a UART device (UART 1) and a GPSInit() task. After connecting to my target (with the GEL meant for EVMC6747_DSP), I override the setup (see codes below) within the GPSInit() task. Once run, I found that the application is hung in the first GIO_write(), which is within my resetGPS() function.

Can you suggest what are the causes that will loop the GIO_write endlessly? Is it the wrong pinmux setup for UART 1? Are there anything else I missed?

/////////////////////////// This task is setup in the TCF /////////////////////////

void GPSInit(void)

{

    :
    :
    /////  Although the evmC6747_dsp.gel is executed ////////////
    /////  we override here especially the pinmux ///////
    initSysCfg();     // Setup pinmux
    initPll();             // Setup PLL
    initPSCOn();    // Setup PSC
    initEMIFA();      // Setup External Memory Interface A
    initEMIFB();      // Setup External Memory Interface B
    :
    :
    pGPSReceiver = new UbloxLEA4TGPSReceiver(hUart_OUT, hUart_IN);    // No problem here
    pGPSReceiver->reset();    // Stuck here because of the GIO_write() that is in this function.
    :
    :
}
////////////////// For overriding the pinmux in the GEL /////////////////////////////
void initSysCfg(void)
{
    // Unlock BOOTCFG module before pinmux configuration
    KICK0R = KICK0_UNLOCK_CODE;
    KICK1R = KICK1_UNLOCK_CODE;
    PINMUX0  = 0x11111188;  // EMIFB, Check EMU0/RTCK
    PINMUX1  = 0x11111111;  // EMIFB
    PINMUX2  = 0x11111111;  // EMIFB
    PINMUX3  = 0x11111111;  // EMIFB
    PINMUX4  = 0x11111111;  // EMIFB
    PINMUX5  = 0x11111111;  // EMIFB
    PINMUX6  = 0x11111111;  // EMIFB
    PINMUX7  = 0x11111111;  // EMIFB, SPI0
    PINMUX8 = 0x11111111; // SPI1, UART0, McASP1
    PINMUX9  = 0x11011111; // RMII CLK, McASP0, USB_DRVVBUS, SPI1
    PINMUX10 = 0x22222221;  // RMII/ McASP0
    PINMUX11 = 0x11111122;  // McASP1, UART1, McASP0, MDIO (last 2 digits 0x22 for MDIO instead of GPIO)
    PINMUX12 = 0x11111111;  // McASP0 / McASP1
    PINMUX13 = 0x22111111;  // SD / McASP1
    PINMUX14 = 0x88222222;  // SD / EMIFA
    PINMUX15 = 0x21888888;  // SD / EMIFA
    PINMUX16 = 0x11111112;  // SD / EMIFA
    PINMUX17 = 0x00100111;  // EMIFA
    PINMUX18 = 0x11111111;  // EMIFA
    PINMUX19 = 0x00000001;  // EMIFA
}
Thank you.
Chee-Beng

  • I suspect that you are not looping in GIO_write(), but instead you are "blocked" on a SEM semaphore waiting for the I/O to complete.   GIO_write() calls SEM_pend() to wait for the I/O to complete.  When the device driver finishes the I/O packet, it calls back into GIO module which will post this semaphore.  You should be able to use Kernel/Object view (KOV) to see the state of the tasks in your system.  


    To debug, I would put a breakpoint on the UART transmit ISR in the driver code to see if the ISR ever runs.  

  • Hi Karl,

    Thanks for your help. Indeed, the GIO_write() is pended for I/O to complete. In turned out that I got the interrupt number wrong for Uart 1. I was quite confused by the mapping of interrupts and ECM. Now I understand it fully. My application works.

    Thanks.

    Chee-Beng