| Electronic Components Datasheet Search |
|
UM0290 Datasheet(PDF) 49 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0290 Datasheet(HTML) 49 Page - STMicroelectronics |
|
49 / 76 page ![]() UM0290 Mass storage demo 49/76 5.3.7 Memory management All the memory management functions are grouped in the two files: memory.c and memory.h. The memory management consists of two basic processes: ● Management and the validation of the address range for the command Read (10) and Write (10): this process is done by the function Address_Management_Test(). The role of this function is to extract the real Address and memory offset in the Medium Memory Area and test if the current transfer (Read or Write) is in the memory range. If this is not the case, the function STALLs endpoint 1 or both endpoints (depending on whether the transfer is Read or Write) and returns a bad status to disable the transfer ● Management of the Read and Write processes: this process is done by the two functions Read_Memory() and Write_Memory(). These two functions manage the medium memory access. After each access, the current memory offset and the next Access Address are updated using the length of the previous transfer. Note: For the STR91x the read and write transfer from/to PMA is managed by the two functions PMA_Read() and PMA_Write() (file usb_rw.c). This two functions are optimized to speed up the transfer of data packets with a size multiple of 32 bits (4 bytes). 5.4 How to customize the mass storage demo The implemented firmware is a simple example used to demonstrate the STR USB IP capability in bulk transfer. However it can be customized according to user requirements. This customization can be done in the three layers of the implemented mass storage protocol: ● Customization of the BOT layer: the user can implement their own BOT state machine or modify the implemented one just by modifying the two files usb_BOT.c and usb_BOT.h and by keeping the same data transfer method. ● Customization of the SCSI layer: the implemented SCSI protocol presents, more than the supported command listed in Section 5.3.6: SCSI protocol implementation, a list of unsupported commands. When the host sends one of these commands, a corresponding function is called by the CBW_Decode() function like a common command. However, all the functions related to an unsupported command are defined by the function SCSI_Invalid_Cmd() , (see file usb_scsi.c). The SCSI_Invalid_Cmd() function STALLs the two endpoints (1 and 2), sets the Sense data to invalid command key and sends a CSW with a Command Failed status. If a user wants to support one of the previous commands they have to comment-out the |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |