Problem SDK, USB MSD and SDCard

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

Problem SDK, USB MSD and SDCard

Jump to solution
928 Views
danielecortella
Contributor V

Hello,

 

i'm trying to use the USB MSD present in the sdk 1.3.0 using PeX in KDS 3.1.0. I have a problem when i want to recieve the data to write in the sdcard, the pointer to the buffer **data recieved by the function msd1_class_specific_callback is always empty. I have attache the file that control the read/write, i use an only buffer (buff) for read and write data. I'm using a kl46,

 

Thanks

Original Attachment has been moved to: msd1_msd.c.zip

Labels (1)
Tags (3)
1 Solution
650 Views
danielecortella
Contributor V

Dear Iva,

i have change some things and now it work. I attach the code.

Thanks for the support.

Daniele

Il 26/01/2016 15:05, ivadorazinova ha scritto:

>

NXP Community

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h0/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bSk7biXppOJQp1dqtdr-2FhoAX2U1vqcC2pV4zamTmO-2B2Aw-3D-3D>

>

Problem SDK, USB MSD and SDCard

risposta da Iva Dorazinova

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h1/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bTV2H6l88qkV2k9D4HQo1uUWCFUeozZRGYbPu5sDFrZDsGKUic9H-2BaheNxdnhWEhJU-3D>

su /Kinetis Software Development Kit/ - Visualizza la discussione

completa

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h2/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bR7fjOPE7uCh3iq4QU1CqY6-2FVlGt39EEn5SakuDIbXWu3zBQpgiBC5dslyxwkGPEf0-3D>

>

View solution in original post

7 Replies
650 Views
ivadorazinova
NXP Employee
NXP Employee

Hi Daniele.

I consulted your issue with Application Team and here is the explanation.

The “the buffer **data”  in USB_DEV_EVENT_DATA_RECEIVED case is meaningless, the lba_data_ptr structure has already contains all the information to write data to SD Card ,you don’t need  the code“*data = &buff[0]”.

When the code run to USB_DEV_EVENT_DATA_RECEIVED case, it means the application has already get the data from host pc and the data information has already be stored in lba_data_ptr structure by the usb stack.  lba_data_ptr->buff_ptr is the buffer containing the data from host,  lba_data_ptr->offset is the address host want to write , lba_data_ptr->size  is the data size.

         

It will be good for you to review the USB MSD example, located under C:\Freescale\KSDK_1.3.0\examples\frdmkl46z\demo_apps\usb\device\msd and set  the  following macro.

#define RAM_DISK_APP                        (0)

#define SD_CARD_APP                         (1)

then the example will support USB SDCard.

        

In case of any issue, please let us know.

Best Regards,

Iva

0 Kudos
650 Views
danielecortella
Contributor V

Dear Iva,

thanks for the reply but i didn't solve the problem. I use the processor

expert for my system with the MSD sdk 1.3.0 library so the code is

different from the code in the sample. I dont understand this point:

-in USB_MSC_DEVICE_WRITE_REQUEST what i have to do?

-in USB_DEV_EVENT_DATA_RECEIVED i have only to write the data, that

i do with the function disk_read(0, lba_data_ptr->buff_ptr, sector, 1);

i have only the buffer extern byte buff[512] where i put the data to

write or read. The code is attached.

Thanks

Daniele

*

Il 25/01/2016 21:13, ivadorazinova ha scritto:

>

NXP Community

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u4/iDNfafmCQweXKSdHxVkhcg/h0/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bSk7biXppOJQp1dqtdr-2FhoAX2U1vqcC2pV4zamTmO-2B2Aw-3D-3D>

>

Problem SDK, USB MSD and SDCard

risposta da Iva Dorazinova

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u4/iDNfafmCQweXKSdHxVkhcg/h1/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bTV2H6l88qkV2k9D4HQo1uUWCFUeozZRGYbPu5sDFrZDsGKUic9H-2BaheNxdnhWEhJU-3D>

su /Kinetis Software Development Kit/ - Visualizza la discussione

completa

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u4/iDNfafmCQweXKSdHxVkhcg/h2/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bRer5oLYyMIYvTEB-2B6t8hyHDZ7c791s-2B23Zws1cqk2xt3owyPujiTwd2USKMbne2cY-3D>

>

0 Kudos
650 Views
ivadorazinova
NXP Employee
NXP Employee

Hi Daniele,

please can you attach whole project?

Thank you,

Iva

0 Kudos
651 Views
danielecortella
Contributor V

Dear Iva,

i have change some things and now it work. I attach the code.

Thanks for the support.

Daniele

Il 26/01/2016 15:05, ivadorazinova ha scritto:

>

NXP Community

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h0/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bSk7biXppOJQp1dqtdr-2FhoAX2U1vqcC2pV4zamTmO-2B2Aw-3D-3D>

>

Problem SDK, USB MSD and SDCard

risposta da Iva Dorazinova

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h1/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bTV2H6l88qkV2k9D4HQo1uUWCFUeozZRGYbPu5sDFrZDsGKUic9H-2BaheNxdnhWEhJU-3D>

su /Kinetis Software Development Kit/ - Visualizza la discussione

completa

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h2/eqhG5v9o4WV1pCmWaB03cUjBPgRj-2F3GoJUaXSZ409bR7fjOPE7uCh3iq4QU1CqY6-2FVlGt39EEn5SakuDIbXWu3zBQpgiBC5dslyxwkGPEf0-3D>

>

650 Views
danielecortella
Contributor V

Hi,

yes is attached. The firmware use a lot of component and in source

folder you can find the file msd

Daniele

Il 26/01/2016 15:05, ivadorazinova ha scritto:

>

  NXP Community

  <http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h0/eqhG5v9o4WV1pCmWaB0...>

>

    Problem SDK, USB MSD and SDCard

risposta da Iva Dorazinova

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h1/eqhG5v9o4WV1pCmWaB0...>

su /Kinetis Software Development Kit/ - Visualizza la discussione

completa

<http://jiveon.jivesoftware.com/mpss/c/9AA/PDcDAA/t.1u5/rymlCSezQ9ao8ArsfzvQDA/h2/eqhG5v9o4WV1pCmWaB0...>

>

0 Kudos
650 Views
danielecortella
Contributor V

Noone? i can read the sdcard without problem but can't write....

Thanks

0 Kudos
650 Views
ivadorazinova
NXP Employee
NXP Employee

Hi Daniele,

I´m just working on your issue. I will let you know as soon as possible.

Thank you for your patience,

Best Regards,

Iva

0 Kudos