Hello again,
I have finally found out by myself what was going on. I have written my ISR based on a fluxogram at the reference manual, and the first thing that should be done is to clean ihe IICIF bit at the I2Cx_S register. I am using the code line:
I2C1_S |= 0x02;
Which should write 1 to the IICIF bit without affecting the others. However, when I execute that line, the ARBL bit at the same register is cleared. I believe this is a hardware bug, but I managed to find a simple workaround: I just copied the status register to a variable before clearing the IICIF bit, and then I work with that variable to go through the IFs.
So, if any of you intend to work with a Kinetis I2C module in multimaster mode, make sure that you copy the status register before clearing the interrupt flag.
Now I can detect an arbitration loss, but I found another problem. I believe that it is better if I present it in another post.
Cheers,