2016-01-24 10:04 AM
Dear Community,
while experimenting with CLIVES SDcard to USB example [1] I checked the dataflow inside the function: int8_t STORAGE_Read to understand what data are necessary to make a mass storage device (e.g. from a paper tape reader). However my investigation stopped since I cannot figure out how e.g. an ASCII text- file is read – I just see that the first symbol is read while the notepad (WIN7) shows the entire content.
SD_Read Addr: 00000288 //dec
Len: 1
Content: 99 c 63 b01100011
It is true – the first symbol inside the text file is really a “c�? however where are the remaining symbols ? (By the way I also didn’t observed inside the dataflow how the directory data was transferred)
I would be very happy if someone could point me where the remaining data are transferred.
[1] (https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https%3a%2f%2fmy%2est%2ecom%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM32Discovery%2fSTM32F4-Discovery%20USB%20Mass%20storage&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=9633)
2016-01-24 10:30 AM
Files are just collections of bytes, you can read them one at a time, or as a group or block.
2016-01-24 2:13 PM
Dear Clive,
thankyou for responding. Actually I didn't read the docu of ''int8_t STORAGE_Read''
before I copied and pasted it without docu:/**
* @brief Read data from the medium
* @param lun : logical unit number
* @param buf : Pointer to the buffer to save data
* @param blk_addr : address of 1st block to be read
* @param blk_len : nmber of blocks to be read
* @retval Status
*/
Its actually a bulk of 512 bytes which is read by the function. After looking each time on the 512 bytes I can probably see all necessary content – previously I just observed the first byte. Now I also see how the entire content of each file is read from the SD card.
I will try get the suggested literature.