cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Communication with S32K116 host MCU

FurkanSenol
Associate II

Hello everyone,

I am trying to communicate with ST25R3920 using S32K116 host MCU. I managed to read some data but they seem meaningless according the datasheet. For example:

I was trying to read IC identity register(3Fh) to test that if I am able to communicate with the device. When I send 3Fh with 01 prefix for read operation, I read 15h(00010101b) on second byte of buffer. That made me thought maybe I am losing bits during communication because I should read 2Ah(00101010) but then I realized when I to read different registers I get the same 15h value on different byte( like 3rd or 6th byte of receive buffer) and this value is meaningless for that registers.

I tried to configure default options and run the power-up sequence properly but I don't even know if they are executed in right way. I am tagging a snippet that I use to send data to ST25R3920.

So, I was not able to detect the problem causing this issue. What are the options I could try and what could be the issue? I'd appreciate any help if you have an opinion on this topic. Thanks in advance!

Edit: I didnt know what information should I provide here and didn't want to make the question too long. Make me know if you need more information and I will try to provide with my best knowledge.

Best regards,

Furkan

/* OP_READ is prefix for read operation ( 0x01 << 6 ) */
    spiTxBuffer[0] = (OP_READ) | 0x3E;
    /* Pull BSS down to start communication */
    BOARD_SetPin(GPIO_NFC_BSS, RESET);
    status = LPSPI_DRV_MasterTransferBlocking(LPSPICOM1, spiTxBuffer, spiRxBuffer, SPI_BUFFER_SIZE, TIMEOUT);
 
    if ( STATUS_SUCCESS == status )
    {
        LPSPI_DRV_MasterAbortTransfer(LPSPICOM1);
        BOARD_SetPin(GPIO_NFC_BSS, SET);
        memset(spiTxBuffer, 0, SPI_BUFFER_SIZE);
    }

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi Furkan,

The ST25 embedded NFC library, RFAL for ST25R3916/20 and the X-CUBE-NFC6 are all designed to be scalable and to be portable on different MCU and different IDE. I would recommend to base your development on the ST25 embedded NFC library that includes various examples. Then, you'll just need to adapt the platform.h file to point on your MCU adaptations.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Ulysses HERNIOSUS
ST Employee

Hi Furkan,

first thought is that you are looking at effects of incorrectly configured SPI (phase and/or speed). Best if you can provide a logic analyzer trace of SPI.

In general we recommend using our drivers (RFAL, ST25 Embedded NFC lib) because it is a long way from writing registers to actually reading/writing NFC tags.

BR, Ulysses

FurkanSenol
Associate II

Hi Ulysses,

I read that these libraries have examples to run on NUCLEO-STM32L476RG. Is it possible to implement and use these drivers with another IDE and another MCU? Because we are developing our application on S32 Design Studio and using S32 SDK.

Best regards,

Furkan

Brian TIDAL
ST Employee

Hi Furkan,

The ST25 embedded NFC library, RFAL for ST25R3916/20 and the X-CUBE-NFC6 are all designed to be scalable and to be portable on different MCU and different IDE. I would recommend to base your development on the ST25 embedded NFC library that includes various examples. Then, you'll just need to adapt the platform.h file to point on your MCU adaptations.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Brian,

Once we fix the issue with the SPI I will start working with ST25 embedded NFC library. Thanks for the answer and appreciate the help!

Best regards,

Furkan