Hello,
first of all: Merry Chrismas to all
Hope your fine.
My problem: I like to use a chip which takes it's firmware via I2C I/F. This firmware is long, longer than the buffer in the lib of i2c_t3. When I increase the buffer of the lib to 1kB and send a FW package which is about 900 bytes, everything is fine. But I need also to send FW images which are longer (about 500kB). Yes it takes a while but this is not problem. The problem is, I do not have success to send larger files than the internal buffer of the lib is.
I have no idea but I guess the chip I'm using is not handle the repeated start correctly.
Sample code (not the code I'm using):
Code:
do
{
Wire.beginTransmission(address);
status = Wire.write( &buf[completedLen], wrLenToSend);
// evaluete sendStop: I2C_NOSTOP or I2C_STOP
Wire.endTransmission(sendStop); // sendStop is set correct, I have checked this
status = Wire.finish(1000000L);
if(status==0)
{
PRINT_ERR("i2c finish error\n");
}
}
while(sendStop==I2C_NOSTOP);
When I send a package with 900 bytes and the lib internal buffer is 1kB, everything is fine. When I decrease the lib internal buffer to the original values (259 bytes), the loop is running 4 times. On the logic analyzer I
found the correct data, e.g.:
Code:
START,addr, <data bytes>, ACK
repeated START,addr, <data bytes>, ACK
repeated START,addr, <data bytes>, ACK
repeated START,addr, <data bytes>, ACK, STOP
But this is not working. Only this is working:
Code:
START,addr, <complete data bytes>, ACK, STOP
Now my question: how to use the lib, sending a large amount of data (longer then the internal buffer is) without the repeted start? The lib should not use it's internal buffer, send data immediatly.
I guess it is not possible in the moment but may be there is a solution (may be without this lib)?
Thank you very much for helping
Edit: The chip documentation does not describe the "protocol" in detail using I2C, only states, I may use the I2C IF to load and command.
Edit2: The chip I'm using has no address to initiate the FW download. Only a command "Load FW" without a target address. So on the I2C bus you see:
START, device address, n bytes of data (without target/register address), ACK, STOP.