Reputation: 709
the code is using IAR High Level optimization with STM8L151G3, and I observed some problems on the production unit.
In each loop, the code will execute the code below:
__IO uint8_t ColorSwapFlag = 0;
// some other codes.....
if(ColorSwapFlag == 0){
ColorSwapFlag = 1;
}else{
ColorSwapFlag = 0;
}
the device will display different color depending the value of
ColorSwapFlag
One of the conditions to execute the code is by the detecting the falling and rising edge of a external interrupt.
I used two units to connect with each of them together in a way that they share the same external interrupt trigger together (to achieve some kind of synchronization of the color swap).
upon powered up both the 2 units syncs just fine, but after only less than a minute one of the unit cannot swap at all, but observing the behavior it seems like the code above failed to work (ColorSwapFlag is stucked at 1 or 0 and never changed). Meanwhile the device is continute to work but only unable to swap colors.
The interesting thing is, after several repeat experiments out of two units, only one particular unit is having this trouble, the other one is not having this problem whatsoever. I probed the signal on the external interrupt trigger and nothing was out of the ordinary.
If the problematic unit runs on it's own (Yes, the unit also have sources to trigger the external interrupt by itself), it will not have this issue.
Right now it is hard to determine whether this is a hardware problem or software optimization problem, or just something went wrong in the production run?
Upvotes: 0
Views: 119