I2C on the BCM943362WCD4 EVB

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Having been recently introduced to the Broadcom environment through the generous donation of an eval board, I've been attempting to get the module to talk to an I2C peripheral using the GPIO breakout header.  Unfortunately, however, there seems to be quite a dearth of documentation surrounding this interface.

The eval board itself is labeled as the BCM943362WCD4, and in digging through the WICED 3.1.0 SDK I found a folder containing pictures for various platforms.  Given the way the board was labeled the BCM9WCD4EVAL2 folder appeared to be the closest match, however the "bcm9wcd4eval2.jpg" photo contained therein definitely does not match the board I have in my hands - the GPIO header in the picture goes up to 30 pins, while board I have only goes up to 18.  After some digging, the closest match I can come pu with is the BCM9WCD1EVAL1_P400 eval board, upon which the WCD4 module has been attached.


Therefore, my first suggestion might be to better organize these resources.

After evaluating the schematic and identifying the breakout header labels, I was unable to find anything labeled that suggested which pints to use for I2C.  I therefore turned to grepping the SDK folder for the phrase "I2C" and was ultimately encouraged by the table found in platforms/BCM943362WCD4/platform.h, suggesting that I2C1 was available using pins 11(SCL) and 12(SDA) - great!

My attention then turned to setting up a wiced_i2c_device_t object to pass to wiced_i2c_init, at which point I was promptly confronted with trying to determine the .port attribute of this type definition.  wiced_platform.h defines it as a wiced_i2c_t type, and while wiced_i2c_t seems to be defined in platform.h, there doesn't seem to be a corresponding mapping in platform.c.  In fact, I2C doesn't seem to be addressed at all within platform.c, leading me to believe it's not implemented on this platform.

As such, my somewhat long-winded questions are: 1) is I2C configured and enabled on this platform and, if so, 2) can someone be so kind as to provide example code that illustrates configuring, initializing and interacting with an I2C device using this platform?

0 Likes
5 Replies
GregG_16
Employee
Employee
50 sign-ins 25 sign-ins 25 comments on KBA

Hi

We will get you sorted. We have done this before just need to dig up the i2c files. also, good feedback on the platform docs. I am surprised sines this is our most common eval board.

0 Likes
Anonymous
Not applicable

Hi Gangi,

On the same lines as Mr. Schrage in the above post, I am also using the same platform as his and stuck up on getting the i2c work properly. I am using with dma_enable. I am able to probe the device properly and I presume I am able to write to the slave device's internal register address some known data but I am unable to read it properly. In quite, due to lack of documentation, I am unable to understand the exact flow of how the i2c device gets the internal register's read address, how it gets set for read inside the wrapper with dma option and where the data from the device gets filled in.

Any help would be greatly appreciated.

Regards,
Rohit

0 Likes
SeyhanA_31
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

Hi,

On BCM943362WCD4, the I2C pins from the STM32F215 MCU are routed to a header on the eval board and setup as output to control LEDs on the breakaway section. That is only for one use case for the pins. Same pins could be setup as I2C use as well.

The I2C interface is demonstrated on multiple eval platforms. I guess you do not have the BCM9WCDPLUS114 eval board but the I2C setup could be found in BCM9WCDPLUS114 platform files. The BCM9WCDPLUS114 uses the same MCU (STM32F215RGT6) as BCM943362WCD4.

You can update the .../platforms/BCM943362WCD4/platform.c with I2C definitions similar to BCM9WCDPLUS114 platform file.

1. Add WICED_I2C_1 to wiced_i2c_t in platform.h

     const platform_i2c_t platform_i2c_peripherals[] = {...}

2. Define platform_i2c_t in platform.c

     typedef enum { WICED_I2C_1,...}

Calling wiced_i2c_init(&platform_i2c_peripherals) would initialize the defined I2C peripherals. You may find more I2C functions wiced_i2c_xxx(...) defined in .../include/wiced_platform.h.

Thanks,
Seyhan

0 Likes
Anonymous
Not applicable

Thanks Seyhan, I'll give this a shot.

0 Likes
Anonymous
Not applicable

Hi bja,

Did you have success with copying the definitions from the BCM9WCDPLUS114 platform? I copied all the structs and so on but all I get is a timeout within i2c_wait_for_event( i2c->port, I2C_EVENT_MASTER_MODE_SELECT, I2C_FLAG_CHECK_TIMEOUT ) in platform_i2c.c. It seems that the bus is somehow poisened with data and states and therefore doesn't fulfil the checked event (wrong bus parameters?).


Hopefully I just messed up some config parameters or wiring which doesn't work on the BCM943362WCD4_EVB. What wiring and parameters did you use?


Sadly, I'm totally stuck at this point .


Best regards

K. Schrage

0 Likes