cancel
Showing results for 
Search instead for 
Did you mean: 

Working with X-NUCLEO-NFC10A1 with esp32

Abhishek_1305
Associate II

I am currently working with the X-NUCLEO-NFC10A1 board and interfacing it with an ESP32 DevKit V1. While attempting to establish communication between the two, I have tried all SPI modes as well as different reset logic configurations, but I am still unable to get them to communicate properly.

I have included my Arduino test code below for reference, which I am using to verify the communication:
Please check in attachment section there is code file

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

make sure VDD and VDD_IO are both provided to the X-NUCLEO-NFC10A1. Make sure the various GND pins are properly connected. 

Could you also send a picture of your setup?

Strange to see MISO always at 1. Could you check MISO/MOSI have not been swapped?

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

6 REPLIES 6
Ulysses HERNIOSUS
ST Employee

Hi  Abhishek_1305,

Please observe:

Attach a logic analyzer to CS,MISO,MOSI,SCLK,RESET. See that SPI is driven in the right mode according to DS.

If you see the right waveforms and still doesn't work: Double check the supply and the connections. If still not working: Please share the logic analyzer traces + picture of the setup and any other helpful information.

BR, Ulysses

 

 

Brian TIDAL
ST Employee

Hi,

in your readReg code 

uint8_t readReg(uint8_t reg) {
  uint8_t val;
  SPI.beginTransaction(spiSettings);
  selectChip();
  SPI.transfer(0x40 | reg);
  val = SPI.transfer(0x00);
  deselectChip();
  SPI.endTransaction();
  return val;
}

 SPI.transfer(0x40 | reg); is likely not correct. See Table 3 in the ST25R200 Data Sheet.

A C driver library is available for the ST25R200. It is portable on different MCU (STM32 or other MCUs). It prevents the need to reimplement the driver from scratch. See the X-CUBE-NFC10 package or the ST25 embedded NFC library.

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 currently working on interfacing the ESP32 with the X-NUCLEO-NFC10A1 board over SPI, and I would like to share my setup along with the steps I’ve already taken.

Here is my current connection configuration:

  • ESP32 GPIO23 → MOSI (X-NUCLEO-NFC10A1)
  • ESP32 GPIO19 → MISO (X-NUCLEO-NFC10A1)
  • ESP32 GPIO18 → SCK (X-NUCLEO-NFC10A1)
  • ESP32 GPIO5 → CS (X-NUCLEO-NFC10A1)

I have also attached logic analyzer captures along with my latest code for your reference.
Attached image bytes when I am sending 0x3F register with MSB Bit high and it becomes 0xBF and it gives response 0xFF.

Additionally, I have experimented with all SPI modes by configuring different combinations of CPOL and CPHA, but I am still facing issues with proper communication.
Currently I am using this SPI mode 
Mode 1 (CPOL=0, CPHA=1): Clock idles low, data sampled on falling edge.

Could you please review my setup and provide guidance on what might be going wrong or any additional configurations I should check?

Hi,

make sure VDD and VDD_IO are both provided to the X-NUCLEO-NFC10A1. Make sure the various GND pins are properly connected. 

Could you also send a picture of your setup?

Strange to see MISO always at 1. Could you check MISO/MOSI have not been swapped?

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,

things to check:

  • Is MISO in input state of MCU? Possibly open it up and observe only on ST25R side.
  • Observe signals with a scope: Are the levels correct? Is the ST25R trying to respond?

Ulysses

Dear STM Community Support Team,

Thank you for resolving my issue so quickly. I appreciate your support and assistance.