Skip to main content
Mihaita Ivascu
Associate III
May 27, 2025
Solved

st25r3916comRepeatStart() does not work for the st25r3916 driver

  • May 27, 2025
  • 1 reply
  • 398 views

Hello,

 

     I am working with stm32cubeIDE using some NDEF example for nucleo NFC08A1 extension board with st25r3916b rfid reader.

    Debugging the demoCycle example I see that the code that should insert a repeat start on I2C communication does nothing(which confirms what I have described in another post about the stm32ube example for it, not being able to read chip id):

#ifdef RFAL_USE_I2C
static void st25r3916comRepeatStart( void )
{
 st25r3916I2CRepeatStart();
 st25r3916I2CSlaveAddrRD( ST25R3916_I2C_ADDR );
}
#endif /* RFAL_USE_I2C */

it points some macros but that have nothing associated in rfal_platform.h

#define platformI2CRepeatStart() /*!< I2C Repeat Start */
#define platformI2CSlaveAddrWR(add) /*!< I2C Slave address for Write operation */
#define platformI2CSlaveAddrRD(add) 

 

is it expected that the user implements those?

 

Thanks,

     Mihai

 

This topic has been closed for replies.
Best answer by Brian TIDAL

Hi,

which STM32 or which NUCLEO-64 board do you use? Is the code being generated with STM32CubeMX with X-CUBE-NFC6 package? Have you enabled the I2C interrupt? Is the X-NUCLEO-NFC08A1 being modified to support I2C instead of SPI?

Make sure to have EXTI (ST25_IRQ) priority value > IC2 interrupt priority value > SYSTICK interrupt priority value, e.g. EXTI prio 2, I2C prio 1 and SYSTICK prio 0

"So I need to replace those macros with BSP_NFC0XCOMM_SequencialRecv ?": no.

Feel free to send me your ioc and your project.

Rgds

BT

1 reply

Brian TIDAL
Technical Moderator
May 27, 2025

Hi Mihai,

These macros are designed to support different platforms and different I2C drivers. In the case of STM32 platforms, the BSP_NFC0XCOMM_SequencialRecv and BSP_NFC0XCOMM_SequencialSend functions directly handle Start, Stop, and Restart. Thus platformI2CRepeatStart is an empty macro on this platform.

Here are some examples of I2C transactions on STM32L476 platform:

Single register read:

BrianTIDAL_1-1748332334641.png

Multiple register read:

BrianTIDAL_0-1748332310401.png

Single register write:

BrianTIDAL_2-1748332383610.png

Fifo load:

BrianTIDAL_3-1748332585478.png

Direct command:

BrianTIDAL_4-1748332713449.png

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.
Mihaita Ivascu
Associate III
May 27, 2025

Hello BT,

 

      Thanks for the quick reply.

      Yes I am familiar with the i2c transactions, I was able to communicate with st25r3916 rfid using Arduino and Wire lib. But not with Stm32cubeIDE and the st25r3916 driver.

      This is a bit unfortunate as it seems it would be easier using the ndef example from stm32cubeIDE.

      So I need to replace those macros with BSP_NFC0XCOMM_SequencialRecv ?

      I did not see that function being called while debugging. Actually I don't see where it is implemented.

 

Thanks,

      Mihai

 

     

 

 

Brian TIDAL
Brian TIDALBest answer
Technical Moderator
May 27, 2025

Hi,

which STM32 or which NUCLEO-64 board do you use? Is the code being generated with STM32CubeMX with X-CUBE-NFC6 package? Have you enabled the I2C interrupt? Is the X-NUCLEO-NFC08A1 being modified to support I2C instead of SPI?

Make sure to have EXTI (ST25_IRQ) priority value > IC2 interrupt priority value > SYSTICK interrupt priority value, e.g. EXTI prio 2, I2C prio 1 and SYSTICK prio 0

"So I need to replace those macros with BSP_NFC0XCOMM_SequencialRecv ?": no.

Feel free to send me your ioc and your project.

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.