cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 I2C ST LIB

kjepsen9
Associate II
Posted on October 06, 2008 at 15:39

STM32 I2C ST LIB

3 REPLIES 3
kjepsen9
Associate II
Posted on May 17, 2011 at 12:46

Hello,

I am doing some I2C programming, and my code generates hardware fault when i use this command:

RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1, ENABLE);

But do i set the bit this way the code works:

RCC->APB1ENR |= RCC_APB1Periph_I2C1;

What is the difference?

Kasper

16-32micros
Associate III
Posted on May 17, 2011 at 12:46

Hi Kasper,

Could you please provide your project and tool-chain version, It seems a software issue in the link of the Library files.

You can refer to this App note for I2C :

http://www.st.com/stonline/products/literature/an/15021.pdf

and associated software :

http://www.st.com/stonline/products/support/micro/files/an2824.zip

STOne-32.

stm322
Associate II
Posted on May 17, 2011 at 12:46

In my experience, you better not to use the library already compiled.

You better to include library source files that you need and recompile them inside your project.

I did experience a bug regarding a RCC function (can't remember which one). When I was using the library there was the bug. By integrating the file stm32f10x_rcc.c in my project, there was no bug.