SLAZ162J October 2012 – May 2021 MSP430F2131
CPU Module
Compiler-Fixed
Incorrect execution of ADD instruction
When the CPU executes an ADD (.B or .W) instruction using indirect addressing mode with destination R1 or R4 to R15, directly after a RET or RETI instruction, the addition will be executed twice. This bug does not apply in the case that the indirect source working register is R2 or R3 (constant generator access for #2 or #4 are valid).
The instruction word mask that corresponds to the CPU6 condition is as follows:
1. (Preferred) Use indexed addressing with offset 0 instead of indirect addressing:
ADD(.B/.W) 0(R10),R11
Note that some assemblers may convert this instruction to indirect addressing.
Alternatively, when the source is in assembly, making the following changes works around the bug. Perform the following only if Workaround 1 cannot be implemented.
or
2. Place an instruction (for example NOP) between any instances of CALL and ADD(.B/.W) instructions where the ADD immediately follows the CALL.
or
3. Replace all RETI instructions with 'DW 01301h'. The instruction word for RETI is 01300h. By replacing this directly in assembly with 01301h, the bug is avoided and the RETI instruction is executed properly; for example:
WDT_ISR ; Exit LPM3 on reti
bic.w #LPM3,0(SP) ;
;reti ; Replace RETI with
DW 01301h ; this line of code
Refer to the table below for compiler-specific fix implementation information.
IDE/Compiler | Version Number | Notes |
---|---|---|
IAR Embedded Workbench | IAR EW430 v4.x or later | User is required to add the compiler flag option below. --hw_workaround=CPU6 Add -h option for Assembler |
TI MSP430 Compiler Tools (Code Composer Studio) | Fix not available | |
MSP430 GNU Compiler (MSP430-GCC) | Fix not available |