- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I created a thread and it worked.