Hello,
I am trying the example "i2c\master_slave_loopback.c" on the Launchpad (EK-TM4C123GXL).
\TivaWare_C_Series-2.0.1.11577\examples\peripherals\i2c\master_slave_loopback.c
(Code Composer Studio Version: 5.5.0.00077 )
First I had some trouble getting into an ISR trap. The example says:
//! This example uses the following interrupt handlers. To use this example
//! in your own application you must add these interrupt handlers to your
//! vector table.
//! - None.
This is true, however, only when symbol UART_BUFFERED is not defined.
Well - since this source isn't provided with a project I started with some project ... and the symbol happened to be defined. In a case like that all it takes is to put the UART library ISR entry into the vector in the
startup_ccs.c - perhaps as follows:
#ifdef UART_BUFFERED
UARTStdioIntHandler, // UART0 Rx and Tx
#else
IntDefaultHandler, // UART0 Rx and Tx
#endif
I got passed this point so the above is a summary which perhaps might be good to document in the next TivaWare release.
- - - - - - - - -
Now the *problem*:
When running under debugger the code gets stuck in an endless loop:
while(!(I2CSlaveStatus(I2C0_BASE) & I2C_SLAVE_ACT_RREQ)){}
When I suspend the run and initiate Core Reset and restart the code it gets stuck in the same way.
Only when I do System Reset (under CCS or using HW reset button) the example runs as expected.
It almost looks like something isn't properly initialized in this example and the I2C system is in an undesirable state unless hard reset.
I was trying to inspect the I2C0 register set under these two conditions to see a difference.
The trouble is that upon System Reset I cannot see the registers (Error: Unable to read).
Any idea how to proceed?
Thanks,
Martin