cancel
Showing results for 
Search instead for 
Did you mean: 

I want to send the ST25R3916B nfc tag readings to CAN bus.

NAkku.1
Associate III

I have program for CAN bus and NFC08a1 but when i combine i get several errors. All i want to do is get the reading from the nfc reader and send them on can. does anyone know how to do that?

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Issue solved.

To ensure that the compiled driver meets the user intended device, it is required to add a pre-processor instruction defining the targeted ST25R device (e.g. ST25R3916B).

This needs to be globally defined as a compiler define (i.e. the RFAL source code should ***not**** be modified to add this define at source file level).

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

35 REPLIES 35
Brian TIDAL
ST Employee

Hi,

can you elaborate on your issue:

  • which MCU or MCU board do you use?
  • do you use any expansion boards in addition to X-NUCLEO-NFC08A1 ?
  • which kind of error do you face ?

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.

I am using l476rg board. I have nfc08a1 working and can bus work separately when i combine the code nothing works. I dont know why. The nfc08a1 wont work at all. I made sure the clock configuration is all good. I am using mcp2551 transceiver for can bus but nothing else. I am not getting any error the code compiles and everything.

Brian TIDAL
ST Employee

Hi,

do you use ST X-CUBE-NFC6 FW package? if yes, can you recompile with ST25R_SELFTEST being defined and check the return code of st25r3916Initialize function?

Also can you connect a logic analyzer on SPI (CLK/MOSI/MISO/CS) + IRQ_3916 and provide a trace?

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.

Yes indeed that is the library package i have been using. Where in the program do you want me to define selftest? in the main function? Yes i can connect the logic analyzer on the spi and interrupt pins.

Brian TIDAL
ST Employee

Hi,

just add ST25R_SELFTEST in the list of preprocessor defines in the compiler configuration of your IDE

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.

I did it. Still no difference. I have no errors like i expected but nothing on the nfc08a1.

Brian TIDAL
ST Employee

Hi,

you mean: st25r3916Initialize returns ERR_NONE?

Can you elaborate on your code using the RFAL:

  • is your code based on the demo_polling.c provided in the X-CUBE-NFC06A1 package or do you have your own polling loop ?
  • if using your own polling loop, do you use RFAL High Layer API from rfal_nfc.c or directly technology API from rfal_nfca.c/rfal_nfcb.c/rfal_nfcf.c/rfal_nfcv.c?

Can you set a breakpoint in rfalFieldOnAndStartGT and check the return code?

Using an oscilloscope, can you probe the RF field?  (just connect the GND of the probe to the tip of the probe and put the probe on the antenna and you should be able to capture the field)

Can you provide a logic analyzer trace (SPI+IRQ)?

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.

Hey Brian, YEs the code is based on pollingdetectndef.. I put the logic analyzer on spi and irq no data at all. It acts like as though Spi is not initialized even i did. I can send you my entire code. do you have an email address? I am super new to cubeide and this is my very first project.

Brian TIDAL
ST Employee

Hi,

if the SPI is not initialized, it is unlikely that st25r3916Initialize() returns ERR_NONE (as st25r3916Initialize is supposed to read the IC Identity over SPI...). I would suggest to check the logic analyzer connection to the X-NUCLEO-NFC08A1 (e.g. GND pin...).

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.