MCF51JM USB (CDC) and Processor Expert.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF51JM USB (CDC) and Processor Expert.

Jump to solution
1,733 Views
TurboBob
Contributor IV

Hello all,

 

I have an existing project,  built with the MCF51JM part,  and it functions quite well.  I am at the point of adding additional features,  and the JM part was originally chosen so that the USB could be "easily" added.

 

The project is built in Codewarrior 6.3 with Processor Expert.  Many of PE's features work extremely well,  and I have grown accustomed to using it.  It is the main reason I stick with Freescale's parts.

 

Integrating the CDC class "should" be a straightforward task.  put the required files in an appropriate spot,  and add them to the project.  add a few "include" lines and then call the functions. 

 

All of the USB app notes,  sample code, etc are all built around the non-PE environment.   So lots of 'manipulations' of the files becomes necessary.

 Well,  after searching around for all the stuff in target.c  target.h, and the low-level assembler stuff that the USB functions seem to want,  and modifying the code as required,  I can get it to compile with no errors (there were several warnings, however)

 

Simple,  right?    Not so much.  PE takes control of the interrupt vectors.   So,  I add an interrupt vector bean,  and call the USB interrupt function from there.  Ok,  fine.  it all compiles,  and the init calls seem to return without error,  the software is executing.

 

Great?   Nope.  The usb init functions have shut off all the peripherals that Processor Expert initializes.  I can move the USB init to before the PE_Init,  or after.  The timers are not running.

 

Sure I can dig thru it all,  and figure out how to "patch" this "proven code",  but this is getting old fast. 

 

Do I really have to pay big bucks for the PE 'Bean' just so I can spit data out the USB? 

 

Sorry for the tirade,  its been a long afternoon.   Has anyone sucessfully made the CDC class easily integrated into PE based projects?

 

Thanks for listening.

 

Bob Bailey

Labels (1)
Tags (1)
0 Kudos
1 Solution
1,197 Views
BlackNight
NXP Employee
NXP Employee
0 Kudos
8 Replies
1,197 Views
ProcessorExpert
Senior Contributor III

Hello,

 

we are sorry for inconvenience but PEx does not offer any USB solution for CodlFireV1 now. However as far as I know that MQX provides usb solution for CFV1. For details please see: www.freescale.com/mqx

 

In PEx there is currently available USB_LDD component for low level acces to device on Kinetis family. The USB stack for Kinetis would be ready till end of this year.

 

I have also passed your request to our management.

 

best regards
Vojtech Filip
Processor Expert Support Team

 

 

0 Kudos
1,197 Views
ProcessorExpert
Senior Contributor III

Hello,

 

even though PEx does not provide a built in solution, I have just found that there is available 3rd party party component, for more details please follow the links below:

 

http://www.steinerberg.com/EmbeddedComponents/home.htm

http://www.steinerberg.com/EmbeddedComponents/FSL_USB_Stack/home.htm

 

best regards
Vojtech Filip
Processor Expert Support Team

0 Kudos
1,198 Views
BlackNight
NXP Employee
NXP Employee

Hello,

there is an article available on

http://mcuoneclipse.wordpress.com/2012/03/10/usb-or-not-cdc-with-processor-expert/

 

The examples for it (two MCU10.2 and one MCU 6.4) are available on

http://www.steinerberg.com/EmbeddedComponents/Examples/Example_PE_CDC_V1JM128

 

BK

0 Kudos
1,197 Views
TurboBob
Contributor IV

Many huge thanks to BlackKnight for your assistance on this.

 

I have integrated the component into my project.  I found a couple dependency issues,  and tweaked the demo code a bit,  and its working properly.  I have some questions regarding error handling if I feed the send routine too fast,  but if I pace the data it runs without issue.  I'll send you an email on these as they are not specific to the component.

 

I want to try the HCS08 version,  as I had similar pain integrating the CMX generic HID drivers about 2 years ago.  Bugs and incomplete documentation were rampant in that code.

 

Again,  many thanks!!!

 

Bob

 

0 Kudos
1,197 Views
BlackNight
NXP Employee
NXP Employee

You are very welcome.

I have an updated version in the works which is much easier to use:

- it generates the cdc.inf (unified version for 64bit and 32bit hosts)

- configuration of the PID/VID and other settings of the USB driver

- using the USB_Init as inherited component (solving the dependency problem and does not require any user changes with Processor Expert templates)

 

I want to try it out for the S08JM60 as well, and once it works, I'll post a new version.

 

BK

 

0 Kudos
1,197 Views
BlackNight
NXP Employee
NXP Employee

Hello,

the new component is now available:

http://mcuoneclipse.wordpress.com/2012/03/15/usb-cdc-reloaded/

 

It supports unified .inf file generation, PID/VID settings, and uses USB_Init as inherited component.

Additionally it runs on S08JM60.

 

BK

0 Kudos
1,197 Views
TurboBob
Contributor IV

Thanks for creating this for us mortals......

 

Bob

0 Kudos
1,197 Views
BlackNight
NXP Employee
NXP Employee

FYI: I have found a problem with the FSL USB Stack and CDC with sending either exactly 16 or 32 bytes (all other sizes were working fine so far). The solution was to send a dummy block.

 

Solution is described here:

http://mcuoneclipse.wordpress.com/2012/04/17/fsl_usb_stack-updated-sending-16-or-32-byte-blocks/

 

I passed that to the group maintaining the stack. Until there is another fix, the above workaround works well for me.

 

BK

0 Kudos