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

Thread: Custom Teensy LC Bootloader not programming MCU

  1. #1

    Custom Teensy LC Bootloader not programming MCU

    I have the preprogrammed PJRC MKL02Z32 bootloader connected to the blank MKL26Z64VFT4 by way of a USB-C connection and I am having some trouble getting things working. The USB-C connection was meant to allow the bootloader and MCU to exist on two separate boards so that the MCU board could be made smaller, and the bootloader would only be attached when programming was required. I have another design that has the bootloader on the same board as the MCU and that works just fine. When I move things to the new two-board configuration I get strange behaviors from the bootloader.

    I'm seeing the expected pulse train at 30 kHz on the RESET pin of the MCU and the 3.3V line, along with everything else, looks good on the MCU board. When I press the PROGRAM button on the bootloader board the RESET pin on the MCU is indeed pulled LOW, so that is working. This is when the curious behavior starts however. The SWD-IO pin shows a constant 2V signal and SWD-CLK line is constant LOW. I believe I have verified that the pins are indeed making good contact with no shorts, bridges, or opens. When I set a trigger for the single shot, I can see something trying to happen at the very start, but that seems to fail and it goes to the steady 2V/GND state.

    I have seen other behaviors from the bootloader where the IO line will continuously send a pulse packet and the clock line will do the same. The IO and CLK signals appeared to be aligned correctly, but MCU seems to be resetting out of sync. It's like the bootloader is trying to program the MCU but the MCU is not listening.

    Any suggestions on how to trouble shoot this issue or what could be wrong with the circuit would be greatly appreciated. I'm at my wits end on this one...

    RESET Pin:
    Click image for larger version. 

Name:	RESETPin.png 
Views:	3 
Size:	15.0 KB 
ID:	15082

    Constant CLK and IO pins:
    Click image for larger version. 

Name:	BadBootloader.png 
Views:	4 
Size:	23.3 KB 
ID:	15080

    Single-shot start of programming:
    Click image for larger version. 

Name:	SingleShotCaptureBAD.png 
Views:	6 
Size:	27.7 KB 
ID:	15087

    USB configuration:
    Click image for larger version. 

Name:	USBConfig.png 
Views:	6 
Size:	72.8 KB 
ID:	15081

    MCU pins:
    Click image for larger version. 

Name:	MCUPins.png 
Views:	4 
Size:	53.7 KB 
ID:	15083

    Bootloader pins:
    Click image for larger version. 

Name:	BootloaderPins.png 
Views:	5 
Size:	44.5 KB 
ID:	15084

    Bootloader trying to program the MCU:
    Click image for larger version. 

Name:	BootloaderRunningButNotProgramming0.png 
Views:	5 
Size:	23.2 KB 
ID:	15085

    CLK and RESET out of sync:
    Click image for larger version. 

Name:	RESETNotSyncedWithCLOCK.png 
Views:	4 
Size:	23.1 KB 
ID:	15086

  2. #2
    I want to be clear, that the bootloader is a PJRC bootloader. I feel like the word 'custom' in the title might have made it sound like I made my own bootloader. I made a custom Teensy LC board with the goal of making the MCU board as small as possible by moving the bootloader to another board. From my tests it looks like the signals are getting through but the MCU is not being programmed. I'm running out of ideas for things to try and test. If anyone has any suggestions about what I could to to get more data or info on what's going wrong I'm super interested to try something new. The USB-C connection was chosen because it has a ton of free pins that I could reporpose to allow the bootloader to connect to the MCU from the other board. If anyone has any questions, please let me know, I would love some help solving this issue. I'm just outside my comfort zone and as far as I know the bootloader is a magic chip and I can only speculate as to what it needs to do it's job. I'd love to hear from someone who knows more about how I can debug the behavior and what tests I can do to pin down the error. Thanks everyone!

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,511
    2V on a digital signal sure sounds like something else (driving high) is mistakenly shorted to the signal.

  4. #4
    Hi Paul, thank you so much for your reply. I have done some more probing around and I have found that there is a curious 1.8 V steady DC signal on any of the pins that I have left unconnected on the USB-C connector. This is odd since there are no 1.8 V sources on the board, but it could be created by the 3.3 V supply regulator on the bootloader board. It would mean that there is some voltage drop of a little less than half somewhere caused by a short or something I guess. I'll certainly post a reply when I have more information. If anyone has worked with USB-C and has any tips as to what could be causing this, that would be great!

Posting Permissions

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