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

Thread: Teensy as a programmer

  1. #1
    Senior Member
    Join Date
    Dec 2013
    Posts
    131

    Teensy as a programmer

    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

  2. #2
    Senior Member
    Join Date
    Jan 2013
    Location
    San Francisco Bay Area
    Posts
    641

  3. #3
    Senior Member
    Join Date
    Dec 2013
    Posts
    131
    Quote Originally Posted by linuxgeek View Post
    Yeah these are the chips I'm referring to. It would benefit me to make a programmer using one of these and use it to upload code to a k20 in circuit. I'm just not 100% sure its possible.. I.e do you need to the mini54 once the k20 has code on it?

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

  5. #5
    Senior Member
    Join Date
    Dec 2013
    Posts
    131
    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?

  6. #6
    Senior Member Epyon's Avatar
    Join Date
    Apr 2013
    Location
    Belgium
    Posts
    443
    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

  7. #7

    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.openocd.txt

    Thank you in advance!

    Regards,
    Wynand.
    Last edited by wynandmurray; 07-12-2014 at 05:33 PM.

  8. #8
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Perhaps people in the OCD community can help with this bare metal non-Teensy specific goal?

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

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

  11. #11
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    921
    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!

Posting Permissions

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