cancel
Showing results for 
Search instead for 
Did you mean: 

SPI interface for STM32L476VG

RShiv.1
Senior

STM32L476VG is the MCU we are interfacing with ST25R3911B using SPI.

what we have understood from some search is that we need RFAL (abstraction layer) to interface with RF HAL.

Then once we integrate RFAL and RF HAL in our system workbench(ac6) project we need to build the integration then use SPI calls to read the register from RFID reader ST25R3911B

we wanted to use ISO-14443A standard to be configured and read the values.

where do we get the basic RFAL work space or code flow so that we shall use in our current project?

Kindly guide us and let us know are we in right path?

190 REPLIES 190
RShiv.1
Senior

Hi BT,

Our tag is ISO14443A

RFAL_NFCA_***:

                platformLog("ISO14443A/Topaz (NFC-A ***) TAG found. UID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ) );

This is the print val I am expecting...will send you the SPI and IRQ trace.

regards

Ravi

RShiv.1
Senior

Hi BT,

Attached are the images of SPI_CLK,MISO,MOSI,CS and IRQ.Kindly let us know any other changes which needs to be done.

thanks and regards

Ravi

Brian TIDAL
ST Employee

Hi,

images of SPI_CLK,MISO,MOSI,CS and IRQ do not help as this is not a logic analyzer trace. A logic analyzer records data and decodes protocols (such as SPI), so that I can analyze.

If you do not have a logic analyzer, you will have to enter into the code and debug. In that case, print the return code of rfalNfcaPollerCheckPresence.

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.
RShiv.1
Senior

Hi BT,

to check SPI we know that SPI initialization print is working right(demoini)..atleast the start is fine..any other parameters to be checked there..we will see if we can get logic analyser ..

I have added the code in dmeo.c do not what I have done is right or wrong based on akk req I gave 0x52 and 0xc based in *** platform..let me know

ret1 = rfalNfcaPollerCheckPresence(0x52,0x0c);

    platformLog("return code %d\r\n",ret1);

Let me whether this correct and where do I need to add the code..curretnly after adding dod not get any print..

Let me if we have to enter the code where we need to debug and put the prints..do you have a document for this which explains so that we shall get some clue.

thanks and regards

Ravi

RShiv.1
Senior

Hi BT,

I am getting return code 33

Brian TIDAL
ST Employee

Hi Ravi,

my expectation was that you would have print the return code of rfalNfcaPollerCheckPresence inside this rfalNfcaPollerCheckPresence just before the return ret. Please do not modify the demo.c and revert your changes. Error 33 mean wrong state because you have added a call to rfalNfcaPollerCheckPresence in an unexpected place.

/*******************************************************************************/
ReturnCode rfalNfcaPollerCheckPresence( rfal14443AShortFrameCmd cmd, rfalNfcaSensRes *sensRes )
{
    ReturnCode ret;
    uint16_t   rcvLen;
    
    /* Digital 1.1 6.10.1.3  For Commands ALL_REQ, SENS_REQ, SDD_REQ, and SEL_REQ, the NFC Forum Device      *
     *              MUST treat receipt of a Listen Frame at a time after FDT(Listen, min) as a Timeour Error */
    
    ret = rfalISO14443ATransceiveShortFrame(  cmd, (uint8_t*)sensRes, (uint8_t)rfalConvBytesToBits(sizeof(rfalNfcaSensRes)), &rcvLen, RFAL_NFCA_FDTMIN  );
    if( (ret == ERR_RF_COLLISION) || (ret == ERR_CRC)  || (ret == ERR_NOMEM) || (ret == ERR_FRAMING) || (ret == ERR_PAR) )
    {
       ret = ERR_NONE;
    }
    platformLog("rfalNfcaPollerCheckPresence return code  %d\r\n",ret); // <------- JUST HERE ONLY
    return ret;
}

Once modified, compile/link/flash/execute and tell me the result.

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.
RShiv.1
Senior

Hi BT,

I have captured the print and sending in doc...since its pointing to wrong state

#define ERR_WRONG_STATE          ((ReturnCode)33U) /*!< incorrent state for requested operation */

what in demo.c needs to be changed so that I can configure correct state and get the values??

Kindly help here as we are closer I guess.

thanks and regards

ravi

RShiv.1
Senior

Hi BT,

I am getting retun code 4

RShiv.1
Senior

Hi BT,

I am getting the return code 4 ..attached is the print what I got

RShiv.1
Senior

Hi BT,

any clue what needs to be changed from here ..any H/W or S/w configuration.

regards

Ravi