Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
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?
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.
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.
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?