cancel
Showing results for 
Search instead for 
Did you mean: 

Repeated Start bit code without memory address

AVima.1
Associate

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Foued_KH
ST Employee

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.

View solution in original post

2 REPLIES 2
Foued_KH
ST Employee

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.
Evangelist III

@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.