I have a target that I’d like to zap with the CS, and have developed a small piece of code which gives me a trigger and then compares a variable to zero:
for (;;) {
asm
{
li r5, 0x01; /* Load value in test variable */
}
SET_LED3(); /* Trigger */
for (i = 0; i < 1; i++) /* Insert a small delay to be able to adjust trigger in time */
{
while(cnt < 250)
{
cnt++;
}
cnt = 0;
}
asm /* We want to glitch the cmpi instruction */
{
cmpi r5, 0x00;
bne NOT_EQUAL;
bl success;
se_b END;
NOT_EQUAL:
bl failure;
END:
nop;
}
delay_100ms(1); /* Keep trigger on for some time */
RESET_LED3(); /* Reset trigger */
delay_100ms(1);
}
Using this code, I have very accurate trigger and have also captured traces of the compare instruction in cases of r5 being 1 and 0. The yellow trace below is the case of r5 being 0x01, and the red is r5 being equal to 0x00. Given that preparation, and using CW as a trigger, I am able to accurately aim at what I believe is the cmpi
instruction (the first excursion on the yellow trace).
The problem is that I’ve spent days with not a single successful pulse, and am running out of ideas what to try. Tried all probes and all kinds of voltages, can see the target being reset sometimes, and sometimes a NMI handler is called, but the compare instruction is never affected.
Thanks