just brew it! wrote:A co-worker and I just spent a decent chunk of the weekend chasing a bug in one of Microchip's PIC32 microcontrollers. Hardware bugs are the last thing a software engineer suspects, because bugs are usually due to software!
The nature of the bug is that reading or writing a hardware device register that has side effects beyond the register access itself can get executed twice if a hardware interrupt occurs while the machine instruction that accesses the register is executing. A good example of this would be a UART with a hardware FIFO -- writing to the Tx data register stuffs a byte into the FIFO *and* increments the FIFO pointer.
There's an existing Microchip errata that says writes to device registers may be repeated if an interrupt occurs. We now have convincing evidence that reads are affected as well, so it would seem the errata itself needs an errata.
So now we get to vet all of the code for accesses to registers with side effects, and add code to disable/enable interrupts around all such accesses.
Up front, you might have cost them a month and a half. In the longer run, you saved them a bunch of time, money and headaches.notfred wrote: I caused them to respin the chip after having already taped out the supposedly final silicon. That must have cost them a bit!
NovusBogus wrote:Ah man, that sucks. We use PICs and several other flavors of microcontroller plus an SBC that *ahem* the vendor doesn't always configure properly so I definitely feel your pain.
NovusBogus wrote:Moving from .NET to embedded development for a 10+ year old hodgepodge platform has been a strange experience; in the old days any bugs found were 100% guaranteed to be obviously bad code, now it's maybe 40% dev derp and 60% some kind of weird errata or technology compatibility thing that only manifests itself when the code is logically fine but not exactly what the hardware wants to see.
Ubergerbil wrote:My first software job we had one guy who wasn't using the "official" NOP instruction for the 6502 but one of the others... which had undocumented side effects. Which we'd never heard of, and had no internet to use to find out about. That was fun.
Glorious wrote:Sssh, don't encourage Shining Arcanine to come back and start ranting about what we've lost with the advent of microcode.
Users browsing this forum: No registered users and 0 guests