Mass Storage Device using the MCF51JM128

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

Mass Storage Device using the MCF51JM128

1,712 Views
Fasteddie042
Contributor I
Hello all,

I am trying to port the sd card reader code from DRM104-3 to a MCF51JM128 micro controller.  I have been able to successfully port one of the other examples which utilze the CDC port as well as implementing FAT16 and SD card comunication. I am having a great deal of difficulty with another example that allows the card reader to be used as a mass storage device.   
I was wondering if there is some similar code like the one from this app note.   I have tried to use portions of the canyourbadgedothis code but have had little success.  If anyone can point me in the right direction or if there is some source code that is a little more straightforward that would be great.

Thanks!


Labels (1)
0 Kudos
3 Replies

412 Views
Fasteddie042
Contributor I

Well I have some updates,   I have changed all the variables to the equivalent V1 variables as well as attempting to initialize the BDT tables.   The device does not successfuly enumerate, infact it does not even successfuly transmit its Device descriptor. 

   I am using USBTrace to monitor the packets between the PC and device and so far it does not enumerate properly. It keeps trying to enumerate but the packets seem to be empty.

 

I am certain that it is a code issue since I have been able to get other USB configurations to work using the same hardware. 

 

Is there anything specific that has to be configured with the MCF51JM128 USB module that is not needed in the PC9S08JM60?

0 Kudos

412 Views
RichTestardi
Senior Contributor II

If I understand correctly, you are trying to write a USB mass storage *device* that runs on the 51JM128?

 

I have source code for my USB host and device driver here if it helps: http://www.cpustick.com/downloads/skeleton.zip  (Please note that there is a bug in the 51JM128 *host* driver in that archive that I have fixed; I attached my latest usb.c to this post if you need that, but in general it is safest to use files from the zip as they have been more fully tested.)

 

The only really 51JM128 specific code I needed was related to pull-up management and peripheral reset/power-on (the zip archive has a power-on bug in host mode).  Oh, and I renamed all of the 51JM128 register names to match those of the CFV2. 

 

Are you receiving a USB "reset" interrupt when the host tries to enumerate you?  Is your BDT properly 512 byte aligned?  Are you communicating with the SIE in "little endian" (i.e., byte swapped) mode?

 

-- Rich

rich@testardi.com

0 Kudos

412 Views
Fasteddie042
Contributor I

Rich,

 

that is quite a piece of code, I have been able to get a bit more help from Freescale and the device finally enumerates, the device is not passing the correct information back  but at least it is a start.  I will chew through a bit more of this and let you know how it all goes!

 

Thanks for the post!

 

 

0 Kudos