Hello:
I am writing a CAN - USB bridge and it seems that AN3690 has taken care of it already. I have several newbie questions and hope they can be answered. I am new to the whole CodeWarrior environment.
1. AN3690 uses CW 5.9, can this be ported to 10.6? I would like to do this but I want to know if there is anything I need to watch out for.
1. AN3690 uses DEMOJM to test, I have EVB51JM128, can I still test it if I connect to the CAN pins and have everything else set up? Again, I am relatively new so I am sorry if the question seems dumb.
3. How come the drivers for AN3690 is radically different from USB Stack 4.1.1? I would assume we would use the same drivers? If I were to write an industrial firmware, which driver should I use? I only need it so that it can do bi-directional transfer USB <--> CAN
4. Consider that I have everything working on the EVAL board, is it safe to assume my program will work exactly the same on MCF51JM128? anything to be careful with?
Thank you for your time
> I am writing a CAN - USB bridge
As part of a CAN bus monitor? There's plenty of them available already.
> 1. AN3690 uses CW 5.9, can this be ported to 10.6? I would like to do this but I want to know if there is anything I need to watch out for.
Read the following and the ones it points to:
Re: Coldfire V2: Porting to EWL from MSL crashes application
> 3. How come the drivers for AN3690 is radically different from USB Stack 4.1.1? I would assume we would use the same drivers?
I think the latest is USB Stack 5.0. That's the one the link started downloading for me. But... This version is ARM Only, No ColdFire support at all.
Anyway, I downloaded it to find out who wrote it. It has "Author: FSL" as well as including a FAT Filesystem from "Author: Electroni Lives Mfg. by ChaN of Ageo city, Japan (hobbyist)".
I then found the 4.1.1 link which is the one for ColdFire. The Install is 97 Megabytes before it is unpacked! That's not something simple at all. At least it seems to have been updated recently (2013), and lists CW10.3 as the supported development system.
The AN3690 code uses CMX Lite, written by a commercial company. That's why they're different. CMX Lite was announced here on 2006:
http://www.cmx.com/coldfire/cmx_usb.htm
As that page is 8 YEARS old, the link on that page back to Freescale to actually get the software gives "Page Not Found".
So it looks like Freescale started supporting USB with CMX's stack, and then developed their own, currently 4.1.1. I'd go with the latter.
> If I were to write an industrial firmware, which driver should I use?
What's your time worth? What's "product running late" worth? What is the product going to sell for - millions at $1 each or 100 at $10,000 each? It may be worth buying a complete OS with working drivers for everything if in the latter class.
Search this forum for previous posts on those. Type "USB Stack 4.1.1" and "an3690" into "Search" above. You're looking for any indication that code is "Production Ready" rather than "Demo Code".
I'd suggest using the CAN part of AN3690 together with the USB code from USB Stack 4.1.1.
Are you "Bare Metal" or do you have an operating system? If you're using the latter then you need matching drivers.
USB Device code isn't too bad, and luckily that's what you're working on. USB Host code (equivalent to a PC that you want to plug devices into) is a lot harder. USB Host software and hardware is very complicated. It takes a lot of code to make it do anything, then more code on top of that to be able to read a USB Memory Stick, then a whole extra lot of code to be able to read and write FAT Filesystem files on those. It takes even more code if the USB port is to support a hub! We shipped a commercial product with USB that had to be stable and reliable, so we bought a USB stack plus USB Memory Device module plus FAT Filesystem module. Even then it took months of work to get all the bugs fixed and get it working reliably.
Tom
Tom, Thank you so much for providing insightful information on this topic. this at least gets me started. I will take a look at using CAN part of AN3690 and USB part of 4.1.1. We won't be doing any processing on messages so it should be relatively simple just to pass it through..