cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7's I2C4 using BDMA not triggering Complete Callbacks.

MLuis.1
Associate III

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?

12 REPLIES 12
Foued_KH
ST Employee

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.

The I2C communications work fine as long as I use the IT functions or polling functions.

The problem only occurs when using DMA.

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.

Yes, I thought the same. Any tips on how to do that?

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.

The compiler does not accept that syntax.

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.

Still not working using uint8_t __attribute__((section (".RAM_D3"))) I2C_buffer_Tx[1];

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.