Issue programming a virgin MK20DX256VLH on custom T3.2

Status
Not open for further replies.

yeahtuna

Well-known member
My custom T3.2 device is unable to boot / get programmed using a virgin MK20DX256VLH. If I swap out the MK20 for a preprogramed one, then there are no issues. The device boots perfectly fine, and the program button works as expected.

Here are some observations I've made when a virgin MK20DX256VLH is installed:
1. The PROGRAM line show 3.2V and drops 11mV while the program button is pressed.
2. The RESET line is showing 3.2V and drops to about 1.5 mV while the program button is pressed.
1. The crystal isn't oscillating.
2. The current consumption is only 10 mA (probably from the active components on the board)
3. While the program button is pressed, the current goes up to 13 mA.
4. When the program button is released, the current briefly goes up to about 16 mA and then falls back down to 10 mA

Any suggestions as to what the cause of this problem might be?
 
Last edited:
Well, that's quite a mystery. Every Teensy 3.2 is built with a virgin MK20 chip and works fine.

Is there any chance this might have been just a soldering issue with 1 chip? Do you have more than 1 board doing this with virgin chips?
 
Well, that's quite a mystery. Every Teensy 3.2 is built with a virgin MK20 chip and works fine.

Is there any chance this might have been just a soldering issue with 1 chip? Do you have more than 1 board doing this with virgin chips?

I'm very certain it's not a soldering issue. I have multiple boards and several virgin chips.

I took the bootloader out of the board, and I'm still getting 3.2 volts on the RESET line. The MCU is not happy and I can't figure out why.
 
Last edited:
I took the bootloader out of the board, and I'm still getting 3.2 volts on the RESET line. The MCU is not happy and I can't figure out why.

That's even more mysterious! A virgin MK20 chip is supposed to be pulsing its reset line low, as it will be repeatedly watchdog rebooting. Normally a DC voltmeter will read about 0.2 to 0.3 volts, because it goes high for only a short time before the watchdog reboots the chip again.
 
I guess I'll make another prototype with the just the essentials to get that watchdog firing. Thanks Paul.
 
Is there any chance these chips might have been pre-programmed with someone else's firmware?

Even if they're not blank, even if security is locked, the bootloader should still manage to erase and use the chip. The only thing the bootloader can't do (nobody can) is deal with a chip that has the mass erase disabled and security is locked. If the chips were previously programmed with that setting, they're forever locked with whatever was written.
 
I just put together a minimal build of the prototype and the MK20 is acting as expected. I'll slowly build it up and keep testing.
 
Hopefully someone can explain this one. It looks like if pin 26 on a virgin MK20DX256VLH is connected to ground (in my case through a 10K resistor), the RESET line gets held at 3.2V and it can't be programmed. WTF.
 
Last edited:
And I have a workaround, albeit not pretty. If I also connect pin 26 to VCC through a 3K resistor, it can be programmed again. Will have to design a jig of sorts... WTF.
 
Ah, the NMI pin strikes again.

This is actually mentioned in the Troubleshooting section on the MKL02 page.

Pin 33 PTA4 (pin 26 of the MK20 chip) must be floating or high during the first programming of the MK20 chip. This pin defaults to NMI (Non-Maskable Interrupt) when the MK20 chip is completely blank. NMI interferes with almost everything! The bootloader will disable this feature, but for the first programming of a blank MK20 chip it is enabled. PTA4 must not be pulled low until after at least 1 successful code upload.
 
Virgin programming adapter. Sits on top of the MK20.
20210306_121128.jpg
 
Status
Not open for further replies.
Back
Top