USB-MSD with SD-card (Teensy 3.1)

Status
Not open for further replies.

uTasker

Well-known member
Hi All

I have created a USB-MSD application which allows the Teensy 3.1 to be used as a memory stick. It requires an SD card to be connected to it - below are the connections that I used:

- 3V3 und Ground for the power supply to the SD card
- pin 6 [PTD4] as Chip select to the SD card
- pin 7 [PTD2] as MOSI
- pin 8 [PTD3] as MISO
- pin 14 (A0) [PTD1] as SCLK

When the code is loaded to the board it appears as an external hard drive when connected to the PC via USB.
The core is clocked at 72MHz with the bus clock set to 36MHz. The SPI clock is driven at 18MHz.

Performance: Writing a 14MByte test file, the write speed (via USB and to the SD card) is about 210kBytes/s and reading the same file back (from SD card via USB to the PC) the read speed is about 440kBytes/s.

I did try multiple-block SD card operation, which allowed around 900kByte/s write and 1MByte/s read (close to the full-speed USB limit) but have disabled this for the moment (using only single-block reads and writes) since it could cause conflicts when the application on the processor tries to read/write at the same time as the PC is reading/writing. I may add additional management to resolve the conflict (cancelling multiple-block operations) later.

The HEX file is attached in case anyone would like to use it.

Regards

Mark
 

Attachments

  • Teensy_3_1_USB_MSD_1.zip
    60.5 KB · Views: 1,257
Just my two cents: I won't be downloading any HEX I haven't seen the source code for (not even to my PC, let alone a Teensy 3.x) and certainly not just so as to have yet another memory stick. I will be surprised to see much interest in it in this form.
 
Hi

To anyone worried about hex files - they are ASCII files that can't damage a PC by downloading and reading them (on a par with a .TXT file).
Open an unknown HEX file in any text editor to see the content. If worried about code being able to damage a board there is one thing that needs to be checked for: check the content in the file that will be programmed to the address range 0x400..0x410 (the flash configuration) - in the referenced file this can be seen at the second line in the file:

:100400000000000000000000FFFFFFFFBE03FFFF31

This shows that no blocks are protected, the device is not secured in any way, etc.

As I have understood it, loading code to the Teensy with the on-board device also protects against bad data in this area for being able to render a board unuseable. It should therefore be safe to load any files to it - if they don't work just load another that does (no worst than loading a project with a bug in it).

Therefore I don't think that there is any justifiable reason for not using HEX files to allow people to quickly evaluate code running on their board, if the application could be of interest to them.

Regards

Mark
 
Last edited:
Hi PJRC community,

I really like the teensy and this USB-MSD with SD card is exactly what I need to implement right now. I have been looking for a way of having this application through Freescale Processor Expert and, for those interested in the topic (off topic here) there is a nice tut out there on how to implement "Open Source / DIY" toolchain for the K20 50 kinetis series here :

http://mcuoneclipse.com/2013/07/20/dyi-free-toolchain-for-kinetis-part-1-gnu-arm-build-tools/

(Need to check out what Erich Styger is doing more, he's the Paul S of Freescale :$ ) Trouble here is that linking all the libs and pre configs to Eclipse makes me feel like reinventing the wheel / banging my head against a brick wall (not the comfy ones..).

Anyways, back on track here, is there some code or tutorial related to that HEX? I mean we all chose Teensy for it's learning community.. So uTasker can you provide some sources even if it's not complete or fully commented?

Thank you very much,
Mevon

(back to example diving, I guess it's somewhere in the files with Teensyduino, I just have to find it / make it appear somehow)
 
Last edited:
Mevon

The uTasker project is documented and all files are highly commented (it has been developed over 10 years and has about 3'000 "registered" users).

For example, the FAT used in the HEX file is utFAT - http://www.utasker.com/docs/uTasker/uTasker_utFAT.PDF
The USB-MSD part of the operation doesn't actually use utFAT (just the SPI SD card driver part) but there is also a DOS-like interface on the UART which allows the operation as discussed in the user's manual.
It can also be used as boot loader as described in http://www.utasker.com/docs/uTasker/uTaskerSerialLoader.PDF
The USB device implementantion is described here: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF
There are lots of other documents and some videos at http://www.utasker.com/docs/documentation.html

The TEENSY 3.1 is included in the project, as well as most Freescale boards for KL and K devices, so it can be easily configured to run on KL02 up to K70 (with the K20 somewhere in the lower middle of the range). It can be build with GCC, IAR, Keil, Atollic, Rowley Crossworks, or Codewarrior and also simulated in the uTasker simulator (as shown here: http://forum.pjrc.com/threads/25309-Teensy-Simulation).

The project contains full source code and use is free for all personal and hobby purposes (including support). The code has been used in many industrial projects over the years (where commerical licensing with support is possible) and so has been well proven in demanding environments.

The project code can be downloaded at http://www.utasker.com/forum/index.php?topic=1721.0 - there is a just a simple registration to complete (free and painless) at http://www.utasker.com/Licensing/request.html

Regards

Mark
 
Hi everyone,

I guess it was an easy feature when the teensy was still avr and the LUFA firmware was readily available in arduino.. Down the rabbit hole again, I will try to get something like whats on this post going to try and maybe succeed :

http://forum.pjrc.com/threads/1474-Anyone-using-Eclipse-for-development/page2

Hopefully, I can use the arduino libraries and the teensyduino startup configs to set all the freq and pll stuff I didn't manage to understand yet combined with the many (and mostly confusing) mass storage examples lurking around on the internets...

Thanks anyways Mark :p
Mevon

EDIT: Hey nice thanks for the answer Mark, I didn't know what uTasker was, Im reading on it now! Really thanks a LOT! (i luv u)
 
Last edited:
Hi Mark,

Thanks again for your reply. Thing is, what I see from other posts, people are looking for arduino based solutions. From what I understand from your post is that you are not using the arduino IDE nor the arduino libraries, you must be using IAR, Keil, or Other Toolchains and IDE, kind of voiding the purpose of Open Source DIY. I know these are required for Realtime debugging, so are the JTAG programmers, and proprietary libraries needed for the typical application code examples, so on and so on. I guess you get what you pay for and nothing is really "free" in this world. (If you get something for free, somebody work to produce that and didn't get proper reward for it (except maybe our eternal recognition and admiration for being so great))... Nonetheless, there are things truly free in this world (air, sunlight, rain, etc.), like Eclipse, the GNU ARM Toolchain, and the Eclipse Processor Expert plug-in, so I think theres a way making this application in Eclipse, benefiting from arduino IO libraries while having the PE take charge of the "basic" / lower level processor configuration (like for using the USB Stack bare metal), leaving Eclipse to code and debug. I know it is all messed up for me right now and the pieces of the puzzle are slowly taking their places but maybe a good place to start for all the confused people like me would be How to build a starter project for lets say CodeWarrior or maybe even Eclipse but for the Teensy 3 specifically. From what I understand, PEx (stand alone, plugin or in CW) generates a "startup" file that is compiles by GNU ARM gcc and everything is floating from there. All the exemples I have for using the 4.1.1 USB Stack from Freescale are all based on CW or other proprietary IDE and really not for the Teensy 3/3.1 boards.

So my question is how do you suggest I proceed to get the startup file for the Teensy? Am I on right track here or am I really off? For someone with your knowledge, I guess it wouldn't be so hard to start from scratch and get a project for the Teensy running in Eclipse but for all the other ordinary arduino user, it's a steep hill to climb.

Can you please help me?

Best regards,
Mevon
 
for an IDE, I like and am using for Teensy's,
freeware visualmicro.com, a plugin for the freeware Atmel Studio (MS Visual Studio).

Works with the Arduino ino files and Arduino/Teensyduino libraries.
 
Interesting,

Thank you for the reply but can the Atmel Studio be used with Freescale products? I mean for me right now, downloading the hex file can be done with the Teensyduino, but after Im done developing, I plan using a JTAG probe for the firmware upload.

I guess what you're saying is that it's easy or easier to create a Teensy 3/3.1 project and use the Atmel libs to cover the caveats the arduino (like USB mass storage device for one and all the missing libs, like maybe USB host, advanced ADC / COMP unit, Flextimer, DMA for extrernal RAM, etc.) IDE is not covering?

Not sure :S but thanks for participating,

Yours truly,
Mevon
 
Mevon

The uTasker project is not designed for any particular IDE or compiler - it works immediately with a number of such and has been tested with them but it can work in any (even if not tested and maybe needing a tweak). It also uses no libraries so all code is source code - it doesn't even use GCC startup or standard libraries and so supplies everything - even memcpy() function (which use DMA for acceleration in the K20).

I also don't understand why you would want to avoid Freescale Codewarrior. It is free up to 128k code size (special edition which is even supported by Freescale in case you have questions or difficulties) which is enough for most work - I develope industrial projects with K60s and K70s with USB and TCP/IP stacks and never reached this limit yet.... If a project goes above that limit then all you lose is the capability to debug since you can still build the project with GCC, which is what Codewarror is doing anyway.

There is a step by step of how the Kinetis starts up here ( https://community.freescale.com/thread/321229 ) that I wrote for someone. If you use VisualStudio express edition (also free) you can simply step through code and learn many details without HW and debugger restictions. Then you can cross compile what you have learned with the IDE/compiler of your choice and do the same thing on the HW or else just watch the HW work (if no debug capabilities) but in the knowledge of understanding exactly what it is doing.
The details are the same for the Teensy or any other HW that you use, from a KL02 up to a K70 processor.

Codewarrior is Eclipse based. The Freescale libraries are based on a number of projects for a number of typical IDEs and processor types, which is not always the best approach. Often the one you want is missing or the particular project that looks close hasn't been updated to solve bugs (or maybe not actualyl been tested...) and so it is hit and miss what happens and how long it takes to get it operating (correctly or still buggy). The uTasker project takes a different approach and has just a single project that automatically works on all processors - just select the family (eg. K20) and the board (eg. Teensy or add you own new configuration) and build. For example, a USB stack needs just about three lines of code that are processor dependent (mainly due to the way that the clock is derived) and not one project for each processor type and certainly not one for each IDE...

I never used the Arduino IDE. I do regularly use 9 different IDEs but at the end of the day an IDE is mainly an editor (most people have their favorites - mine is VisualStudio) and so this part has little to do with the embedded project, a make file manager and debugger (Eclipse offers lots more besides but these components are probably not used much by most people - with exceptions as always). The make file part can be performed by hand in any editor (if needed), leaving the debugger as probably the most important feature. In fact there are many possibilities to debug today including simply adding a plug in to VisualStudio ( http://visualgdb.com/ ) [although such plug ins only work with VisualStudio full version and so are not free - if the goal is to do things without spending any money i.e. investing, then some restrictions may imply].

It depends what you want to achieve. If you want a Teensy project in Eclipse simply take Atollic Lite or CodeWarrior special edition (both Eclipse and supporting all debuggers and free), and import the uTasker project (that is, use the menu to open the project in it). Then select K20 and Teensy, click the build button and you have the solution. Then load the output to your Teensy and modify the project as desired to complete your own application.

The Teensy does support target debugging but you can already simulate and debug in the uTasker simulator (VisualStudio Express - free) and then build in the IDE to verify on the target.
If you want to debug on HW simply order a Freescale Freedom board - they cost about $14 and include an on-board debugger). Then debug any new HW level code there and use it on the Teensy later.

The USB-MSD project for the Teensy was developed without a Teensy (just in the simulator) and worked first time on the board (although it had been tested already on many other Freescale boards). I only actually received a Teensy to test with later (a friend of mine verified that it was already working).

There should basically be no problem with mixing libraries of different sources; there should be no reason to restrict to a single source of code. If you want to use some Arduino library code then why not and if you find libraries outside of Arduino that suit you better then also why not...?

So you have all that you need at your finger tips but it is up you you to start making it happen ;-)

Regards

Mark


P.S If you are worried about registering at the project, just send me your email address and I can mail you the access. The registration just helps keeping track on support cases since the project supports a number of processor types (not just Kinetis) and often people forget to inform which chip, compiler etc. they are using (in the registration these details are saved so they can be looked up without first having to ask these type of questions when responding).
 
for an IDE, I like and am using for Teensy's,
freeware visualmicro.com, a plugin for the freeware Atmel Studio (MS Visual Studio).

Works with the Arduino ino files and Arduino/Teensyduino libraries.

Hi Steve

Personally I prefer the VS environment to Eclipse and the plug-ins that are now available essentially 'could' make many 'classic' embedded development IDEs superfluous (as long as the GCC compiler and GDB are acceptable - IAR, for example, still will outperform GCC if code size and speed is critical).

ATMEL Studio 6 uses Visual Assist X to handle its operation and its shell is VS without C++ support. It is of course designed for ATMEL devices and ATMEL has certainly paid license fees for its customers to be able to use it. I think that most plug in suppliers avoid targeting this since there may be some retalliation from ATMEL if its use were to become too widespread.

Regards

Mark
 
Hi Mark,

Again I cannot thank you enough for your responses, I think I'll go with CodeWarrior which gets better updates (10.5 vs 10.3) then the Eclipse Plug-in now. I think I can manage to integrate the arduino libraries easily in CW, to be honest it was my next step if I couldn't get the Eclipse part working. It's nice to know there's still people willing to share their knowledge and I think Freescale is more compatible with the DIY community we all like to turn to when we want to learn by ourselves. Don't get me wrong here, Atmel and Microchip are nice too, but Freescale seems more complete for higher level applications requiring lots of processing.

That being said, I will be giving uTasker a spin and when you say you had the project running in simulation for me it's like magic! TAHDAM! The bunny's out of the hat! :) I wish to get better at programming and simulation for micro controller as always mesmerized me, now there it is, ready to go!

I know I was reluctant to use CodeWarrior but you made me realize it's the best learning tool for me right now. Maybe I should get a FRDM-BRD but the whole on-board debugger thing didn't appeal much to me. For me Teensy 3 made more sense but then again it's not so much afar from the Freedom board design. For me what appealed the most was the PJRC community and support everyone here is willing to share. To be honest, I wasn't really planning to use the USB-MSD part in my project but now objectives have changed and I'm just glad I can turn around and go for a different application with the same chip and design. Except that arduino is not suited anymore for my new application. But thanks to you, things make more sense now.

Again, thank you very much, best regards,
Mevon
 
Interesting,

Thank you for the reply but can the Atmel Studio be used with Freescale products? I mean for me right now, downloading the hex file can be done with the Teensyduino, but after Im done developing, I plan using a JTAG probe for the firmware upload.

Yours truly,
Mevon
Yes, with the visualmicro.com plug-in for Atmel visual studio or for MS visual studio alone, one can target the AVR or the Teensy 3, fully integrated with the Teensy downloader. The Teensyduino libraries work with Visual Micro, as do .ino files. Visual Micro's plugin is free. They also have nice source code based debugger for low cost.

(I have no stake in the above freeware or products).

It is possible to use Eclipse with Teensy. I had it running once, then it needed a big update due to revisions by all parties, and after trying, I decided Eclipse for Teensy lacked a viable installer. Then along came VisuaMicro.com.
 
Last edited:
Hi Mark,

Thank you again for taking this time with us. Here is where I'm at now : got the same "white page" syndrome that I had with the Eclipse setup I had before installing CodeWarrior. Seems like I can create a project, get the Processor Expert to configure some parts of the CPU but then I feel like I must build a flying aircraft and all I got is aluminium sheets and rivets... First I don't know if I should start from scratch since nothing has really been done (maybe Im wrong) for the T3 itself or if I should start my project from an example (in the USB stack or CW 10.5 installation folders) and add from there. And adding itself, I mean just the basic parts low-level stuff like maybe I2C or UART coms (like in arduino Wire.begin(address) function), is kind of not natural for people used to the arduino ecosystem. I try to find documentation from Freescale on how to use their libraries or stacks, but then again it's only like two pages long and voila, things are all working and no details are given on which anyone could build on and advance their own projects. Maybe I get this feeling because I'm too oldschool and haven't spotted a main.c or .cpp file anywhere, or haven't seen any file with comments like // ADD YOUR STUFF HERE, but you got to admit that the gap between installing the IDE and producing your own com protocols and peripheral managers is quite large. Then again, maybe I don't have to if I want to have this USB-MSD application with SD card, maybe it's like uTasker and everything is or should be working right out of the box, but if I'd wanted a plane ordinary usb card reader I would gladly dispense the 5$ to get one at a store nearby. I will try some HelloWorld examples I found in the many example projects I got installed with everything but it doesn't have all the USB-MSD part inside of it nor the SD card reading part. And where back to the "chicken or the egg" question where I wish I had some tutorial or pdf saying ok, to add USB as MSD you need these functions, to add CDC on top you need to add these functions with these files, and if you need to "debug" over the UART you need this and that, etc. It's always like load this example in CW, press the build all button and if you have no errors then TADAM, it's working... nothing else is given in the Freescale documentation. I see the CW workspace is full of details and seems like there are many options to tweak in the PEx "database viewer" but that is something you should do once, and once it's set up for your CPU then chances are you won't go change that again. Where I'm lost is I need to design a system, probably running in some RTOS tasks, which can provide access over usb to contents in a SD card, manage some I2C chips for extra GPIOs, got a relay controller on SPI, need to send some PCM data over I2S, manage a small LCD and have some interrupts from IO ports and do some constant ADC sampling. All this is the very basic of the project, not even talking about the "conflicting" situations where one task would read the SD card whil usb msd part is trying to do the same, or having some interrupts on IOs while the user is navigating in different menus with the LCD... I know this is huge for such a tiny chip but I think it can do it, and if it wasn't for the MSD part, arduino would of made a good free to use IDE with a lot less of confusing examples on the many parts I am trying to fit together and making all this happen in a RTOS is not a big deal. Ok maybe no debug support with a JTAG probe but meh.. USB-to-serial is enough for debugging and most of the time will always be. Maybe I'm freaking out right now (DON'T PANIC!) but I know I have greater tasks awaiting me then getting the project configured correctly with CW so I can eventually start thinking about all the little details my project is requiring. And I'm not even to the prototype part where all the hardware is put together and everything really starts to fail or smoke up :p

I'm not asking you to tell me how to code everything I need for my project to be complete, and maybe uTasker is what I need (but I cannot be really sure unless I learn the basics and how everything should look like for basic kinetis project), but can you help me get started beyond the "Let's get started" point? I need good tutorials on how to add functionalities from scratche, like CDC over MDS for once, FreeRTOS after that, ADC monitoring tasks, IO interrupt functions tasks, I2C and SPI in the background tasks, I2S is the cherry on the top. I know you can add many projects in the workspace but do they get all compiled into one HEX in the end? If I want to add my "managers" or even just RTOS tasks support, do I merge all projects into only one or just adding them in the workspace will work like magic once I hit the "Build all" hammer thingy?

Please advise, and many many thanks again,
Mevon

(Back to pdf diving again, hope I don't drown...)
 
Mevon

It is difficult to know what you are trying to achieve. On the one hand it seems like you want to learn the absolute basics to get the processor to execute a few lines of code from scratch and on the other hand you want to develop complex projects, partly with low level code which you may want to write yourself or partly with a operating system which you won't write yourself but may dictate a lot of what you then must do.

If you want to use FreeRTOS then you won't be able to use your own startup up code etc. so it would be best to start directly with FreeRTOS. You won't be able to get much help here since I can't support FreeRTOS so you will need to move to a FreeRTOS- relevant forum for your work. I don't expect teensy users use FreeRTOS (but I may be wrong).

If you want to work out how to do the very basics I gave a link to a very basic tutorial which more or less shows everything that is needed and it would then be simple to answer any remaining question, but I get the feeling you prefer not to try it and would rather find another one which is more suitable, although what would be more suitable is unclear.

When using CW you have to chose also how you want to work. If you use PE then you are using a "case-tool" which will be trying to do all of the nitty-gritty work for you and so it won't help you atually learn much. It is there when you don't want to do any low level work and just want a machine to spit-out something that may be close to your basic requirements and then you build an application on it. Some people like PE and some never use it - personally I never use it because I prefer to know what code is being used and then be able to maintain it. Sometimes PE works well, I understand, and sometimes it generates code that is unsuitable and may not even operate.

I have given links to documents showing how to use USB etc. but a tutorial from scratch is not simple. USB is quite complicated if you want to know and learn the details it is best to read a good technical book and then analyse a working solution. The otherway round is more like wishful thinking. I developed my own USB stack from scratch and have invested $7'000 in tools to help on the way. I have written a guide and tested and improved with real-work project use. It took me 18 months to get from scrath to understanding things well enough to be sure that the end result was good. That is something that you won't learn in an evening with a tutorial.

Still it is unclear what you would actually like. If you want a simple code to flash an LED that is no problem. If you want a complete solution which you can use to make your own applications that is no problem. But is not easy you give a simple example so that you can immediately build up an complete solution completely by yourself.

Regards

Mark

P.S. I updated the USB-MSD application to add voice-recording to the SD-card (also a digital delay line): http://forum.pjrc.com/threads/25443-Teensy-3-1-based-sound-recorder-and-digital-delay-line
 
Just my two cents: ... and certainly not just so as to have yet another memory stick. I will be surprised to see much interest in it in this form.

I have to disagree. This makes it easy to put files onto an SD card that some other Teensy program can access as a FAT file system.
 
I have to disagree. This makes it easy to put files onto an SD card that some other Teensy program can access as a FAT file system.

Yes, having USB-MSD in your arsenal is important. It can be used to load software to a board, to load files to the board for use by the application on it or retrieve files from the board after it has prepared them (data logging etc.). For example, take a camera; it isn't designed to be a memory stick but it acts as a memory stick to retrieve the photos that were shot using it. If it didn't do this one would have to extract the SD card (or other memory type) from it and plug it into an SD card reader to copy them to a PC, which is much more practical. In the case of internal FLASH it would hardly be practical at all.

That is why I extended the application (see other thread) to show how it works "together" with an actual application - in that case, a sound recording device which can play back the recording (or copy to the PC for storage) by simply connecting via UDB.

Of course making a dedicated memory stick with a Teensy wouldn't be a particually interesting application, apart from the fact that it can be fun to do it, due to the fact that simply buying a memory stick in the shops will be cheaper and have much higher performace. Also using the Teensy as an SD card reader, which is nevertheless a useful application if you need to read an SD card and don't actually have a reader handy (!), is also not much more than for a bit of fun to see it working. For $5 you can get a purpose build SD card reader which will outperfom the Teensy by miles [the K20 communicates via SPI and has full-speed USB, giving a maximum copy speed of around 1MBytes at tops, and those dirt-cheap readers use dedicated chips with 4bit SDHC mode and High-speed USB to achieve maybe 10x or even 30x the data rate possible the K20].

USB host mode, which the K20 can do with a little extra HW, is also not be be underestimated since it is possible to plug in a mini blue-tooth or Wifi dongle to make it wireless network capable!

Regards

Mark
 
Last edited:
WiFi on a non-Linux micro... specialized.
ConnectOne and maybe 1 or 2 others make WiFi radios with a UART or SPI interface that would connect to something like the Teensy. Onboard the ConnectOne radio module is, indeed, an ARM with a boatload of IP networking layers and apps. So the attached Teensy can, via say a UART link, send/receive email, make or accept TCP connections, and so on.
 
Yes, USB-Wifi dongle is not the simplest.

There are various alternatives as you point out, from modules that handle a complete TCP/IP stack to ones that just do the Wifi interface work. SPI is common and some also fit in SD-card slots and use the 4 bit SDHC interface.

Socket modems are often used too (DIP sockets with standard pinout so that they can be changed for Ethernet, Wifi, ISDN, PSTM modem etc.). See - http://www.xmodus.ch/sm_lan.html which uses the uTasker TCP/IP stack (needs 32k Flash and 16k of SRAM on any ARM processor) - over 20k of the LAN version have been shipped and are very simple to use with only a standard UART connection and AT commands (typical for socket modems) supporting web server, Telnet, FTP server and FTP client; this means that the processor can simply command collecting data from an FTP server or directly save its own data to a remote FTP server (saves having to have local storage space...).

Regards

Mark
 
Hi Mark,

Again and again, I cannot thank you enough. I know my objectives are maybe too high or unclear, but one thing I am looking to do is build a project and just trying to know where to add my work so I can go on with my design. So, if the PEx is building everything under cover and nothing is really accessible because it's only precompiled binaries added to the final hex then I'm pretty sure that's not what I need. Maybe that's why arduino appealed to me and was easy to use because it reminded me of the Turbo C++ days when we had one main.cpp and main.h where everything was included and project structures weren't so complicated. I am now greatly considering using only a Makefile and no project structure whatsoever but then I'd be missing on the JTAG probe debug feature I consider important to have in the near future.

So what I am asking you is what would you do to get started on a project that could involve many feature of the microcontroller to be reunited in one project? I know the easy answer would be uTasker, I mean you have done this project is such a manner that it clearly works and I believe the choices you have made are those needed to get all that wanted to work. But, maybe I want some insights on what you did to get it to where it is. Evidently, you cannot foretell me what I need to do to have everything working on the T3 and even less if I want to use a specific example, from maybe another board project, and build it for the T3 specifically. But, if you can tell me how you started your project, maybe it can help me get passed this white page syndrome I have that I cannot seem to overcome. I mean now I know how to import examples in CW to make my own projects, but that's it. I haven't found the way to add many projects together and if adding them all in one workspace gives me one hex with all the examples compiled together (eg. opposite to merging everything "by hand" in one project).

So, to be clear, you must have started with some examples or library, did you merged them all in one project? Also, you added a TCP/IP stack, did you write that from scratch inside an already working project or did you add it as library? Did you use CW to begin with or have you adapted your projects to be compatible with CW? Did you use or do you recommend using PEx at all? What is it good for?

So what I'm trying to say is, it is quite easy to compile the HelloWorld example and have a taste of what CodeWarrior or any other IDE is, but from there, how do you go on and build over a simple project towards more complicated applications? Even just adding the files to the project is not really clear to me after 1 week of reading pdfs from Freescale. It seems it's just some drag and drop in the explorer pan inside the ide, but it seems odd to think that it will be automagically be included in the project without adding any #include anywhere and everything will compile on the first run. It's like buying a car, wanting to take a peak under the hood but not being able to find the lever to pop it open... I mean I don't have understands all the gear ratios in the transmission, maximum torque on screws holding the cam down and gaps needed on the spark plugs, but I would like not to have to go to the dealer just to add windshield fluid or have the oil changed.. Seems like all the tutorials I see around are all the same 2 pages on how to load a project and hit the build all button. Don't mean to insult anyone here but if you could help me, seems I have trouble getting passed the "Let's get started" point here.

Best regards,
Mevon
 
Hi Mark,

I just got my registrations for the uTasker and see you recommend MS VS Express in the link you posted here and in the documentation given on your website. It might help me understand furthermore what is needed for a basic project and how to add some more into it. I see also I asked a lot of questions yesterday and you might not all answer them (unless maybe if I get a uTasker licence, which I might actually). But, if you want you could answer only this question and I would be very happy :

You state that you have full out-of-the-box support for the Teensy 3 and I have trouble finding it in the files of the uTasker project. But lets say it is there and there will be eventually more information on the subject, how can I add other arduino libraries in the project?

Thanks in advance,
Mevon
 
Hi Mark,

I find the more I look in the documentation on your site and more I understand what I didn't understand last week. I was thinking that your stack was a bit overkill for my application (website server, tcp/ip, etc.) but then again I was looking to maybe extend in a much further future into those functionalities eventually. I will be contacting you this week, I am getting a better grasp on what is what and considering investing in a licence.Tell me what is the best way to contact you for some more serious talks about what we discussed here and the licensing process?

Thankful as ever,
Mevon
 
Mevon

It is not easy to pick out varous question from the text - some are retorical questions, some are hyperthetical ones and some are technical. It is best if you specifiy questions technically as far as possible so that they are specific and answering will be simpler. And best just one question at a time otherwsie it overwhels anyone trying to help.

I have picked out a number (maybe not all):
>>So, to be clear, you must have started with some examples or library, did you merged them all in one project?
>>Also, you added a TCP/IP stack, did you write that from scratch inside an already working project or did you add it as library?


See the following history of the uTasker project development for answers: http://www.utasker.com/history.html

>>Did you use CW to begin with or have you adapted your projects to be compatible with CW? Did you use or do you recommend using PEx at all? What is it good for?


I didn't use any particular IDE for development. The IDE should not be the centre of attention. It is a tool and if it breaks or you don't like it there are others. What I don't like to do is get trapped by a particular tool. For that reason I never use PEx. PEx is a tool to help generate some code (for a particular environment and limited to particular devices from one manufacturer) to get started with - it may be good for some reference code but generally I have hand developed all that I use and understand that well and refine it over time and use. Using what is spat out of a case tool may sometimes work very well but it may also just be what what punched in by some monkey - who knows...

People chose at what level they work and develop. Some like assember, some like C, some C++, some Python or Java. There is no one solution that is best for all cases and one person. You need to find out what you "like doing" and where you "like working" - at what layer (low level like C and assembler for example where you may need to write 1000 lines to get one function working or high level abstracted level where you can control a space shuttle with two lines of code - using many hundreds of thousand pre-developed lines being called by the methods).

>>You state that you have full out-of-the-box support for the Teensy 3 and I have trouble finding it in the files of the uTasker project. But lets say it is there and there will be eventually more information on the subject, how can I add other arduino libraries in the project?

There is no "file" for the Teensy. The Teensy is simply a configuration of the project (one of many). Open config.h and select TEENSY_3_1 and the project will be configured for it (eg. the Ethernet controller will not be used since it doesn't have one but USB device will, if also enabled in the file. Do a project search for TEENSY_3_1 and you will find a "small" amount of code that is specific to its layout.

If you want to use code from Arduino simply add it to the project and use it, as long as it is written in C code. I don't know what is in the Arduino libraries and there may be some resource conflicts but such things happen all the time and can usualyl be solved quite easily. How you add files to a project depends on the IDE but Eclipse automatically adds anything it finds located in a sub-directory of the project.

Regards

Mark
 
Mevon

Licensing is only for commerial support.

If you are doing hobby work there is no licensing required.

Regards

Mark
 
Last edited:
In today's technology, I don't think that the TCP/IP stack (including ARP, ICMP, UDP and BSD-like sockets) needs to be nor should be in the memory space of the small/medium sized microprocessor. That certainly means 8 bitters and small-ish ARMs like less than 1MB flash.
The mbed group never did, to my knowledge, get a stable/reliable stack on that CPU, due to use of freeware that was rather old, and the author had moved on to more curious things.
The better approach, IMO, is a commercial product Ethernet or WiFi module such as from WizNet or Lantronix or Digi International.

If your IP needs are modest, modules like those from ConnectOne off-load the stack and commonly needed session protocols as are often used in low data rate application.
 
Status
Not open for further replies.
Back
Top