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.

Host Driver Stuck at sl_start(0,0,0)

Other Parts Discussed in Thread: MSP430F6736, CC3100

hi, im using cc3100 boosterpack and msp430f6736 with target board msp-TS430PZ100B

i've downloaded the SDK and ported the host driver implementation to my target board, 

i'm trying to run the next program :

int main(void) {
	int AP;

    WDTCTL = WDTPW | WDTHOLD;	// Stop watchdog timer
	AP = sl_Start(0,0,0);
	return 0;
}

but it gets stuck inside the sl_start function at :

OSI_RET_OK_CHECK(sl_SyncObjWait(&g_pCB->ObjPool[pObjIdx].SyncObj, SL_OS_WAIT_FOREVER));

i've looked for solution but didnt find, what i kknow is that, the function is infinite loop, that will break only if there is interrupt from IRQ,

so i looked at P2 interrupt routine:

#pragma vector=PORT2_VECTOR
__interrupt void IntSpiGPIOHandler(void)
{
    switch(__even_in_range(P2IV, P2IV_P2IFG7))
    {
      case P2IV_P2IFG7:
#ifndef SL_IF_TYPE_UART
        if (pIraEventHandler)
        {
            pIraEventHandler(0);
        }
#else
        if(puartFlowctrl->bRtsSetByFlowControl == FALSE)
        {
            clear_rts();
        }

#endif
        break;
    default:
        break;
    }
}

more over i looked at the register and saw that i actually have an interrrupt at P2.7 = IRQ (P2IV = 0x10, P2IFG=0xFF, P2IE = 0x80 , P2IES = 0)

im adding also a probe on the ports and my spi.c, board.c

why doesnt it work?

spi.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
* spi.c - msp430f5529 launchpad spi interface implementation
*
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
board.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
* board.c - msp430f5529 launchpad configuration
*
* Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
user.h

  • Hi Yogev,

    Can you please confirm and make sure that 'SL_IF_TYPE_UART' is not defined in the project?
    Can you please share the implementation of 'sl_IfRegIntHdlr' function mapped in user.h?
    Also please try putting a breakpoint inside the interrupt handler (IntSpiGPIOHandler).

    Regards,
    Ankur
  • hi

    SL_IF_TYPE_UART is not defined in pre-symbol list, also i looked to see maybe it was defined at libarary but its not,

    the implementation of sl_IfRegIntHdlr

    int registerInterruptHandler(P_EVENT_HANDLER InterruptHdl , void* pValue)
    {
        pIraEventHandler = InterruptHdl;
    
        return 0;
    }

    opened pIraEventHandler :
    P_EVENT_HANDLER                pIraEventHandler = 0;

    and the definition of P_EVENT_HANDLER :
    typedef void (*P_EVENT_HANDLER)(void* pValue);

    i did put a break point in the IntSpiGPIOHandler before i was posting, the program dont gets there

    im adding the sl_start implementation :

    #if _SL_INCLUDE_FUNC(sl_Start)
    int sl_Start(const void* pIfHdl, char* pDevName, const P_INIT_CALLBACK pInitCallBack)
    {
        int pObjIdx = MAX_CONCURRENT_ACTIONS;
        InitComplete_t  AsyncRsp;
      
        /* callback init */
        _SlDrvDriverCBInit();
    
        /* open the interface: usually SPI or UART */
        if (NULL == pIfHdl)
        {
            g_pCB->FD = sl_IfOpen(pDevName, 0);
        }
        else
        {
            g_pCB->FD = (_SlFd_t)pIfHdl;
        }
        /* Use Obj to issue the command, if not available try later */
        pObjIdx = _SlDrvWaitForPoolObj(START_STOP_ID,SL_MAX_SOCKETS);
        if (MAX_CONCURRENT_ACTIONS == pObjIdx)
        {
             return SL_POOL_IS_EMPTY;
        }
        OSI_RET_OK_CHECK(sl_LockObjLock(&g_pCB->ProtectionLockObj, SL_OS_WAIT_FOREVER));
        g_pCB->ObjPool[pObjIdx].pRespArgs = (UINT8 *)&AsyncRsp;
        OSI_RET_OK_CHECK(sl_LockObjUnlock(&g_pCB->ProtectionLockObj));
    
        if( g_pCB->FD >= 0)
        {
            sl_DeviceDisable();
    
            sl_IfRegIntHdlr((SL_P_EVENT_HANDLER)_SlDrvRxIrqHandler, NULL);
    
            sl_DeviceEnable();
    
            if (NULL != pInitCallBack)
            {
                g_pCB->pInitCallback = pInitCallBack;
            }
            else
            {
    			OSI_RET_OK_CHECK(sl_SyncObjWait(&g_pCB->ObjPool[pObjIdx].SyncObj, SL_OS_WAIT_FOREVER));
    	        /*release Pool Object*/
                _SlDrvReleasePoolObj(g_pCB->FunctionParams.AsyncExt.ActionIndex);
    			return GetStartResponseConvert(AsyncRsp.Status);
    		}
        }
    
        return (int)g_pCB->FD;
     
    }

    the program stucks there 

    the IRQ handler:

    /*****************************************************************************
     _SlDrvRxIrqHandler
    *****************************************************************************/
    void _SlDrvRxIrqHandler(void *pValue)
    {
        sl_IfMaskIntHdlr();
    	
        g_pCB->RxIrqCnt++;
    
        if (TRUE == g_pCB->IsCmdRespWaited)
        {
            OSI_RET_OK_CHECK( sl_SyncObjSignalFromIRQ(&g_pCB->CmdSyncObj) );
        }
        else
        {
            sl_Spawn((_SlSpawnEntryFunc_t)_SlDrvMsgReadSpawnCtx, NULL, 0);
        }
    }
    

    more over i add the board.c and spi.c

    0412.spi.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    /*
    * spi.c - msp430f5529 launchpad spi interface implementation
    *
    * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
    *
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the
    * distribution.
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    3125.board.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    /*
    * board.c - msp430f5529 launchpad configuration
    *
    * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
    *
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the
    * distribution.
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Yogev,

    It looks like some issue in the porting since the interrupt is getting triggered by CC3100 but is not captured by MSP430. You should check the board configuration.
    Can you please share spi and board configuration files for us to review?

    Regards,
    Ankur
  • hi,

    i added those files in the post and my comment, see above

  • Hi Ankur,

    Yogev and I are trying for a while now to get this boosterpack working, but with no success.

    I decided to read about the CC3100 from scratch and encountered this lines:

    During initialization, nHIB pin is asserted (to enable the device), while the nRESET pin is kept high. At this stage, HOST_IRQ pin should be driven low by the device until initialization is complete. During this time, and until HOST_IRQ is asserted for the first time, the host must not communicate with the device otherwise the communication with the device might not be established."

    source:

    http://processors.wiki.ti.com/index.php/CC31xx_Host_Interface

    do we need to drive low the IRQ pin before we initiate with sl_start? 

    Thanks for your help so far,

    Hadar

  • Hi Hadar/Yogev,

    I apologies for the delayed response on this. Can you please update if the issue is resolved?

    Regards,
    Ankur
  • Yes Ankur we got it fixed.

    Thank you for checking with us

  • Hadar,

    Thanks for the confirmation
    I am closing this thread.

    Regards,
    Ankur
  • I'm none the wiser from this thread. What exactly is the solution? I have the same problem with all of the getting_starteds - it just stops dead at the bit: marked HERE below

        if( g_pCB->FD >= (_SlFd_t)0)
        {
            sl_DeviceDisable();
    
    HERE->  sl_IfRegIntHdlr((SL_P_EVENT_HANDLER)_SlDrvRxIrqHandler, NULL); <-HERE
    
            g_pCB->pInitCallback = pInitCallBack;
       
            sl_DeviceEnable();
            .... etc

    Please excuse my lack of understanding. This is because I'm just getting started with these getting started examples and it's a bit difficult to get started with them if they don't work.

  • I think it was enable all interrupts bit in msp430 - check it out