Part Number: MSP430F5438A
Hello TI Forum,
I am attempting to cause unpredictable code execution via the USCI39 issue, and so far I have been unable to. The motivation for this is to prove that it affects our microcontrollers so I can justify updating the existing firmware that seems to be running okay. I read the following forum posts to better understand the issue:
According to the errata, "this erratum is triggered if ALL of the following events occur in following order:
1. Pending Interrupt: One of the UCxIFG=1 AND UCxIE=1 while GIE=0
2. The GIE is set by software (e.g. EINT)
3. The pending interrupt is cleared by hardware (external I2C event) in a time window of 1 MCLK clock cycle after the "EINT" instruction is executed."
So, I have been attempting to create those events and therefore cause unpredictable code execution. I have a test setup where two microcontrollers are talking to each other over I2C and a couple GPIO lines. An MSP430F5438A-EP is configured as an I2C target, and a Tiva-TM4C is configured as an I2C controller. These are the steps I am following:
1. MSP430 disables GIE, then drives a GPIO line low.
2. The GPIO line going low triggers the TIVA to send an I2C start command addressed to the MSP430
3. MSP430 drives the GPIO line high, executes 8 NOPs, then enables global interrupts
4. The GPIO line going high triggers the TIVA to send an I2C stop command.
What I am trying to accomplish is to create a pending UCSTTIFG in the MSP430 while GIE = 0, then setting GIE=1, and in the following MCLK cycle clearing the UCSTTIFG by causing a UCSTPIFG.
I have been using an oscilloscope to verify the signal timing, and by using this and adding a precise number of NOPs, I feel like I've gotten pretty close to where I need to be. I can generate the I2C stop signal precisely enough that, for one test I can see the MSP430 call the UCSTPIFG ISR; and by delaying the I2C stop command by 24 nanoseconds on the next test I can see the MSP430 call the UCSTTIFG ISR followed by the UCSTPIFG ISR.
So while I am able to precisely control this I2C stop command and make the MSP430 "oscillate" between executing 1 ISR or 2 ISRs, I can't seem to cause the unpredictable code execution. Does anyone have any ideas for what I might be doing wrong? Or do I magically have a MSP430F5438A that somehow isn't affected by this issue?