Thank you for additional information.
MCF5225X use legacy SPI driver and it seems that CS selection cannot be handled by text parameter (8) in command: spifd = fopen ("spi0:8", NULL);.
Please try edit _bsp_qspi0_init() constant in init_spi0.c file according your needs(CS3).
If you need change CSx during runtime, please use ioctl command IO_IOCTL_SPI_SET_CS.
CS pins are defined as:
#define MCF5XXX_QSPI_QDR_QSPI_CS3 (0x08)
#define MCF5XXX_QSPI_QDR_QSPI_CS2 (0x04)
#define MCF5XXX_QSPI_QDR_QSPI_CS1 (0x02)
#define MCF5XXX_QSPI_QDR_QSPI_CS0 (0x01)
So, if you want CS0 and CS3 signals simultaneously, please use MCF5XXX_QSPI_QDR_QSPI_CS0| MCF5XXX_QSPI_QDR_QSPI_CS3 as parameter for IO_IOCTL_SPI_SET_CS command.
I suppose that chip select offset in your case is just some side effect.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------