cancel
Showing results for 
Search instead for 
Did you mean: 

Cude max

SMazu.3
Associate III

 

I hope this message finds you well. I am reaching out regarding an urgent matter with my STM32 CubeMX v6.1 project. I have encountered an issue with the I2C functionality that I cannot seem to resolve despite trying various approaches.

The specific problem arises with the following function:

SMazu3_0-1713767509891.pngSMazu3_1-1713767529673.pngSMazu3_2-1713767543607.pngSMazu3_3-1713767569402.png

SMazu3_4-1713767620074.png

 

I have attempted to implement this function across different STM microcontroller units, including STM32WB10, STM32F750, and STM32F103, but unfortunately, the issue persists consistently across all of them. It's worth noting that I have verified the hardware compatibility by successfully testing it with Arduino and ESP32 platforms.

Given that I have a project deadline looming, I urgently require your assistance in resolving this matter. Any guidance or insights you can provide would be greatly appreciated.

Thank you very much for your prompt attention to this matter. I look forward to your response.

1 ACCEPTED SOLUTION

Accepted Solutions

What's the first bit map of.code fragment about?

Probably issue not where you're looking.

State slave part and connectivity. 

Don't use internal pull up on AF OD. Use an external pull up likely in 1K5 to 2K7 range.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

15 REPLIES 15
SMazu.3
Associate III

"if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, Tickstart) != HAL_OK)

{

return HAL_ERROR;

}"

 

this function is come true.

 

 

AScha.3
Chief III

@SMazu.3  , what i dont understand :

you call (blocking) HAL_I2C_Master_Transmit() , that will return success or error

and then (i assume - you dont show your program) I2C_WaitOnTXISFlagUntilTimeout() to check --- what ?

 

TXIS flag ?

AScha3_0-1713770522031.png

-> transmit interrupt status : but you dont use interrupt call at all.

I would say: just leave it away or use interrupt I2C calls.

If you feel a post has answered your question, please click "Accept as Solution".

What's the first bit map of.code fragment about?

Probably issue not where you're looking.

State slave part and connectivity. 

Don't use internal pull up on AF OD. Use an external pull up likely in 1K5 to 2K7 range.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

already using 4k7 with 3v3

SMazu3_0-1713772045973.png

 

default i2c setting.

Screenshot 2024-04-22 132042.pngScreenshot 2024-04-22 131956.png

Pavel A.
Evangelist III

MC3479 It's MEMSIC accelerometer

I2C: supports 400 KHz and fast mode +. Has two interrupt pins with programmable mode/polarity. 

The 7-bit address can be 0x4C or 0x6C (see the PDF pg, 35).

 

hw is working i test that with Arduino and esp32 and esp8266, 

 

stm code is no working. WaitOnTXISFlagUntilTimeout come Hal_Error very time.

 

with Master mode Slave mode and and all i2c code by cube ide or cube max have this problem 

with stm32wb10 stm32f103. and stm32f750

Consistency is good, it hints that you're doing something generally wrong for the ST library. Check that you pass the I2C address in correct format. 

 

  • Check this flowing all st documention