Skip to main content
AVima.1
Visitor II
May 23, 2023
Solved

Repeated Start bit code without memory address

  • May 23, 2023
  • 2 replies
  • 944 views

I am using a Flintec TR2 board, and I want to communicate with it via my STM32 L496zg Nucleo Board. It uses I2C repeated start condition to communicate. Most of the codes I found online suggest using HAL_I2C_Mem_Read/Write functions but the user manual does not have any register addresses mentioned in the manual.

Can someone guide me on this?

This topic has been closed for replies.
Best answer by Foued_KH

Hello @AVima.1​ ,

"The TR2 will operate in 7-bit addressing mode with a slave address of 0x03.

All communication on the I2C bus is driven by the master ECU and thus operates in a

request/response format. The command set is broadly split into three command types: read

commands, write commands and execute commands"

So I suggest you use the HAL functions :

/* Transmits in master mode an amount of data in blocking mode */ 
HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 
/* Receives in master mode an amount of data in blocking mode */
HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)

Foued

2 replies

Foued_KH
Foued_KHBest answer
ST Employee
May 26, 2023

Hello @AVima.1​ ,

"The TR2 will operate in 7-bit addressing mode with a slave address of 0x03.

All communication on the I2C bus is driven by the master ECU and thus operates in a

request/response format. The command set is broadly split into three command types: read

commands, write commands and execute commands"

So I suggest you use the HAL functions :

/* Transmits in master mode an amount of data in blocking mode */ 
HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
 
/* Receives in master mode an amount of data in blocking mode */
HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)

Foued

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.
Pavel A.
Super User
May 26, 2023

@AVima.1​ In this case the command code and checksum (two bytes) stand for a 16-bit "memory address". So you can use HAL_I2C_Mem_Read for read and execute commands.