2023-08-01 01:04 AM
I am using STM32C031C6 for I2C verification.
I tried to communicate 2050 bytes of data using the HAL driver.
However, it did not receive the correct data.
To be precise, the data at 512,1024,1344,1346,1538,18561 and 1858 bytes were different.
The settings are as follows.
hi2c1.Instance = I2C1;
hi2c1.Init.Timing = 0x0090194B;
hi2c1.Init.OwnAddress1 = 0x10;
hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
hi2c1.Init.OwnAddress2 = 0;
hi2c1.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
Executed with the following description.
"HAL_I2C_Master_Receive(&hi2c1, dev_addr, i2c_read, 2050, 1000);"
Please let me know how I can receive 2050 bytes of data correctly.
Solved! Go to Solution.
2023-08-02 07:19 PM
Hi @Foued_KH,
Problem solved.
The cause was my mistake in writing the program.
Thanks for your support.
2023-08-01 02:31 AM
Hello @kkazu ,
If you want to receive 2050 bytes of data, please flow this sequence : ( Figure 232. RM0490 )
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.
2023-08-01 05:21 PM
Hi @KHALSI_Foued
2023-08-02 07:19 PM
Hi @Foued_KH,
Problem solved.
The cause was my mistake in writing the program.
Thanks for your support.
2023-08-04 06:51 AM
Why the hell are you attaching a HAL file, which is available for everyone anyway?