2023-05-29 07:18 AM
I'm using an STM32H725 to communicate with an i2c sensor. I'm using the I2C4 bus with the HAL DMA functions. I also enabled the BDMA channels for the rx and tx and respective interrupts. The problem is that the complete rx/tx callbacks are not triggered.
I found that this could be related to the problem described here: https://st.my.site.com/community/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices
Any solutions to this problem?
2023-05-30 02:37 AM
Hello @MLuis.1 ,
First, make sure that you are using the correct address and the correct frequency for the I²C communication.
The take an oscilloscope to check the I2C_SDA and I2C_SCL behavior to define the error source.
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-05-30 02:41 AM
The I2C communications work fine as long as I use the IT functions or polling functions.
The problem only occurs when using DMA.
2023-05-30 03:01 AM
You should place the buffer for transmission or reception in the SRAM4.
SRAM4 region : 0x38000000 - 0x38003FFF
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-05-30 03:16 AM
Yes, I thought the same. Any tips on how to do that?
2023-05-30 03:47 AM
As example :
uint8_t I2C_buffer_Tx[data_size] @ 0x38001000 ;
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-05-30 03:52 AM
The compiler does not accept that syntax.
2023-05-30 04:04 AM
You can try with this code :
/* Buffer used for transmission */
#if defined ( __ICCARM__ )
#pragma location = 0x38000000
uint8_t I2C_buffer_Tx[1] ;
#else /* __GNUC__ or __CC_ARM */
uint8_t __attribute__((section (".RAM_D3"))) I2C_buffer_Tx[1];
#endif
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-05-30 04:11 AM
Still not working using uint8_t __attribute__((section (".RAM_D3"))) I2C_buffer_Tx[1];
2023-05-30 08:07 AM
which IDE do you use ?
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.