Teensy as a programmer

Status
Not open for further replies.

mattomatto

Well-known member
Hi,

I'm currently designing a product and my first small run will be evaluation units with a full teensy board inside. Moving on from that once the source code is finalised, I would like to program the K20 chips without a mini54 on each board.

Is it possible to 'hack' the teensy to turn it into a programmer for K20 processors on other boards?

The main reason for doing this is to keep costs down. As I live in the UK, importing all those chips will account for a large portion of the product price.

Thanks
 
The K20 will run without the Mini54.

However, if you send a request to auto-reboot, by clicking the Upload button in Arduino or by running the teensy_reboot command in hardware/tools, the K20 will stall.
 
Thanks Paul. I presume power off and back on will fix a stall? Can you foresee any problems making a programmer this way, other than pcb layout?
 
I'd like to bump this thread a bit.

I'm working on a custom board compatible with Teensy 3.1, but with integrated Ethernet chip, PHY and RJ45 connector. To save board space and simplify routing, I would like to move the Mini54 to an external 'programmer' board, a bit like the Sparkfun FTDI board.

According to Pauls answer, this would work? The Mini54 is only used when one wants to program the MK20, but once programmed the MK20 will continue to run even after reboots?

Thx
 
Programming my K20 custom board

Hi Paul,

I have created my first few prototypes using the k20dx128vlf5 chip, without the Mini54.
Thus, I am using OpenOCD in an attempt to reset and flash my device.

When issuing "targets" in OpenOCD:
I get returned a "k20.cpu" device with a status of "unknown".

When issueing a "reset halt" or "reset init" in OpenOCD:
Info : STLINK v2 JTAG v14 API v2 SWIM v3 VID 0x0483 PID 0x3748
Info : Target voltage: 3.215748
Info : k20.cpu: hardware has 68 breakpoints, 4 watchpoints
Error: jtag status contains invalid mode value - communication failure
TARGET: k20.cpu - Not halted

I would appreciate any help in this regard, even if you could only point me in the right direction.
I am attaching the openocd commands I am executing.View attachment openocd.txt

Thank you in advance!

Regards,
Wynand.
 
Last edited:
Hi stevech,

Thanks you for your response.
I had quite a few chats in the OpenOCD IRC channels, and was able to get some really useful tips from the guys.
It turns out that my MK20's "EZP_CS" pin is set to "float", not HIGH, which is why I kept receiving different OpenOCD responses upon issueing the "reset init" or "reset halt" commands!
I have since submitted a new PCB layout to the factory and should be receiving them in 2 days. Will revert my findings here!

Thanks again for responding.

Regards,
Wynand.
 
Problem solved!

With my "EZP_CS" pin now pulled to high, the board is accepting my resets and programming as well as can be expected!
The best part is that it is working with the very affordable ST/link V2 JTAG Adapter via OpenOCD.

I hope this helps somebody out there, I know that I have been struggling with this for a good few months.

Cheers,
Wynand.
 
Wynand, would you mind describing your setup in a little more detail? I am interested in what I think you have done. It sounds like you have created a board with the MK20 chip and used a separate programmer to flash the program. Does the separate programmer board use the Mini54 chip? How are you using the ST/link V2 JTAG adapter (I have one of these attached to a Nucleo board)? While I am currently satisfied to use a Teensy 3.1 as a vehicle for custom made peripheral shields, I can envision designing a custom platform that integrates the microcontroller with the peripherals (I mean sensors, radios, bluetooth, and whatnot). In this case, I would rather have the programmer off board also. So please, explain in detail what you have done!
 
Status
Not open for further replies.
Back
Top