You are here

FX3 SPI error CY_U3P_ERROR_MUTEX_FAILURE | Cypress Semiconductor


Summary: 2 Replies, Latest post by nia_1534961 on 21 Jan 2016 09:55 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
nia_1534961's picture
20 posts

I am triggering SPI register reads via GPIO34 but get a CY_U3P_ERROR_MUTEX_FAILURE when

CyFxSpiTransfer() -> CyU3PSpiTransmitWords() calls CyU3PSpiGetLock().  I am using the CyFxUsbSpiRegMode example as a template but controlling the SPI SSN with GPIO34. 

If I manually call CyFxSpiTransfer() the spi read works fine. 


    spiConfig.isLsbFirst = CyFalse;
    spiConfig.cpol       = CyTrue;
    spiConfig.ssnPol     = CyFalse;
    spiConfig.cpha       = CyFalse;
    spiConfig.leadTime   = CY_U3P_SPI_SSN_LAG_LEAD_ONE_HALF_CLK;
    spiConfig.lagTime    = CY_U3P_SPI_SSN_LAG_LEAD_HALF_CLK;
    spiConfig.ssnCtrl    = CY_U3P_SPI_SSN_CTRL_HW_EACH_WORD;
    spiConfig.clock      = 20000000; // set clock to 20MHz //16-20MHz
    spiConfig.wordLen    = 32; // set word length to 32 bits

Who else uses glSpiLock?


PRAG's picture
Cypress Employee
173 posts

Are you calling this from within a GPIO callback (or any other interrupt context) by any chance? If yes, then this error will occur.

You will need to move your code out to a RTOS user thread.

nia_1534961's picture
20 posts

Thanks, I created a thread and it worked.

Log in to post new comments.