cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411 Discovery's PB6 not working as I2C1_SCL

mbedsyst
Associate II

I have an STM32F411E-DISCO board and I am facing a problem with the I2C1 Peripheral

1. I configured the I2C1 (PB6 & PB9) to interface with the CS43L22 Audio DAC on the Discovery Board and it gets stuck at waiting for the SB bit in I2C1->SR1 register to be set.

2. Then, I configured PB6 as I2C1_SCL and PB9 as I2C1_SDA to interface with an external EEPROM, the 24C256N to write data to the memory. It also gets stuck at waiting for the SB bit in I2C1->SR1 register to be set. 

3. Then, I changed the I2C1_SCL to PB8 and kept I2C1_SDA as PB9, and I can successfully write and read the EEPROM. 

The problem I am facing is, the I2C_SCL for the CS43L22 is mapped to the PB6 of the STM32F411VET6 MCU and it is not possible to have a workaround this. 

Can anyone help me?

6 REPLIES 6
Andrew Neil
Evangelist III

@mbedsyst wrote:

The problem I am facing is, the I2C_SCL for the CS43L22 is mapped to the PB6 of the STM32F411VET6


That shouldn't be a problem - that is the documented design:

AndrewNeil_0-1727858197341.png

If the I2C connection to the audio DAC (CS43L22) isn't working, then you need  to debug what's wrong.

Does it work with the standard ST examples for the board?

Note that the LSM303... e-compass is also on I2C1 - does  that work?

 

Without having a look at the schematics or the CS43L22 datasheet, isn't there some reset signal which has to be pulled to appropriate level before the DAC starts to be responsive? And same for the MEMS chip to which the same SCL/SDA is connected, too.

JW

I wasn't pointing to the fact that PB6 being mapped to the CS43's SCL is my problem, I was saying that I couldn't get the PB6 to function as SCL but PB8 works fine. I tried writing and reading the EEPROM with PB8 as I2C1_SCL and it worked fine. Since the CS43 is connected to PB6, I wanted to make sure the SCL works, so I tried with the EEPROM, but it failed.

You are right, I did that too after you mentioned it. But, then also it gets stuck waiting for the SB bit to be set in SR1 Register.  I am trying to get the EEPROM to work with PB6 as SCL, because I can verify if my driver is working or not with the EEPROM. I could see some examples with the F407 Discovery, but nothing with CMSIS for the F411 Discovery.

So if you look at PB6 and PB9 with an oscilloscope, what do you see? Is there I2C activity?

 

QSHAO.1
ST Employee

Refer to information below, you are allowed to try an audio application in F4 Cube at STM32CubeF4 - STM32Cube MCU Package for STM32F4 series (HAL, Low-Layer APIs and CMSIS, USB, TCP/IP, File system, RTOS, Graphic - and examples running on ST boards) - STMicroelectronics. it should be good reference to enable audio function on F411E Discovery. thanks!

 

QSHAO1_0-1729762596890.png