Program freezed after Wire.endTransmission();

Has anyone ever seen this problem when using WIRE library? Recently I am trying MP3 player, RTC and other device with strange issue and it all points to when I use wire library the process halt right after the line "Wire.endTransmission();"

For example:

{
  char len = 0;
  len = strlen(cmd);
  Wire.beginTransmission(0x35);
  while(len--)
  {
    Wire.send(*(cmd++));     
  }
  Serial.println("Still able to see this line...");
  Wire.endTransmission();    // stop transmitting
  Serial.println("Never gets here...");
}

Any clue??

Just for grins

What does endTransmission() actually do?

Im not really a programmer.

Im not really a programmer. I think it stop transmitting action in Wire library and keep excute the next line but in my case it freezed at this line.

endTransmission()

endTransmission() will send all unsent data before closing so if there is a send error (slave not responding, bus error, …) it may freeze with current version of the wire library.

Check this thread.