How to use ST32MC0 for I2C communication over 2050 bytes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-01 1: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.
- Labels:
-
STM32C0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-02 7:19 PM
Hi @Foued_KH,
Problem solved.
The cause was my mistake in writing the program.
Thanks for your support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-01 2: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-01 5:21 PM
Hi @KHALSI_Foued
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-02 7:19 PM
Hi @Foued_KH,
Problem solved.
The cause was my mistake in writing the program.
Thanks for your support.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-04 6:51 AM
Why the hell are you attaching a HAL file, which is available for everyone anyway?
