Peter A. Bigot - 2014-03-21

It appears to be due to the use of .global, which may be confusing part of the assembler into thinking the symbol may be redefined at link time and thus generating code that is intended to be a relocatable jump. Off-hand, it doesn't appear to do this correctly. This is probably a bug, but mspgcc is no longer supported so it won't be fixed.

Work around it by either eliminating the global annotation for I2cStop, or adding a non-local label and jumping to it instead.

#include "io.h"

        .global    I2cStop,I2cWrite,I2cRead
I2cRead:         BIT.W       #0x0FF00,r15
I2cWrite:        BIT.W       #0x0FF00,r15
                 TST         r13
                 JZ          1f     ; I2cStop
                 RET
1:
I2cStop:         BIC.B       #1,&P3OUT
                 RET
        .END