where did i find the read and write buffer in the msc example code

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
vepe_4473991
Level 1
Level 1

where did i find the read and write buffer in the msc example code.please let me know the buffer

0 Likes
1 Solution

Hello,

The data transfer does take place through the DMA channel where the data from the host is directly sent to the DMA buffers over the UIB socket but there is no buffer pointer to these buffer and they are handled according to the CBW command which is the first packet that is sent from the host.

The CBW is a 31-Byte packet in which the direction (read or write), transfer length, start address in the SD card and the number of blocks of data that needs to be written to the SD card are specified.


Based on the direction and the transfer length, SD card is initialized.

If the direction is a read operation, the specified length of data is picked from the start address specified and filled into the DMA buffers. But there's no buffer pointer to these buffers as all of this is taken care by the MSC class driver. The buffers are then directly committed to the host and a CSW packet is sent which tells that the data has been received by the host.

In the same way. write transactions also take place:

- Send 31-Byte CBW

- Send the specified length of data and wait for its completion

- Send CSW to check if the data was received

The usage of MSC driver doesn't give room to perform any vendor specific operations as everything is controlled by that driver.

And that's the reason why there's no provision to find the read and write in msc_example.


Regards,Yashwant

View solution in original post

0 Likes
3 Replies
YashwantK_46
Moderator
Moderator
Moderator
100 solutions authored 50 solutions authored 50 likes received

Hi,

There's no provision to see the read and write buffers in the MSC firmware.


Regards,

Yashwant

0 Likes

but how they are going to transfer the data too and from memory to host and host to memory. is it not possible. i need to find it. suggest me any procedure.

thanks for your reply

0 Likes

Hello,

The data transfer does take place through the DMA channel where the data from the host is directly sent to the DMA buffers over the UIB socket but there is no buffer pointer to these buffer and they are handled according to the CBW command which is the first packet that is sent from the host.

The CBW is a 31-Byte packet in which the direction (read or write), transfer length, start address in the SD card and the number of blocks of data that needs to be written to the SD card are specified.


Based on the direction and the transfer length, SD card is initialized.

If the direction is a read operation, the specified length of data is picked from the start address specified and filled into the DMA buffers. But there's no buffer pointer to these buffers as all of this is taken care by the MSC class driver. The buffers are then directly committed to the host and a CSW packet is sent which tells that the data has been received by the host.

In the same way. write transactions also take place:

- Send 31-Byte CBW

- Send the specified length of data and wait for its completion

- Send CSW to check if the data was received

The usage of MSC driver doesn't give room to perform any vendor specific operations as everything is controlled by that driver.

And that's the reason why there's no provision to find the read and write in msc_example.


Regards,Yashwant

0 Likes