USB-MSD with SD-card (Teensy 3.1)

Status
Not open for further replies.
Hi Mark,

From what I'm seeing, seems to be the difference between using Arm C toolchain or Arm GCC toolchain. In a project which uses "Arm Ltd Windows GCC C Linker", I don't have an "Output" option in the Linker tab. In the bare metal project examples given with the 4.1.1 Freescale usb stack, in the "Arm Linker" tab I have this option.

Small steps here but still going forward!

Best regards ever,
Mevon
 
Hey about the "mass erase" feature, I'm seeing "mass_erase_kinetis.tcl" files in the Debugger folder of some projects, and oddly enough, not in the K20 projects folder. Is it something the flash probe itself does and the option is not available on all probes (like segger or PnE), or it is really a CW flash utility that adds this file in the project when you check that box you speak of?

Thanks in advance,
Mevon
 
Mevon

I don't know whether there is a file created. I use it only occasionally and turn it off again after use and haven't though about how it actually works - as long as it does its job.

Regards

Mark
 
Thanks Mark, I thought it was a simple ProcessorExpert project using built-in components.

I got to the point in my project were Windows says "Installing driver software..." when I plug the Teensy with my project loaded, then says "USB Mass Storage Device (Failed)", so I must be missing something.
 
Axel

Assuming you are using CW there is a building guide here: https://www.youtube.com/watch?v=uBbiw36Caq4&feature=youtu.be

For the serial loader (USB-MSD, UART, SD-card) on Teensy 3.1 these are the steps/settings for the USB-MSD loader:
1. Select the target in CW "uTaskerSerialLoader"
2. In config.h (in uTaskerSerialBoot directory) ensure that TEENSY_3_1 is seelcted and other board types disabled
3. Make sure that USB is enabled (#define USB_INTERFACE)
4. In target properties ensure that Cortex-m4 is selected (and not cortex-m0)
5. In linker general setting ensure that a suitable linker script file is selected "${uTaskerV1_4}/Linker_Files/K_256_64.ld" matches the Teensy exactly
6. If you load with the Teensy loader you will need a HEX output. Add this to the file \Applications\uTaskerSerialBoot\KinetisCodeWarrior\generate.bat with an additional conversion command:
arm-none-eabi-objcopy --output-target=ihex uTaskerSerialBoot.elf uTaskerSerialBoot.hex
7. Build
8. Load with Teensy loader


I just tested these steps on the V1.4.4 release and it worked correctly on the Teensy 3.1

Notes:
- if not using CW there is support for GCC standalone, IAR, Keil, Atollic and Rowley Crossworks for building (steps essentially the same in each case and the code is IDE independent)
- by setting the desired board in config.h (and the correct target type andliner script in the compiler) the build will work on any Freescale Freedome or tower kits as well as a few other board for alternative hardware vendors.
- In the simulator folder the project can be built with Visual studio (free VS Express edition is adequate) and will simulate the teensy and allow the project to be run, tested and debuggedin (approx.) real-time on the PC.
- there is the serial loader and main application in the project with many options and also runs on all KL and K processor types and boards (limited by particular devices' peripheral availability accordingly)

For the USB-MSD SD card (memory stick application) use the "uTaskerV1.4_Flash" target and configure the same in config.h in its folder - select USB and SDCARD_SUPPORT and build. Of course the SD card must be connected accordingly for it to see the content.

It is always recommended to use the simulator in parallel since it allows you to quickly check that all is set up correctly.

Regards

Mark
 
Hi Mark,

Yes I installed the KDS last friday but I have to say I'm a little deceived by the product :( Maybe it's just me but I didn't see any difference with the CW IDE. I was probably expecting too much and like I said maybe it's just that I didn't find the part where the "Design" was all taking place but to me it is identical as the Processor Expert. Is there any wizard of some sort to help with the design or is it just like before and you just pick some PEx components to configure in the project?

Best regards as always,
Mevon
 
Mevon

That is Freescale's idea. You effectively get CW10.5 (but limited to Kinetis) with all its features "but everything is for free" (CW was limited if you didn't buy it).

Regards

Mark
 
Hi Mark,

Wonderful work you guys do in the Kinetis community and trying out the KDS I find it's missing the "Commander" tab and some easy way to "Import from existing projects/examples". But you know seems the Hex generation is build-in in the Project Properties -> C/C++ Build -> Settings -> Toolchains tab : "Create flash image". Seems to be a valid ihex binary so with the Processor Expert the option is there.

Keep it up!
Mevon
 
Hi, all--

I figure I'll resurrect this thread to ask about the original subject line. Several months ago there were some discussions about possibly implementing USB-MSC as a USB mode (selected through the USB mode menu in the IDE) to access flex memory and/or an attached SD card as is done with Teensy 2. Paul indicated this would happen eventually but due to the need for an extensive rewrite is a lower priority relative to other investments.

Any update on if this is possibly coming soon? Can the code that started this thread be a foundation for this capability?

Thanks!
 
Hi djsz,

I cannot reply for anyone at PJRC but from my research, an arduino solution is not possible for now unless PJRC takes some time to rewrite the usb stack. There are alternatives though (which is the subject of this thread) :

1) Use the UTasker software/stack inside the compiler of your choice (IAR, CodeWarrior, KDS, etc.) to compile an hex you can download in the Teensy 3/3.1 (supposedly it works, I haven't tried it myself). UTasker has great support and I can say Mark Butcher is active member of the Freescale Community, I would thrust this guy.

2) Use the Kinetis Design Studio or CodeWarrior with Processor Expert components to easily create the foundation of your software( see at http://mcuoneclipse.com/ for more details).

3) Use the examples in the Freescale USB Stack 4.1.1 that are for the K20D50 and K20D72 and compile them with KDS or CW10.6.

NOTE: in any of these option, the arduino libraries are not available. Also, ProcessorExpert components are used in C (not C++) compiler.

The Freescale softwares allow you to have a mass storage device as either a Host or Device, CDC, and many other USB device type. KDS is in beta and will be released at the end of this summer.

Good luck!
Mevon
 
Thanks, Mevon--

I had suspected given the tone of the conversation that fundamental plumbing work was required in order to enable this in Teensyduino. I unfortunately do need Arduino libraries and am therefore restricted to using Teensyduino for now. Paul, is this still low on your list?

Thanks,
Dave
 
Thanks, Mevon--

I had suspected given the tone of the conversation that fundamental plumbing work was required in order to enable this in Teensyduino. I unfortunately do need Arduino libraries and am therefore restricted to using Teensyduino for now. Paul, is this still low on your list?

Thanks,
Dave
This sort of thing is why I wound up using a liking Atmel Studio 6.1 with the free Visual Micro plugin. Great. Works with Teensy 2 AND Teensy 3, and Teensyduino libraries (AVR and Freescale).

I have used Eclipse on other MCUs, but I find no stable and comprehensible baseline of Eclipse for use with Teensyduino, despite trying. And begging the pardon of the OSX and Linux folks, Atmel Studio + Visual Micro is per me, much better and really, really helps my productivity when working with projects involving lots of files, libraries, dozens of .h's. I also tried CodeBlocks and its derivatives but they like Eclipse, just weren't ready for a person like me that wants to use, not build, tools. In my professional work, I'm an IAR devote' but not for hobby stuff. Though I sorely miss JTAG and flash breakpoints with J-Link, when working with Teensy 3.
 
Last edited:
Hello Everybody!

This is a beatyful day for all you teensy 3.x lovers, looking for more versatility on this beautyful platform. Our friend Erich Styger has come up with a superb write-up on how to hack the T3 so you can use Kinetis Design Studio or CodeWarrior to program/debug your code in a more traditionnal/professionnal way (= more costy). If you "dare" to take the red pill and go beyond what Arduino has given us, you can take is ProcessorExpert components to use with the T3 (including Usb Mass Storage Device HOST application and many others like SD card component and CDC usb serial port) So be sure to go on this website and try out the new KDS totally free to use with the already given project config files on the GitHub.

http://mcuoneclipse.com/2014/08/09/hacking-the-teensy-v3-1-for-swd-debugging/

Thank you very much Erich again and best of luck to you all,
Mevon
 
I would be helpful if there wasn't an Amazon ad hiding the bottom of each photo as I scroll down on the article. Yeah, I can click X on each ad, but it was annoying after the second time. I'm using Chrome for my browser on an ancient Fedora 11 based laptop. It probably is due to where you are hosting the photos.
 
Hi

Essentially this hack is to connect two signals to the board so that an external SWD debugger can be attched to it.
This is something that people have been doing for some time if debugging is really needed so I am not sure that this is really earth-shattering news in any way.
Another common trick is to use other development boards (such as the Freedom boards and connect their debugger SWD connetions to the board) so that the dedicated debuggers are not needed.

However if you have development boards, such as the Freedome K20 anyway, it is also common to do SW development work on it and then just load the tested/debugged code to the Teensy.

What I think would be more interesting woudl be the possibility to actually put a small K20 with the OpenSDA code onto a Teensy board rather than the boad loader chip so that it would then be less restrictive (that is, a version with debugger instead) or a version without any boader/debugger for use in production projects; just with SWD access so that an external programmer can be connected for the programming (or for some debugging in case of troubleshooting).

Regards

Mark
 
Hi Mark,

yes indeed this is old news but the project and project files needed to use the teensy with CW_IDE or KDS is something not many had shared with us yet. Also the step by step walkthrough is something very nice for people coming from arduino ide and trying to make it to higher end dev environment. Indeed, I bet the Teensy would be even cheaper if it was sold with a jtag/swd connector instead of a mini54tan chip (paul *wink wink*) and having it delivered with an OpenSDA programmer/debugger firmware would be a nice feat. Now, is it going to happen when you can build yourself a MC HCK board for around 5$ (https://mchck.org/) ? I don't know and maybe PJRC is working on a KL Freescale board and maybe it would be a good timing to ditch the arduino platform altogheter at once... Im just saying :)

Mevon
 
Mevon

I don't know whether there is a direction chance wanted or needed.

There are loads of Freedom boards available that can be ordered from many sources and cost from $12 each - each with OpenSDA debugger support and free development envoironment supported by Freescale, plus masses of software to go with them.

Presumably many users of Teensy prefer its existing environment and wouldn't want to move anyway.

Anyone deciding that something else is needed or preferred (don't forget that the Teensy supports one single medium-performance Kinetis part, whereas there are some 400 to actually chose from) can already chose from many low priced HW solutions without needing to wait for a modification to the Teensy to be offered.

Regards

Mark
 
Is it possible to port this code to the Teensy 3.6 ?

The software works already on about 60 hardware references, including K66 based ones, so a Teensy 3.6 port will take about 15 minutes.... (I may do it later if I find some time).

Regards

Mark
 
Status
Not open for further replies.
Back
Top