obra’s avatarobra’s Twitter Archive—№ 43,585

    1. I've been doing board bringup on the Model 100's PCB. One of the things that has been biting me is that one of the 32 RGB LEDs just won't turn on its red phosphor.
  1. …in reply to @obra
    My first thought is a layout or soldering issue. After much debugging, everything looks fine on that front. I have continuity from the source to the LED's red pin.
    1. …in reply to @obra
      Next up, I realize it was the "last" LED logically. And the LED driver uses BGR ordering. So maybe it is an off-by-one error in my driver code. I hack up the code to grow the buffer and light up a 33rd LED. Still no red.
      1. …in reply to @obra
        Hm. Maybe it's the code that filled the buffer with LED color data. So I invert the reader code to suck the pixels out of the buffer as RGB instead of BGR. No love.
        1. …in reply to @obra
          I pull out a second copy of the circuit board and flash the not-hacked-up firmware onto it. Still broken. No red phosphor on that same LED.
          1. …in reply to @obra
            Maybe it really *is* a hardware failure.
            1. …in reply to @obra
              I flash the hacked up firmware that tries to light up a 33rd LED. Every LED's red phosphor is now lit.
              1. …in reply to @obra
                !@!#$@$@!%
                1. …in reply to @obra
                  I reread my code.
                  1. …in reply to @obra
                    It's a bug in my state machine. It is an off by one error in the initialization of my state machine. I am skipping green on the *first* LED. Since I'm initializing the LEDs to white (0xff,0xff,0xff), the problem manifests as "no red" on the last LED.
                    1. …in reply to @obra
                      I fix the bug and clean up all my hacky debugging code. I verify that everything looks great on the new board. I commit. I plug in the original board and flash the corrected firmware, happy that I've solved this mystery.
                      1. …in reply to @obra
                        It does not work.
                        1. …in reply to @obra
                          It turns out that the red phosphor on that LED on the original board is burned out. Probably by me. Probably during one of my first debugging steps.
                          1. …in reply to @obra
                            🤦‍♂️
                            1. …in reply to @obra
                              I have no idea what the moral of this story is.