Mini54TAN Bootload miss behaving?

Status
Not open for further replies.

johnnyfp

Well-known member
Hi,

I've just got the Bootloader working on my project, however the main chip is not connecting to USB.

I can see that the MK20 chip's oscillator is being brought up by the mini, and can see that TCK(PTA0),TDI(PTA1) and TDO(PTA2) have data on it, but the TMS(PTA3) has a weird ramping to it before being normal, which happens every few 10's of pulses.

I see no activity on PTB2 or 3 (Not sure what these two lines are for).

So is this ramping expected on TMS? Also as there seems to be comms on TDI and TDO I can assume that the MK20 chip is communicating, But it seems to do it all the time, Is that normal? Will the Mini constantly read and write too the MK20, hence why there is all this activity? Or should it just write once to upload the transient bootloader into RAM of the MK20?

Cheers
 

Attachments

  • DS1Z_QucikPrint2.png
    DS1Z_QucikPrint2.png
    33.9 KB · Views: 144
Constant (but slow) activity is normal, when you're not pressing the Program button. That's how it monitors for the auto-reboot request.
 
ok I've got it working 'Yeah!'

So note to everyone else that is embarking on creating your own Teensy derivative.

RTFM
I.E.
If you create your own board that has it's own PSU do not assume that you do not need to use the onboard LDO of the MK20. You do. If you don't connect this up to 3v3 at least then you will not have any USB, as the USB module derives it's power from the internal LDO and not the supplied VDD.

I also suspect that the VOUT will need a cap.

Sigh! Teaches me to not reading the pages and pages of Datasheets.
 
Last edited:
There's only 1200 or so pages in the datasheet...

FWIW, I ran into the same issue. My home-made boards do not use the LDO and instead supply 3.3V to the Vout pin. Has worked in the past...

... but a current-edition board is radio-silent.. no idea why yet as all the electrical basics are OK (3.3V where it's expected, and so on). I hope the design of the MK20 in the Teensy 3.1 hasn't changed / evolved to require the use of the LDO or it's time for another PCB revision!
 
Last edited:
Use of the LDO isn't required. I have no idea why your hardware isn't working, but that isn't likely to be the cause.

I am currently working on a bootloader update. The 2 changes for this update are making pin 33 usable and allowing the lock bit to be set.

Currently, the bootloader always leaves pin 33 configured to default to its non-maskable interrupt function. If pin 33 is driven low while in this default state, things don't work (until you disconnect pin 33). I'm still debating whether to have the bootloader permanently disable NMI without allowing any (reasonable) way to enable NMI, or if the bootloader should support NMI enabled or disabled, of course with the default to disabled.

NMI is a very tough feature to actually use. Teensyduino is probably never going to support it, other than defining the name nmi_isr in the vector table. Creating a NMI handler is tough work. Because NMI is the highest priority feature in the processor, even higher than fault handling, if NMI is low as the chip resets, the very first instruction the chip executes right out of reset is the beginning of your nmi_isr() function. Of course, the internal watchdog timer is active, the chip is clocking in FEI mode, and none of the hardware or C / C++ runtime setup has occurred. If you try to actually use NMI, you're truly on your own with all "bare metal" hardware issues.

The other feature people have requested is the ability to set the memory lock, to prevent reading out their firmware, perhaps if the MK20 were desoldered and connected to some sort of programmer capable of reading the chip. Currently, the bootloader never allows any of the bits at 0000040C to be changed. I'm going to relax this restriction somewhat. Some of the bits will always be programmed to zeros and you can't (with reasonable effort or any USB-based uploading) change them back into ones. That will still allow the bootloader to prevent illegal settings, like disabling chip erase, but it will allow changing 0000040C from FE to FC to lock the chip.

The caveat to locking the chip is the Mini54 becomes locked out. Normally when you press the pushbutton, the chip goes into bootloader mode, but no data actually changes until you begin uploading (which doesn't necessarily happen if the Teensy Loader isn't running or isn't in Auto mode). When the chip is locked, the Mini54 is forced to fully erase the entire chip to gain access. Everything gets wiped, even the EEPROM, when you press the pushbutton. If you press the button and Teensy Loader isn't running, the chip is wiped clean and your program is lost, causing the board to do nothing until you upload a new program.
 
Use of the LDO isn't required. I have no idea why your hardware isn't working, but that isn't likely to be the cause.

Good to know and thanks for checking in on this thread! I'd argue that making D33 behave as much like any other pin on the MK20 is the best option, i.e. to disable NMI if pin 26 is pulled low. Too many folk like me who know just enough to be dangerous will be pulling their hair out, just because a low D33 causes the MK20 to stall, sputter, and stop during booting.

As for my dead power measurement device, I'm hoping I specified the wrong TVS diode array (PESD series) and hence managed to suppress all USB communications. I'll remove the array to see if that suddenly makes the MK20 come to life. If that's not it, I wonder if I fried my MK20 in the reflow oven...

I also presume that there should be some sort of heartbeat on the PTA0-3 pins even if MK20 / Mini 54 are fresh out of the box (or reflow oven, as it were)?
 
I also presume that there should be some sort of heartbeat on the PTA0-3 pins even if MK20 / Mini 54 are fresh out of the box (or reflow oven, as it were)?

The best sanity check is to look at Program and Reset. Both are supposed to default to weak pullups to 3.3V. When you pull Program low by pressing the button, the Mini54 responds by pulling Reset low, until you release the button. This is simple and easy to check with just a DC voltmeter.
 
Status
Not open for further replies.
Back
Top