Hi experts,
I trying using multiple channels in mcspi3, All things are good when using polling mode. But when I using blocking mode and callback mode instead polling mode, only the first opened channel will transfer successfully. When I operate other channels, the transfer function will crash. I trace where it crash, I found it's in SPI_v1.c's line 772 McSPICSAssert(hwAttrs->baseAddr, chNum);
But if I just using one channel that first opened, it work normally.
This code shows where it crash.
if(SPI_MASTER == chObj->spiParams.mode) { McSPIIntEnable(hwAttrs->baseAddr, intStatus); if (hwAttrs->chMode == MCSPI_SINGLE_CH) { /* Assert un-used chip select (Force SPIEN) */ McSPICSAssert(hwAttrs->baseAddr, chNum); //Crash here } } else { McSPIIntEnable(hwAttrs->baseAddr, (uint32_t)(MCSPI_INT_RX_FULL(chNum))); }
Regards.