Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 31

Thread: Teensy 3.1 based custom design?

  1. #1

    Teensy 3.1 based custom design?

    Hi all, I am new here. I used to design my MCU based projects by breadboarding with Arduino Mini Pro board and then making a custom PCB with the project specific IO and an atmega328p with bootloader that makes the board looks to the Arduino IDE identical to an Arduino Mini Pro.

    I like to do the same with ARM processors and the teensy 3.1 looks very promising.

    How open is the teensy 3.1's bootloader and how difficult it is (technically and legally) to make my custom board look to the IDE like a teensy 3.1? For the atmega328p I am using an Atmel avrisp mkII to burn the bootloader after assembling the board. What is the equivalent for teensy 3.1?

    My projects are open source but I don't sell them so I want to make it easy for people that want to build them.

  2. #2
    PJRC sells the Mini54 chip that contains the official boot loader for the Freescale ARM chip in the Teensy 3.x. The boot loader protocol is open and documented, so you could theoretically write your own in order not to need to buy the Mini54 chip. If I recall, there's sample code (for AVR, in C) to implement the boot loader. The Freescale chip flash doesn't work exactly like the AVRs in the Arduinos, so boot loading is a bit different, hence thE other chip.

    The Mini54 hip PJRC sells comes in a few different packages... Some are much easier to solder than others.

    I don't work for PJRC BTW.

  3. #3
    Senior Member
    Join Date
    Feb 2013
    Posts
    179
    I was under the impression that the boot loader itself is basically the only thing that's NOT open and documented - otherwise we'd have cheap knockoff teensy's flying everywhere and it'd mar the product as a whole. Which is why Paul keeps it closed, and sells a pre-programmed mini54.

  4. #4
    You're right, the source to Paul's loader isn't open. But there's an open-source host-side loader program and I believe there's an older open-source loader for the AVR that speaks the Halfkay protocol. I.e., you could use AVR ISP programming to wipe your Teensy 2.0 and replace the bootloader with the open-source one, maybe with your own modifications. Paul's closed-source AVR USB loader fits in 512 bytes (quite a feat), hence the name Halfkay. If I recall the open-source Halfkay-compatible loader took 2Kb of AVR flash. Correct me if I'm wrong, I'm admittedly going from memory and I haven't done it myself. Maybe "documented" wasn't the right wording, but the resources are out there to implement a Halfkay-compatible bootloader.

    See: http://pjrc.com/teensy/loader_cli.html
    And the open-source bootloader is based on LUFA: http://elasticsheep.com/2010/01/inst...id-bootloader/

    The AVR has built-in bootloader support. You can run code from one section of flash while another section is written. As I understand, the Freescale chip doesn't directly support this. You can write to flash from ARM code, but the code to do it has to be running from RAM. Making a robust bootloader (robust enough to rely on never to fail and brick the chip requiring JTAG reprogramming) would probably be quite a challenge and would use a fair chunk of flash, and not be so transparent to user programs like on the AVR (which even automatically remaps ISR vectors for the bootloader IIRC).

    I think Paul's solution basically uses an external chip to do an in-system external flash reprogram of the Freescale ARM chip. This means using a second chip, but it also means that the whole flash is available on the main MCU for user programs, there's no trickery during boot time, and you don't need a JTAG programmer to flash the MCU.

    Honestly, if you want to make a custom design using the Freescale ARM MCU, you don't have to use Paul's chip or loader at all. You could prototype with the Teensy and design your product with the raw MCU and program it using JTAG. But Paul's Mini54 is not very expensive and eliminates the need for a JTAG dongle. So it's worth it if you're not making thousands of copies of your design.

    Which I guess is a very long-winded way of saying you CAN theoretically do it (technically and legally), but would almost certainly be better off using Paul's Mini54.

  5. #5
    Quote Originally Posted by drg View Post
    You're right, the source to Paul's loader isn't open. But there's an open-source host-side loader program and I believe there's an older open-source loader for the Honestly, if you want to make a custom design using the Freescale ARM MCU, you don't have to use Paul's chip or loader at all. You could prototype with the Teensy and design your product with the raw MCU and program it using JTAG. But Paul's Mini54 is not very expensive and eliminates the need for a JTAG dongle. So it's worth it if you're not making thousands of copies of your design. .
    Thanks drg, very useful information. I prefer not to deal with the licensing chip as it's not a good fit for my open source projects. I will wait and see if the Arduino Zero will be better in this respect. Any other suggestion for an arm base board that has an easy to install toolchain/ide and is easy to transition to custom boards? The atmega328 and the Arduino IDE worked well in this respect and I hope to find something similar with ARM.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,637
    I will wait and see if the Arduino Zero will be better in this respect.
    As far as I know, Atmel as never before released source code for any of their tools. That special chip on the Zero might be an exception, but I wouldn't hold my breath. You might try asking the Arduino Team....

    You might also consider Arduino's typical release schedule. With Leonardo, Due & Tre (every new product in the last 3 years that hasn't been simply repackaging something else), they announced new products at Maker Faire, but started actually shipping about 8 months to 1 year later. Zero might release faster, since Atmel appears to be doing the actual engineering work. But then again, I'd be amazed if Atmel really invests any substantial effort into the Arduino software, rather than supporting it only on their own Windows-only IDE.

    Atmel's D21 chip has all new peripherals, USB, timers, SPI, I2C, serial, even GPIO. It's theoretically possible they've put a lot of excellent work into supporting these new peripherals and porting the many Arduino libraries, so everything will be highly compatible (eg, like Teensy 3.1), but I also wouldn't hold my breath. The state of Arduino Due, after 1.5 years, might be a better indication.

    Then again, there's a video from one of Atmel's marketing guys saying Zero will be compatible with all Arduino code, so who knows?

    Any other suggestion for an arm base board that has an easy to install toolchain/ide and is easy to transition to custom boards?
    I'm pretty sure you'll find Teensy 3.1 is among the best available today.

    But yes, there is a $8 license cost (or $6 in volume) for the Mini54 chip. On the plus side, PJRC does invest that money very heavily in software development, as you can see from Teensy's compatibility, special libraries like OctoWS2811, Audio, PulsePosition, and a long history of contributions back to Arduino.
    Last edited by PaulStoffregen; 05-26-2014 at 01:33 PM.

  7. #7
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    For its intended audience, Teensy 3 has no peer. Its form factor is also unique in the ARM end-item world. And Paul is generous to a fault with his software efforts.

  8. #8
    Senior Member xxxajk's Avatar
    Join Date
    Nov 2013
    Location
    Buffalo, NY USA
    Posts
    545
    Quote Originally Posted by stevech View Post
    For its intended audience, Teensy 3 has no peer. Its form factor is also unique in the ARM end-item world. And Paul is generous to a fault with his software efforts.
    Don't forget Paul's awesome support, and speedy delivery of products.

  9. #9
    Member
    Join Date
    Feb 2014
    Location
    Brazil
    Posts
    35
    Hi, I had the same question as you sometime (as you can see here: http://forum.pjrc.com/threads/25048-...icrocontroller), but I continue to work with my Teensy and Arduino are collecting dust.

    Teensy is better and Paul is a fantastic person, this is the Teensy differential. About my problem, I buy some expensive burn-in sockets and a cheap clone programmer and my problem is solved, about the Kinetis line you can buy a expensive programmer from http://www.pemicro.com/products/prod....cfm?family=16 and your problem probably be solved.

    The closed-source bootloader does not imprison you the Teensy, you'll can produce your bare-metal solutions without problem.

  10. #10
    Quote Originally Posted by hexodin View Post
    Hi, I had the same question as you sometime (as you can see here: http://forum.pjrc.com/threads/25048-...icrocontroller), but I continue to work with my The closed-source bootloader does not imprison you the Teensy, you'll can produce your bare-metal solutions without problem.
    Can I make the bare-metal ARM solution to work with the Arduino IDE? (which is a very easy to install tool chain that works on Linux, Mac and Windows, couldn't find anything that matches it in this regard).

    Quote Originally Posted by MuShoo View Post
    I was under the impression that the boot loader itself is basically the only thing that's NOT open and documented - otherwise we'd have cheap knockoff teensy's flying everywhere and it'd mar the product as a whole. Which is why Paul keeps it closed, and sells a pre-programmed mini54.
    That's the idea behind OSH, allowing to mix and clone (what you call 'knockoff'). ;-) Anyway, this is Paul's hard work and it's up to him do pick the business model that works for him. For me, as a consumer, I have strong preference to open source designs. BTW, it looks that the Teensy closeness have been discussed for some time, here is a piece from 3 years ago http://www.adafruit.com/blog/2011/02...loned-any-way/

  11. #11
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    921
    I was also going to ask whether it might be possible to custom adapt a Teensy 3.1 as a compact Inertial Motion sensing unit. I have seen this done using STM32F401 ARM chips here (way cool!) and wondered if I could do something similar using a Teensy 3.1. Are you saying I could spend $8 for a mini54 chip from pjrc.com, add a commodity MK20DX256VLH7 ARM chip and a MARG sensor like an MPU-9150 or LSM9DS0 to make a custom pc board and have a Teensy 3.1 running open-source sensor fusion? If so, this is wonderful news!

    P.S. Could I also use an STM32F401 chip, then?
    Last edited by onehorse; 06-05-2014 at 10:12 PM.

  12. #12
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,408
    Quote Originally Posted by onehorse View Post
    Are you saying I could spend $8 for a mini54 chip from pjrc.com, add a commodity MK20DX256VLH7 ARM chip and a MARG sensor like an MPU-9150 or LSM9DS0 to make a custom pc board and have a Teensy 3.1 running open-source sensor fusion? If so, this is wonderful news!
    Yes, you can roll your own boards using the K20 chip and the Mini54 bootloading chip. Paul's Teensy 3 schematics are published, no mystery there and most of the important BOP components like the crystal are documented also. All that said, if it is possible to get everything you will need on a breakout basis, I'd try that first, confirm connections, software, etc. before going down the path of ordering custom PCBs.

  13. #13
    Senior Member onehorse's Avatar
    Join Date
    Apr 2014
    Location
    Danville, California
    Posts
    921
    Thanks for the confirmation. I have already built a prototype using MPU-9150 and LSM9DS0 breakout boards driven by the Teensy 3.1 using open-source sensor fusion filters. I know everything works. And I don't underestimate the challenge of single-board integration of all the components. It's just somewhat of a revelation that I can consider such a project being possible at all.

    One other question, if you will: I've seen some discussion of using the Mini54 as an off-board FTDI-like interface for programming the ARM processor. Does it need to be integrated into the board proper or is the off-board, connector-interface approach feasible?

    I just realized that a good intermediate step would be to create a sensor shield for the Teensy. DoH!
    Last edited by onehorse; 06-05-2014 at 11:23 PM.

  14. #14
    Hmm, interesting post for me.. I've been developing a big (big for me anyway) project which has a commercial end-goal, usually I make things coz I want to and because I can, particularly for the FPV / RC hobby, but this time I want to offer the product to others... Just don't know about 'open source vs closed' commercial conundrum..
    I was tempted to just build a header into my custom PCB and just plug a teensy into it.. One of the design features is for it to be somewhat 'modular' in design so that it could be scaleable subject to budget of the intended target market. Obviously end cost of product would reflect that idea, but alternatively it's nice to confirm I can build the teensy components onto the board and pay the license fee, product cost like several hundred bucks so not concerned too much about $8 here and $10 there.

    Since it's aimed at the hobbiest, one idea was to do like a KickStarter campaign and offer the arduino code as open source as a stretch goal, that way at least I'd felt like I'd got the last year of my life compensated and the final software would be way better once people with better / different skills start adding / modifying it. Unfortunately, 90%+ of the 'value' of products like these are based purely on the software, since everything else is easily reproducible.

    Jeez, what a minefield lol. Still dunno.. I guess I'll decide once the project is finished and I can ascertain the value of the product but till then, I'll continue with the confidence that I can work with the teensy knowing I can ultimately use it successfully in end user commercial products.

    Any advice from anyone who has experience bringing products to market would be great

    Cheers fellow villagers

  15. #15
    Senior Member johnnyfp's Avatar
    Join Date
    Jan 2014
    Location
    New Zealand
    Posts
    263
    Tell me about it.
    I've finished the design for my Mini Foofy, basically a Wifi and SD Embedded Teensy board and want to get a decent HTTP Server working on it so that you can connect up Android or Apply phone without the need to have a app running on it, and all the development and software time is astronomical.

    I thought that, ah it's just a Derivative of the Teensy with a Adafruit Wifi module and SD card hold, how hard can it be. 6 Months later and the product is ready not the 6 weeks I first thought.

    Then when you are ready to go to market, where do you market it? How do you make it? China or local? is the cost too high, oh no someone has made something sorta similar but at half the price, Do I stop now? etc etc. So that's the position I am now in, ready to Kickstarter my project, but not sure if someone would pay the $80 it would cost. Was it all worth it?

    Don't know. Was it fun? Hell yes, will it make me millions? I doubt it.

  16. #16
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Raspberry Pi and Beagleboard w/Linux are what most people will go to if they want easy to use WiFi/Ethernet and an embedded-like HTTP server. It's just too cheap. Too easy!
    Even I could get VNC, WiFi, Apache server running on the RPi. In a couple of evenings. Mostly from others' postings, but some of my skills from using Sun OS, Linux, Unix for many decades. Much of the utilities are the same as 30 years ago. Sometimes that's a good thing.
    Last edited by stevech; 06-06-2014 at 05:37 AM.

  17. #17
    Senior Member johnnyfp's Avatar
    Join Date
    Jan 2014
    Location
    New Zealand
    Posts
    263
    Big and chucky and power hungry too. Oh and complex to setup Linux and get the IO working, and SPI and anything else compared to the Teensy, I have several BBB and several other Linux type boards and even backed this project on indiegogo which is a coin sized linux with wifi.

    But with all of these, they are a nightmare to debug when things go wrong compared to the arduino platform where it's easy. And they take an age to boot up (compared to a teensy).

    Each has it's place, but if you want to wirelessly hook up a teensy, on an infrastructure and not be relient on a cloud based server, you need something that is wifi and a server. Which is what I'm trying to achieve.

    As you point out, there are bigger cheaper things, so my product, definatly a niche market.

  18. #18
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Quote Originally Posted by johnnyfp View Post
    Each has it's place, ...

    As you point out, there are bigger cheaper things, so my product, definatly a niche market.
    agree. I use both!

  19. #19
    Member neilh20's Avatar
    Join Date
    Jan 2014
    Location
    N California
    Posts
    54
    Hey Andology,
    1)if you are bringing something new to market, then the rule of thumb is that you'll put just as much effort in the marketing side as the technical evolution side.
    2) The marketing people talk about testing a market with a new product - not spending too much money/time until a product has some customers.
    3) If you already have a customer lined up to buy the product then you are a fair way down the line to starting to define the market.

    While software - due to its unique complexity for a specific product defines the product - a lot of the uniqueness in a small product is its mechanical - enclosures, powering etc.
    The value of truly open source to the designer is that you can explore the technology - you still have to do a lot of the grunt work in makeing it happen - but share how people with similar skills and interests can use it.
    Want to do a kickstarter campaign - well talk to people who have done it or some classes, videos, maker faires on kickstarter, indigogo - figure out to get 50% of the product signed up before you launch, and do 90% of an initial product design.
    Want to make money as well - go back to step 1) above - and figure out your marketing strategy, market test strategy etc. and how much $$ and time you can invest to testing a market

    Me personally - I'm scoping and defining a market for remote monitoring - I can do some of the software, however its more like johnnyfp - its figuring out everything else its going to take, including the mechanical enclosures and every thing else around the software environment, then producing a small market run,

  20. #20
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    A respected veteran engineer once told me, and I'll not forget:
    The genius is not in the engineering, it's in the marketing!

  21. #21
    Neilh20 - I couldn't agree more with the marketing side if things.. I should have mentioned, I own www.JoopMedia.com which is marketing specialist company (I come from direct sales trainer / marketing consultancy background) although I'm fortunate enough to also be a designer and programmer and CRM specialist all in one (which I must admit comes in handy)

    I've backed several KickStarter campaigns myself already and been involved in some market research studies on the KickStarter model on behalf of one of my clients so kinda feeling like all is pretty clear in my head, other than getting from breadboard to PCB.. I used to etch myself back in the day but I'm prob gonna need 500 units max, so not too many. I work heavily in 3D software too so prototype casing etc will be done on 3D printer then off to industrial engineer for tool making etc I suppose.. dunno will cross that bridge when I come to it i guess! gotta get prototype finished first

    Thanks for your input, good info for anyone stumbling into this post

    Cheers

    Andy

  22. #22
    Wow, interesting post. I'm an "older" SW developer working with some "kids" to bring a new product to market. They went through a HAXLR8R accelerator program a few months ago over in China where you learn how to do HW products. I've been working for about a year on the SW using a Teensy 3.0, a bunch of discrete components and a Nordic nRF8001 chip (nRF2740 board for prototype) to get BLE. All have seemed like great choices.

    I do have to say that if it wasn't for needing USB I actually really liked the Energy Micro MCUs that I used in my last commercial product a bit better. With the Teensy the real headaches were low power operation and getting the watchdog to work rock solid. But there is library code by a user Duff in the forum here that helps a lot on low power and Paul made recent changes to the startup code that makes getting the watchdog working right a lot easier. And there are forum threads on those subjects. Oh, and of course, we bought expensive IAR tools to work with the Energy Micro vs using the free Arduino tools on this project.

    I do have to agree with everyone that Paul is great at supporting his product and it's a solid product. I like the Nordic BLE solution for the same reason.

    For people looking to do a commercial product I'd like to mention that I think Kickstarter has changed/is changing. As I said, we went through this HAXLR8R accelerator program. And some of the companies did Kickstarter campaigns at the end including us. If you look at the summary of the HAX KS campaigns at https://www.kickstarter.com/pages/haxlr8r you might notice that the current round of projects (we're Quitbit) didn't do near as well as previous rounds. Because I think people are getting burnt out with Kickstarter due to the fact that there is no accountability for people finishing their projects. Something to think about if you are going that route. For @johnnyfp check out the HAX SparkCore project -- sounds similar.

    Just thought I would pass along some info since I always get a lot of good insights out of these forum posts!
    Fred
    Last edited by froeber; 07-07-2014 at 03:46 PM.

  23. #23
    Senior Member johnnyfp's Avatar
    Join Date
    Jan 2014
    Location
    New Zealand
    Posts
    263
    Yes, I've seen the Sparkcore. But my Mini Foofy is in effect a Teensy 3.1 with SD and Wifi, Plus port B 5v translation. Slightly bigger than the Spark core, but Teensy Powered

  24. #24
    Junior Member
    Join Date
    Jan 2015
    Posts
    1
    here come a new challenger the USB armory !
    Linux running on a pcb of the size of a flash drive.
    Open hardware project (but a complex board to make)
    https://www.crowdsupply.com/inverse-path/usb-armory

  25. #25
    Senior Member johnnyfp's Avatar
    Join Date
    Jan 2014
    Location
    New Zealand
    Posts
    263
    Wow, expensive, no Networking, and if you solder any pins in the header, how do you get the SD card in and out without scratching the card. Not really a challenger by any stretch of the imagination.

Posting Permissions

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