RSL10 issues with SPI

Hi there

i am working on a project where i need to connect a sensor to an rsl10 with SPI. I was able to set up the right pins with the CMSIS driver and a think that the initialisation works.
To test the connection i hooked up the CS-Signal to an oscilloscope: Befor the initialisation the signal is floating, then when initialised the signal is high (SPI inactive). After the initialisation i set the SPI connection to “activ” in the code and the signal coresondingly goes low.

But there is where the issues start: I then i try to receive data with spi0->Receive(sensor_data, 12);. This should read data from SPI0, then go into the defined callback function and set the CS back to high. But it seems like it never enters the callback function and hence is also unable to set the CS back to high.
I have talked to experts form my university but we were not able to figure out why it wont work properly. Now i really hope that someone who is an exprt with the rsl10 can help me to get the SPI interface working.

To really see how i implemented it so far i attached the my project file (KEIL), as well as the main application file.

I hope i have worded my issue understandably, will gladly answer questions to clarify things and really hope that someone out there can help me.

Best regards, Hannes

app.c (10,8 KB)

Kaffetasse.Target_1.cprj (3,9 KB)

Hi @chuannes

Could you please check the return values of all of the the spi0 calls during initialization and ensure that they are all equal to ARM_DRIVER_OK?
Looking at your code you seem to be requesting ARM_SPI_CPOL1_CPHA1 mode which is not supported by the hardware.

Excerpt from RTE/CMSIS-Driver/SPI_RSLxx.c driver file:
    /* Frame format */
    switch (control & ARM_SPI_FRAME_FORMAT_Msk)
    {
        /* Polarity normal */
        case ARM_SPI_CPOL0_CPHA0:
        {
            /* Set polarity normal*/
            ctrl0 |= SPI0_CLK_POLARITY_NORMAL;
            break;
        }        

        /* Polarity inverse */
        case ARM_SPI_CPOL1_CPHA0:
        {
            /* Set polarity inverse */
            ctrl0 |= SPI0_CLK_POLARITY_INVERSE;
            break;
        }        

        /* Not supported modes */
        case ARM_SPI_CPOL1_CPHA1:
        case ARM_SPI_CPOL0_CPHA1:
        case ARM_SPI_TI_SSI:
        case ARM_SPI_MICROWIRE:
        default:
        {
            /* Return frame format error */
            return ARM_SPI_ERROR_FRAME_FORMAT;
        }
    }

Best regards,
Lukas