cancel
Showing results for 
Search instead for 
Did you mean: 

Used ST25DV-DISCOVERY kit and did some hands on with examples, now I want to use the ST25DV driver code to port on different MCU, not from ST micro, Couldu pls let me know whar are other files i need to consider apart from ST25DV driver file ?

RP.305
Associate

When i looked into the doc , i found that "To be usable on any MCU, this driver calls several IOBus functions.  The IOBus functions are implemented outside this driver, and are in charge of accessing the MCU peripherals used for the  communication with the tag", 

 could you pls share if any document steps available to port driver on different micro ?

1 ACCEPTED SOLUTION

Accepted Solutions
Ronald B.
Associate III

Hello,

The ST25DV Cube driver has been designed for STMicroelectronics MCUs but it may be adapted to any hardware by modifying the "IOBus" layer, namely:

NFCTAG_StatusTypeDef ST25DV_IO_Init( void );

NFCTAG_StatusTypeDef ST25DV_IO_MemWrite( const uint8_t * const pData, const uint8_t DevAddr, const uint16_t TarAddr, const uint16_t Size );

NFCTAG_StatusTypeDef ST25DV_IO_Write( const uint8_t * const pData, const uint8_t DevAddr, const uint16_t Size );

NFCTAG_StatusTypeDef ST25DV_IO_MemRead( uint8_t * const pData, const uint8_t DevAddr, const uint16_t TarAddr, const uint16_t Size );

NFCTAG_StatusTypeDef ST25DV_IO_Read( uint8_t * const pData, const uint8_t DevAddr, const uint16_t Size );

uint8_t ST25DV_IO_IsNacked( void );

NFCTAG_StatusTypeDef ST25DV_IO_IsDeviceReady( const uint8_t DevAddr, const uint32_t Trials );

Those functions are defined in the st25_discovery.c file and they are calling the I2C Cube HAL layer (i.e. the STM32 I2C drivers). You basically need to replace those HAL calls by the calls to your MCU I2C driver.

You should have a look to the stm32duino GitHub: https://github.com/stm32duino/X-NUCLEO-NFC04A1

(Especially the x_nucleo_nfc04a1.cpp file, which is the equivalent to the st25_discovery.c for Nucleo board, defining the IOBus: https://github.com/stm32duino/X-NUCLEO-NFC04A1/blob/master/src/BSP/x_nucleo_nfc04a1.cpp)

This is a good example of how to modify the IOBus for non-ST MCU.

View solution in original post

1 REPLY 1
Ronald B.
Associate III

Hello,

The ST25DV Cube driver has been designed for STMicroelectronics MCUs but it may be adapted to any hardware by modifying the "IOBus" layer, namely:

NFCTAG_StatusTypeDef ST25DV_IO_Init( void );

NFCTAG_StatusTypeDef ST25DV_IO_MemWrite( const uint8_t * const pData, const uint8_t DevAddr, const uint16_t TarAddr, const uint16_t Size );

NFCTAG_StatusTypeDef ST25DV_IO_Write( const uint8_t * const pData, const uint8_t DevAddr, const uint16_t Size );

NFCTAG_StatusTypeDef ST25DV_IO_MemRead( uint8_t * const pData, const uint8_t DevAddr, const uint16_t TarAddr, const uint16_t Size );

NFCTAG_StatusTypeDef ST25DV_IO_Read( uint8_t * const pData, const uint8_t DevAddr, const uint16_t Size );

uint8_t ST25DV_IO_IsNacked( void );

NFCTAG_StatusTypeDef ST25DV_IO_IsDeviceReady( const uint8_t DevAddr, const uint32_t Trials );

Those functions are defined in the st25_discovery.c file and they are calling the I2C Cube HAL layer (i.e. the STM32 I2C drivers). You basically need to replace those HAL calls by the calls to your MCU I2C driver.

You should have a look to the stm32duino GitHub: https://github.com/stm32duino/X-NUCLEO-NFC04A1

(Especially the x_nucleo_nfc04a1.cpp file, which is the equivalent to the st25_discovery.c for Nucleo board, defining the IOBus: https://github.com/stm32duino/X-NUCLEO-NFC04A1/blob/master/src/BSP/x_nucleo_nfc04a1.cpp)

This is a good example of how to modify the IOBus for non-ST MCU.