cancel
Showing results for 
Search instead for 
Did you mean: 

how to customize X-CUBE-NFC7?

Schuyler
Senior

I can already read the text correctly. But my project needs to use max6675 to write sensor signals and write them to NDEF, What should I do with MX_NFC7_NDEF_URI_Init?

1 ACCEPTED SOLUTION

Accepted Solutions
Rene Lenerve
ST Employee

Hi @帅罗.1 (Community Member)​,

Replacing the NDEF_WriteURI function by the following function, as already provided in another thread, will allow you to write and read memory content with NDEF Text data. To read data from max6675 read the DataSheet for this component, and you will found on the web some resources and examples on how to deal with it. Data coming from this component will only have to be written in the NDEF message.

  /* write text message to EEPROM */
  while( NDEF_WriteText( "NDEF Text message" ) != NDEF_OK );
  
  NDEF_Text_info_t Text;
  sRecordInfo_t record;
  uint8_t p_ndef_buffer[64];
  
  /* read NDEF file */
  NDEF_ReadNDEF(p_ndef_buffer);
  /* Extract record info */
  NDEF_IdentifyBuffer(&record,p_ndef_buffer);
  
  /* Read Text in record */
  NDEF_ReadText( &record, &Text );

Kind Regards.

View solution in original post

3 REPLIES 3
Rene Lenerve
ST Employee

Hi @帅 罗​ ,

The ST25DV64KC component available on the NFC7 can be considered as a standard EEPROM on the MCU side, so you only need to write/read data through I²C as shown in the provided examples. Regarding the max6675 you should read the Datasheet and post on the Max forum if you need more information.

This forum is dedicated to support for ST products only.

Kind Regards.

Schuyler
Senior

Hi,@Rene Lenerve 

I want to use NDEF_WriteText funtion to read and write the temperature,will it work?

Rene Lenerve
ST Employee

Hi @帅罗.1 (Community Member)​,

Replacing the NDEF_WriteURI function by the following function, as already provided in another thread, will allow you to write and read memory content with NDEF Text data. To read data from max6675 read the DataSheet for this component, and you will found on the web some resources and examples on how to deal with it. Data coming from this component will only have to be written in the NDEF message.

  /* write text message to EEPROM */
  while( NDEF_WriteText( "NDEF Text message" ) != NDEF_OK );
  
  NDEF_Text_info_t Text;
  sRecordInfo_t record;
  uint8_t p_ndef_buffer[64];
  
  /* read NDEF file */
  NDEF_ReadNDEF(p_ndef_buffer);
  /* Extract record info */
  NDEF_IdentifyBuffer(&record,p_ndef_buffer);
  
  /* Read Text in record */
  NDEF_ReadText( &record, &Text );

Kind Regards.