cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-F722ZE I2C2 in slave mode doesn't work nothing.

RCata
Associate III

Hi,

I am using NUCLEO -F722ZE board for testing the STM32F7 and their peripheral features. Other peripherals I tested works fine, but I have encountered a problem with I2C2 in slave mode, that doesn't send ACK when the master calls it (status flags keeps idle too).

STM32 core and AHB/APB buses are working at maximum speed (216MHz, 108MHz, etc...).

Here is the code:

// 1st configuring RCC, GPIO, and reset for enable I2C2:

RCC->APB1ENR=0x3040000B;      // I2C2 (and others) clocked

RCC->APB1RSTR=0xE2F7CBFF;   // Reset I2C2

RCC->APB1RSTR&=0xCFBFFFF4; // Free reset of I2C2

GPIOB->MODER=0x55A55555;     // PB10 PB11 in alternate function

GPIOB->OTYPER=0x00000C00;    // PB10 PB11 open drain

GPIOB->ODR=0x00001C00;           // PB10=Higo PB11=High preventively

GPIOB->PUPDR=0x00000000;      // No pullups (I use external ones)

GPIOB->AFR[1]=0x00004400;       // PB10=I2C2_SCL, PB11=I2C2_SDA

// I2C2 config as Slave at addres 0x0B:

I2C2->CR1&=~I2C_CR1_PE;          // preventively disable peri

I2C2->OAR1=0x00008016;            // 7-bit addr is 0x0B

I2C2->CR1=0x0003107E;               // Some ints enabled (I tried other configs for this register)

I2C2->CR1|=I2C_CR1_PE;               // Finally, enable peripheral

That is the simpliest config can I do. With this, I2C2 must ACK at their call, but this is the result:

0690X0000088scvQAA.bmp

Please, don't take care with low level of SCL at end, things of the master, but see the 9th bit is NACK.

Can somebody help me? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
RCata
Associate III

Guys, forget this post. The problem was a briken trak in PCB. Sorry for the disturbances.

I levae the post for help other people. Configuring code works fine.

View solution in original post

1 REPLY 1
RCata
Associate III

Guys, forget this post. The problem was a briken trak in PCB. Sorry for the disturbances.

I levae the post for help other people. Configuring code works fine.