This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/AM3359: I2C issues

Part Number: AM3359

Tool/software: TI-RTOS

Hi,

I'm currently trying to get the beaglebone black to communicate with a BNO055 device via I2C.  

Setup:

  • CCS Version: 7.2.0.00013
  • Emulator is Spectrum Digital XDS200
  • Modded the BBB rev. C for JTAG -> connects and works
  • Using TI-RTOS

My understanding is that BBB has 3 I2C, where I2C0 is not pinned out since it's being used by PMIC, EEPROM, etc.  I2C1/2 are available and pinned to P9.17/24, P9.18/26 for I2C1 and P9.19/21, P9.20/22 for I2C2

I'm trying to use I2C2 to communicate with the BNO055, but I2C_open(I2C_BNO055_INSTANCE, &i2cParams); in ti/drv/i2c/I2C_drv.c causes the BBB to free run whenever I2C_INSTANCE != 0.  So it crashes.  I have SDA/SCL pulled up via 4.7Kohm resistor to 3.3V and still same results.

I used the pdk's I2C_Example_bbbAM335x_armExampleProject as reference.  This compiled and ran properly, with the exception of the probe test, which I'm not 100% sure what the test does.  Using this example, I modified it for I2C2 and my application (code below)

 

I receive the proper default values for i2cParams.  I then step into the bno055_init(...) function, which in turn calls my BNO055_I2C_bus_write(...) function.  This, along with the read and delay functions needed to be defined as per BNO055 Quick Start Guide.  The issue is when I call the I2C_open function...

 

Below I've highlighted where my issue is.  I've stepped through this function and determined that the actual crash is in I2C_open -> return (handle->fxnTablePtr->openFxn(handle, params)) -> I2CMasterDisable(hwAttrs->baseAddr);

Where hwAttrs->baseAddr == 0x4819C000, which by looking at the memory map, is correct.

Another interesting thing is that when I try to step into this function the BBB free runs and throws an exception at 0x8105D010 whenever I pause the run.  I've verified the, via disassembly, that the crash happens at exactly 'bl I2CMasterDisable.'  Mind you, this function is valid and has an address.  I'm able to 'bypass' this error when I include the .c file for that function.  This is probably another topic on its own though, but my understanding is that the libraries are already linked with this example project so I'm not sure why it does that.


 

Am I missing something? Power to the other I2C modules? Pinmux maybe? Clocking?  Whenever one connects to the ARM core the GEL automatically runs and inits everything, I think, but maybe it isn't. 

 

Thanks