Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: Some custom 3.2 boards not accepting code

  1. #1
    Junior Member
    Join Date
    Jul 2017
    Location
    NJ
    Posts
    6

    Some custom 3.2 boards not accepting code

    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
    Click image for larger version. 

Name:	DSC_0091.jpg 
Views:	71 
Size:	156.1 KB 
ID:	14448

    Most of the important PCB bits, yeah I still use Fritzing...
    Click image for larger version. 

Name:	Screen Shot 2018-08-15 at 4.59.09 AM.jpg 
Views:	65 
Size:	160.1 KB 
ID:	14449

    Logic Cap of unruly board when reset button is pushed
    Click image for larger version. 

Name:	Screen Shot 2018-08-15 at 4.39.46 AM.jpg 
Views:	48 
Size:	36.9 KB 
ID:	14450

    Logic Cap of breadboard when reset button is pushed
    Click image for larger version. 

Name:	Screen Shot 2018-08-15 at 1.33.26 AM.jpg 
Views:	44 
Size:	49.9 KB 
ID:	14451

  2. #2
    Junior Member
    Join Date
    Jul 2017
    Location
    NJ
    Posts
    6
    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
    Click image for larger version. 

Name:	Reset Waveform.jpg 
Views:	39 
Size:	85.3 KB 
ID:	14468

    Bootloader 6 idles high no matter what
    Click image for larger version. 

Name:	Boot 6 Waveform.jpg 
Views:	44 
Size:	86.8 KB 
ID:	14469

    Bootloader 7 seems to do data things when button is pressed
    Click image for larger version. 

Name:	Boot 7 waveform.jpg 
Views:	37 
Size:	86.9 KB 
ID:	14470

    Bootloader 8, not entirely sure if this is expected clock stuff
    Click image for larger version. 

Name:	Boot 8 Waveform.jpg 
Views:	38 
Size:	91.7 KB 
ID:	14471

    Bootloader 9, not sure if this is from button bouncing or what
    Click image for larger version. 

Name:	Boot 9 Waveform.jpg 
Views:	42 
Size:	114.6 KB 
ID:	14472

    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.

  3. #3
    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/bui...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

  4. #4
    Junior Member
    Join Date
    Jul 2017
    Location
    NJ
    Posts
    6
    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!

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    Glad you found the problem. I wouldn't have guessed that from only the info on this thread.

  6. #6
    Junior Member
    Join Date
    Jul 2017
    Location
    NJ
    Posts
    6
    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.

    Click image for larger version. 

Name:	Screen Shot 2018-08-18 at 1.44.43 AM.jpg 
Views:	45 
Size:	90.3 KB 
ID:	14492

    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!

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    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.

  8. #8
    Quote Originally Posted by PaulStoffregen View Post
    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?

  9. #9
    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

  10. #10
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,442
    Quote Originally Posted by Armadafg View Post
    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.

  11. #11
    Quote Originally Posted by Theremingenieur View Post
    Check with an oscilloscope if the pin is not pulled low. If it remains high, the problem is elsewhere.
    I can not, he is not connected, I can not reach him ):

  12. #12
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,659
    In this case the pin is not the problem - if you have no shorts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •