i had TWRPXN20 tower system. for evaluation purpose, i tried to access spi2 with fopen("spi2",NULL) as given in spi memory example.For "spi0:" and "spi1:" fopen() call return success but for "spi2:" and "spi3:" function just hand and never come out from call.
After long debugging with BSP and PSP code, i found that execution hang at line (202 of spi_pol_dspi.c) dspi_ptr->MCR &= (~ DSPI_MCR_MDIS_MASK);
of TWRPXN20 BSP code.
I had enable all SPI module in BSP and also recompiled BSP and PSP.