DEMOJM Kit With MCF51JM128

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

DEMOJM Kit With MCF51JM128

4,849 Views
JMAC
Contributor I

Hello everyone.

I have been playing with a DEMOJM kit and the CMX USB stack. Everything in the kit seems to be functioning fine, and all labs work per the documentation.  However, one of the labs on mass storage is not very clear so I have some questions.  Lab #5 with the MCF51JM128 allows you to plug in a USB thumbdrive and read data files from it, but the documentation is extremely poor.  Is it possible to also actually use the terminal window to also send info to the thumbdrive?  If so, I cannot figure it out.  I can easily put text files on the thumbdrive using a text editor in Windows, and then dump them to the terminal window, but I can't seem to send anything to the thumbdrive through the terminal window (in fact, calling "help" only shows two limited "dump" commands that can even be used.)  So I'm confused.  How is this a mass "storage" demo?  Its more like a file reader from a storage device.  I believe the CMX demo is written for host mode operation, but there is no CMX project file written for OTG operation with mass storage - which could be the problem (unless its hidden somewhere.)  What am I missing?  Has anyone been playing with this USB thumbdrive demo board?

 

Thanks everyone.    

Labels (1)
0 Kudos
15 Replies

1,711 Views
BlackNight
NXP Employee
NXP Employee

Hello,

If I understand it right, then you want to write from your terminal window (say on a windows host) to the serial port of the DEMOJM and write the text to the mass storage device?

For this you would have to use the SCI/Serial port on the JM128, and redirect what you get from the terminal to the mass storage device.

I did not play with the Lab5 (Host-Mass-Storage Class) as I have problems getting it to run, but I would assume that you would have to change the terminal portion with additional commands to redirect the output to the drive?

 

BK

0 Kudos

1,711 Views
JMAC
Contributor I

Hello BK.

First, I guess I'm trying to figure out what the purpose of the lab even is.

 

Presently, you can open up a terminal window to the USB channel that the demo board is connected to. The DEMOJM is only connected to your PC by this single USB cable.  The DEMO JM will respond to 3 commands from this USB terminal window, so its using the CMX stack to communicate with you over the USB channel.  Now, you can use two of the recognized commands to either dump a text file or a binary file from the USB thumbdrive (thumbdrive is plugged into DEMOJM) to the terminal window.  So basically, I can read anything on the thumbdrive plugged into my DEMOJM - through the USB comm channel.  So why can't the DEMOJM use this same USB connection for receiving and storing data on the drive?  Its only reading the drive and sending data back to me.  Its not taking data and storing it (there is no built-in command shown for that.)  In any case, there is no other info presented about additional connections in the lab.  Its written very oddly.  Are you aware of some clearer information on this lab?

 

I did get the actual lab to run fine, but the way its written, it doesn't seem like someone had time to really finish it.  It just ends with "type help to see commands."  When you do that, you realize quickly that there are only commands for reading the drive - not writing to it.

 

Thanks much for your help,

Jon 

0 Kudos

1,711 Views
BlackNight
NXP Employee
NXP Employee

Hello Jon,

I think the lab demos are really only a starting point and have at least *something* up and running (well, for me even this did not work all the time).

Here is what I see what you can do:

Take the code of the actual lab and enhance the SCI (serial) portion of it on the MCF51JM128. So e.g.  looking at the 'dump' command and create a 'write' command which reads from the terminal and writes to the disk. Not sure if there is already support for basic writing (this means you would need some kind of basic file system). I did not check details in the actual lab.

 

I made a different thing: using the MCF51JM128 in host mode and attaching a keyboard or mouse to it (well, I want to use it as a bar code scanner, which acts as a keyboard).

I had a hard time to use the CMX stack, as I'm not a USB specialist. But after fixing some bugs in the CMX code (time sensitive parts) I have at least something working. And I'm using the serial link for uppassing the scanner information and to write down information to the MCF51 (this is similar what you need to do).

To simplify things a little bit, I was using consequently Processor Expert, and as such I even ported the CMX stack into a Processor Expert bean). But I did not run it as disk (I'm using a SD card with FAT32 file system).

 

Hope this may help,

BK

0 Kudos

1,711 Views
DMV
Contributor I

Hi,

 

Attached is a modified and working CMX stack with Read Write and other commands.

 

If you need help with Freescale Development drop me an email.

  

Some of our recent work..
Ag Controller
Complete solution, electronics, firmware, software, manuals etc.
http://www.advancedagsystems.com/index-3.html

 

GeoReferenced Soundscape
Complete Software and Hardware Solution
http://dmvdesigns.is-a-geek.com/products/soundscapes/
 
 Robotics Development
 Complete PID Servo Firmware, hardware & mechanical solution and desktop application development
 http://www.youtube.com/watch?v=8_awTlVHUYg

David Veerman

david@designfeats.com

www.designfeats.com

 

 Attachments:

DemoJM USB MSD.zip 512 KB

Designfeats.pdf 387 KB

0 Kudos

1,711 Views
DesignFeats
Contributor I
Use Freescales Usb Stack Freescale_USB_FATFS_v1.0_Installer.exe and Freescale_USB_Stack_with_PHDC_v3.0_Installer.exe David Veerman david@designfeats.com www.designfeats.com
0 Kudos

1,711 Views
DesignFeats
Contributor I

Hi,

The baremetal stack, called “Freescale USB Stack with PHDC support, v3.0 includes a wrapper to integrate with FatFS. This does not work with alot of usb drives, seeems to be same with MQX stack.  See: https://community.freescale.com/message/54501#54501

 

Modifications to stack are required to make USB stack with PHDC work, see https://community.freescale.com/message/90468#90468

 

Has anyone had any success with modification of Freescale's stack??

 

 

Working CMX Stack

DemoJM USB MSD.zip 512 KB

Note: the CMX stack attached is tricky to work with! 

The freescale stack is a dream to implement, it just dont work.

 

 

 

 

 

Note:Changed from user 'DMV' to 'DesignFeats' and cannot edit post above, fixed links.

Some of our recent work..
Ag Controller
Complete solution, electronics, firmware, software, manuals etc.

http://www.designfeats.com/?portfolio=ag-controller

 

GeoReferenced Soundscape
Complete Software and Hardware Solution

http://www.designfeats.com/?portfolio=georeferenced-soundscape


 Robotics Development
Complete PID Servo Firmware, hardware & mechanical solution and desktop application development

http://www.designfeats.com/?portfolio=robotics-development

 

 

0 Kudos

1,711 Views
JCRib
Contributor II

Hello,

 

Can you tell me how big is the CMX USB Lite stack (host mass storage only) footprint?

 

 

Thank you

 

 

0 Kudos

1,711 Views
DesignFeats
Contributor I

Hi,

The CMX Stack Size is not a simple answer.

 

The DEMOJM MSD Host.mcd application attached prior generates

 mass-storage.abs.S19 uses 34k (34408) ROM and 3k (3158)RAM

This application also has serial terminal and heaps of diagnostics stuff, so it can be trimmed down.

Biggest problem with CMX are

  •   No source, compiled .lib file
  •   complex linker lcf file configuration
  •   blocking calls
  •   compatability/reliability with the cmx demo stack

 

 

I suggest you look at the new version 3.1.1 of Freescale USB Stack released.

The stack includes the full source

Fs Usb Stack v3.1.1

 

2 What is New?

This section describes the major changes and new features implemented in this maintenance release.

• Asynchronous feedback support in the Kinetis audio devices, as defined in USB 2.0 section 5.12.4.2

• HC(S)08 applications optimizations:

o Optimized the standard request functions

o Decreased ram usage o Interrupt processing time was reduced by shifting processing outside the interrupt context.

• Bugfixes

o USB Command verifier tests fixes

o MSD class demo applications fixes

o MSD & HID classes OTG application fixes

 

David

david@designfeats.com

 

 

0 Kudos

1,711 Views
JCRib
Contributor II

Dear David,

 

Thank you for your reply. 

Do you think I can use MCF51JM32 and implement the MSD Host using the Freescale USB Stack or should I use the MCF51JM64?

 

Jose

0 Kudos

1,711 Views
DesignFeats
Contributor I

Hi,

 

Use the 64k version as its too tight with the 32k.  (CMX MSD above is at 34k), the Fs MSD is smaller but may take a while to get going?

 

So if it is a simple job use the cmx project and a JM64 attached prior.

 

The code for the Fs Usb stack is very confusing as it targets so many processors, it may take you awhile to untangle and extract only the required source for little benefit?

 

Regards

David

0 Kudos

1,712 Views
JCRib
Contributor II

Hello,

 

I'm testing the MSD demo with CMX USB stack posted in this thread.

The firmware was uploaded to the DEMOJM board and is running ok. I can confirm it using breakpoints.

The serial interface is configured as default 9600,n,8,1 both in firmware and PEMicro Terminal utility. I selected USB COM (for virtual serial port).

Jumper 4 is 1-2, 3-4 as described on DEMOJM Lab supplement for JM128.

 

Problem:

Terminal window never shows data from "prints"

 

 

What am I doing wrong?

 

 

Best regards,

 

Jose

0 Kudos

1,712 Views
DesignFeats
Contributor I
Jose
You need to swap over com ports, I changed it over as first one in my demojm failed

Let me know if that fixes it

David@designfeats.com
0 Kudos

1,710 Views
JCRib
Contributor II

That's it David!

 

Many thanks!

0 Kudos

1,712 Views
DesignFeats
Contributor I
USB Stack (No Os) Version 3.2 was released on the 15 March 12 http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MEDICALUSB&fr=g Its seems to work..still testing note: earlier ones have bugs with lockup, memory leak and msd compatibility issues David david@designfeats.com
0 Kudos

1,712 Views
BlackNight
NXP Employee
NXP Employee

Hello,

there is a Processor Expert project available for the FLS USB stack (see http://mcuoneclipse.wordpress.com/2012/03/10/usb-or-not-cdc-with-processor-expert/) and for the CDC class.

 

Projects are on http://www.steinerberg.com/EmbeddedComponents/Examples/Example_PE_CDC_V1JM128.

You will need to install at least two components. An all-in-one package can be downloaded here:

http://www.steinerberg.com/EmbeddedComponents/EmbeddedComponents_v1.2.zip

 

One note of caution: the FSL USB stack works ok for lower serial/CDC traffic. I (and others) faced problems trying to send large amount of data.

 

Hope this helps,

BK

 

0 Kudos