Unable to RE-enter program mode; MKL02/MKL26Z64VFT4 diy board

mikemontauk

Active member
Hello, I built a board with a MKL02 chip with pre-programmed Teensy and MKL26Z64VFT4 (Teensy LC). Last night I ran a blink program successfully. I connected program (MKL02 PTB2 [QFN Pin 10]) to ground according to the troubleshooting forum and all was good. Next, I uploaded a MIDI USB test program (without needing to pull program to ground) and was successfully able to read MIDI over USB and blink an LED for each note-on message received. Then, I uploaded a MIDI serial test program (attached) and it worked correctly. (At this point I was ecstatic)

However, I have lost the ability to upload new code. Pulling program to ground does not appear to do anything. The MIDI serial program is running when the teensy is powered on and the serial monitor displays the MIDI serial notes in real-time so the teensy is connected to Arduino and the USB connection appears to be working.

I purchased another bootloader chip just to rule that out, but I suspect it was not damaged. Is there anything I can check with my scope regarding the upload sequence? Also, I am providing 5V separately from the USB (which btw is a USB-C), so power and USB data to the chip are not connected and disconnected simultaneously; could that create an issue?

The only variable that changed was the actual code running. Could the MIDI serial test program (attached) be preventing programming?

Disclaimer - serial midi input test code attached is not mine its from https://www.pjrc.com/teensy/td_libs_MIDI.html
 

Attachments

  • midiserbasictest.ino
    1.4 KB · Views: 24
The running program should not be able to prevent the bootloader from resetting the main chip and then taking control.

As a quick first check, watch the voltage on the Program and Reset signals. Program should be 3.3V while not pressing the button, due to the internal pullup in the MKL02 chip. Measuring 3.3V (assuming you didn't add a real pullup resistor) is a sure sign the MKL02 initialized itself.

Pressing the button shorts Program to GND, so it should definitely go low while holding the button. The MKL02 chip is supposed to notice Program is low and drive Reset low while Program is low. Observing Reset normally high and going low while you hold Program low is a sure sign the MKL02 is running properly.

If you get that far, then it's time to double check the connections between the chips.

Really difficult to know how to diagnose a DIY board we can't see, but hopefully this gives you at least a starting point.
 
Hi Paul, Thanks for your help. Yellow trace is program (MKL02 PTB2 [QFN Pin 10]). The MKL02 chip does not appear to be pulling it up to 3.3V. The trace does flatten at zero when the program button is pressed.
Magenta is Reset ((MKL02 QFN Pins 4 & 13 connected to MKL26 pin 26). It is holding 3.3V.

Should the bootloader show 3.3V on the program pin as soon as it is powered w/Vdd, Vss?

SDS00034.png
 
Something is wrong with the bootloader chip. It should always pull Program up to 3.3V (except of course for a very brief time at powerup while it initializes).
 
Back
Top