Some custom 3.2 boards not accepting code

Status
Not open for further replies.
Building some custom Teensy 3.2 compatible boards based off the schematic with MKL04 bootloader from PJRC. It's for an open source automotive scan tool project, Renix Engine Monitor. I'd still consider myself a novice just bumbling through EE one circuit at a time.

Made a few batches with the teensy 3.2 boards and they went well, new custom embedded boards are not going so well.

I've made 7 boards, and only 4 of them could be programmed. When they do work, they work great with repeated success through power cycles and on vehicle. And when they don't, they don't. Port won't show up on mac and pushing the reset button does not trigger the teensy loader.

I'm assembling these boards by hand, some with hot air, some with a diy reflow toaster. I've tried to ensure proper solder joints with plenty of flux, but it's hard to know for sure with the QFN package. I've done a bit of digging and checked things like stabile 3.3v voltage, good crystal routing, and matched usb traces, so I figure it's time to ask the pros.

The basics seem in check, and replacing components like bootloader, K20, Crystal, and regulators don't seem to fix the issue on bad boards. I was able to fix one board by catching an analog inductor ground that wasn't soldered, but the last 2 I thought I put together really clean.

Dug out the oscope and logic analyzer. No movement from the crystal, but I think that's expected when the chip is blank. Comparing to a log I took from breadboard, Logic is showing BL 9 going low when the button is pressed, and 7 and 8 are doing their thing but the Reset line is staying high and both usb lines are low. I had one occasion where the Reset line did go low a bit after BL 9, but still nothing from usb. I didn't check BL 6 on the bad board, seems it just sits high on the breadboard test and I was not smart enough to add proper test points.

So this seems to point to an issue with USB or maybe whatever triggers the K20 to ask for code? Actually, now that I think about it, the Reset line isn't pulsing so would that point to one of the IC's then? Bit drained after my current debugging attempts so input is welcome, thanks for the read!

One of the unruly PCBs
DSC_0091.jpg

Most of the important PCB bits, yeah I still use Fritzing...
Screen Shot 2018-08-15 at 4.59.09 AM.jpg

Logic Cap of unruly board when reset button is pushed
Screen Shot 2018-08-15 at 4.39.46 AM.jpg

Logic Cap of breadboard when reset button is pushed
Screen Shot 2018-08-15 at 1.33.26 AM.jpg
 
Tried some more poking around tonight. Tried reflowing the bootloader, hand reflowing all the K20 pins, even checking some other components and everything is as perfect as I can get, so I don't *think* it's a solder issue.

Could it be some other components maybe not playing nice with the programming?
Are there any pins I should be looking into that maybe shouldn't have circuits on them during programming?
Is the connection from USB ID pin 4 to Bootloader PTA6 important at all? (This is not connected on my board)

3.3V line is rock solid. 2 layer board, ground filled on the bottom and no digital traces near or under the crystals.

Button has a good ground. I notice the Reset Line stays high and does not pulse, but it will go low if I push the button. Any idea what that's about?

I've included some screenshots of each of the data lines. The lack of reset pulse and no activity on the USB lines really has me scratching my head. I may have to dive into the chip manuals and see what I can dig up, but this is driving me nuts.

Reset Line during button push
Reset Waveform.jpg

Bootloader 6 idles high no matter what
Boot 6 Waveform.jpg

Bootloader 7 seems to do data things when button is pressed
Boot 7 waveform.jpg

Bootloader 8, not entirely sure if this is expected clock stuff
Boot 8 Waveform.jpg

Bootloader 9, not sure if this is from button bouncing or what
Boot 9 Waveform.jpg

Both USB lines idle low and show no change

Only thing I can think of next is making a bare-minimum board and see if any of my other circuits are interfering with programming for some reason.

Really hoping to find a solution, otherwise this is going to be a major bummer.
 
Hi!

I have some experience building custom Teensy based PCBs. I've done about 6 different board designs now. It can be a real bummer when they don't spring to life.

By the sounds of it "4 boards working" means that your design works! Congrats, that's probably the hardest part.

There's a good post here by someone else that made their own custom teensy and had a number of troubles. Check with this to see if you've repeated any of his mistakes;

http://www.appfruits.com/2015/03/building-your-own-custom-teensy/

As for your non-working boards it's really tricky. Your design appears to be confirmed, your method of assembly also appears to be confirmed due to the 4 working boards.

Parts damaged, shorts, poor soldering, wrong part placement and maybe even esd are you most likely suspects for what's going wrong. I would suggest going back to basics. Perhaps taking a clean PCB and only population the Teensy parts (MK20, ML04 and supporting passives) and seeing if that works before adding your additional parts.

Good Luck!

JW
 
BY GOD, I'VE DONE IT! SO, I just remembered on that first batch of 4 that I made, I placed the Relay Driver IC backwards (16 SOIC) and didn't realize it till later when I was testing everything.

Well guess what, I made sure to put them on the right way this time and now it doesn't work. Just pulled the chip and instantly it took code through the button. So for some reason that relay driver is causing me issues. It's a bit more complicated than what I was expecting being that it's a 7 channel darlington array with base current resistors and fly back diodes built in, but doesn't seem to show an actual ground like I'm use to with a standard npn array.

My schematic is a bit convoluted, but Pins 26, 44, 45, & 62 are tied to either the base inputs or the collectors (except 26) depending on the dip switch, some through resistor dividers, some straight. I think I recall another post where someone was having issues using pin 26 for a circuit giving them upload errors so this is certainly worth further investigation!

I'm just SO glad I don't have to scrap near half a years worth of work due to one little component not playing nice. I'll update when I find out more on what the exact issue is, thanks for the input!
 
Alright, time to test on the 2nd board. So for this one I only lifted the one base pin of the relay driver that goes to pin 26 (PTA4) on the K20 which is Teensy pin D33. Everything else is the same.

With a raw K20 Chip I see 3.3v present on pin 26. If I short that line to ground, the reset button does not successfully talk to the teensyloader. Remove the short and the board programs perfectly.

I decided to check the Reset line on a blank chip and when the short is removed, the expected reboot pulsing will start! Add the short back and Reset just sits high.

Screen Shot 2018-08-18 at 1.44.43 AM.jpg

Now interestingly enough once I upload the blink sketch, pin 26 still remains high. Changing the sketch led pin to D33 does show a proper change on pin 26 as expected though.

Fun fact number 2, after the K20 has been successfully programmed once, shorting the line has no effect on uploading, whether it be from a software command or from hitting the reset button!

So there you have it folks, pin 26 PTA4 must be in a high state for the K20 to successfully initially program! The more you know. Hopefully we can get a whole list of Teensy "gotcha's" together for people who would like to make boards, because man does it hurt finding out the hard way haha.

Thanks for everyone's help and all your hard work Paul, wouldn't even be here if it wasn't for you!
 
Ah yes, our old friend the NMI pin. A terrible pain in the early days of Teensy! Years ago the bootloader was updated to always disable this right after erasing the chip.

But yes, if you start with a completely blank MK20 chip, the NMI pin (which has a pullup resistor enabled by default) must be high during the initial programming.

I've added a link to this thread from the MKL02 page's Troubleshooting section. Hopefully that will help everyone else avoid this issue.
 
Ah yes, our old friend the NMI pin. A terrible pain in the early days of Teensy! Years ago the bootloader was updated to always disable this right after erasing the chip.

But yes, if you start with a completely blank MK20 chip, the NMI pin (which has a pullup resistor enabled by default) must be high during the initial programming.

I've added a link to this thread from the MKL02 page's Troubleshooting section. Hopefully that will help everyone else avoid this issue.

Is this also true of the MKL26Z64VFT4?
 
Hi,
I also have a problem with my custom teensy 3.6 card and wonder if the L7 pin (NMI) will not be the problem.
On my PCB the L7 pin is not connected to anything
 
Hi,
I also have a problem with my custom teensy 3.6 card and wonder if the L7 pin (NMI) will not be the problem.
On my PCB the L7 pin is not connected to anything
Check with an oscilloscope if the pin is not pulled low. If it remains high, the problem is elsewhere.
 
Status
Not open for further replies.
Back
Top