STM32F1 SDIO

Started by tha, March 09, 2022, 08:34:02 AM

Previous topic - Next topic

tha

22 Secure digital input/output interface (SDIO)

Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx
microcontrollers ที่ the Flash memory density ย่านระหว่าง 16 and 32 Kbytes.

Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx
microcontrollers ที่ the Flash memory density ย่านระหว่าง 64 and 128 Kbytes.

High-density devices are STM32F101xx and STM32F103xx microcontrollers ที่ the
Flash memory density ย่านระหว่าง 256 and 512 Kbytes.

XL-density devices are STM32F101xx and STM32F103xx microcontrollers ที่ the
Flash memory density ย่านระหว่าง 768 Kbytes and 1 Mbyte.

Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.

ส่วนนี้ประยุกต์ใช้กับ high-density and XL-density performance line devices เท่านั้น.

tha

22.1 SDIO main features

The SD/SDIO MMC card host interface (SDIO) จัดให้มี an interface ระหว่าง the AHB peripheral bus และ MultiMediaCards (MMCs), SD memory cards, SDIO cards and CE-ATA devices.

The MultiMediaCard system specifications มีให้ใช้ประโยชน์ผ่านทาง the MultiMediaCard Association website ที่ www.mmca.org, จัดพิมพ์โดย the MMCA technical committee.

SD memory card and SD I/O card system specifications มีให้ใช้ประโยชน์ผ่านทาง the SD card Association website ที่ www.sdcard.org.

CE-ATA system specifications มีให้ใช้ประโยชน์ผ่านทาง the CE-ATA workgroup website ที่ www.ce-ata.org.

คุณสมบัติของ SDIO มีดังต่อไปนี้ :
•    เป็นไปตามอย่างสมบูรณ์กับ MultiMediaCard System Specification Version 4.2. Card รองรับสำหรับ three different
      databus modes: 1-bit (default), 4-bit and 8-bit
•    เข้ากันได้อย่างสมบูรณ์กับเวอร์ชั่นก่อนหน้าของ MultiMediaCards (ความเข้ากันได้แบบไปข้างหน้า)
•    เป็นไปตามอย่างสมบูรณ์กับ SD Memory Card Specifications Version 2.0
•    เป็นไปตามอย่างสมบูรณ์กับ SD I/O Card Specification Version 2.0: card รองรับสำหรับ two different databus modes: 1-
      bit (default) and 4-bit
•    การรองรับอย่างสมบูรณ์ของ the CE-ATA features (เป็นไปตามอย่างสมบูรณ์กับ CE-ATA digital protocol Rev1.1)
•    Data transfer สูงถึง 48 MHz สำหรับ the 8 bit mode
•    Data และ command output enable signals เพื่อควบคุม external bidirectional drivers.

Note: The SDIO ไม่มี an SPI-compatible communication mode.

The SD memory card protocol เป็น a superset ของ the MultiMediaCard protocol ตามที่กำหนดใน the MultiMediaCard system specification V2.11. หลายคำสั่งที่ต้องการสำหรับ SD memory devices ไม่ถูกรองรับโดยอย่างใดอย่างหนึ่ง SD I/O-only cards หรือ the I/O portion ของ combo cards. บางส่วนของคำสั่งเหล่านี้ไม่ได้ใช้ใน SD I/O devices, อย่างเช่น erase commands, และดังนั้นไม่ถูกรองรับใน the SDIO. นอกจากนี้, หลายคำสั่งที่แตกต่างกันระหว่าง SD memory cards และ SD I/O cards และดังนั้นไม่ถูกรองรับใน the SDIO. สำหรับรายละเอียดอ้างอิงถึง SD I/O card Specification Version 1.0. CE-ATA ถูกรองรับครอบคลุม the MMC electrical interface โดยใช้ a protocol ที่ใช้ the existing MMC access primitives. The interface electrical and signaling definition เป็นไปตามที่กำหนดใน the MMC reference.


The MultiMediaCard/SD bus เชื่อมต่อ cards เข้ากับ the controller.

เวอร์ชั่นปัจจุบันของ the SDIO รองรับ SD/SDIO/MMC4.2 card ได้ครั้งละหนึ่งการ์ดเท่านั้นและสแตกค์เดียวของ MMC4.1 หรือก่อนหน้า.

tha

22.2 SDIO bus topology

Communication ผ่าน the bus จะขึ้นอยู่กับ command and data transfers.

การติดต่อกันพื้นฐานบน the MultiMediaCard/SD/SD I/O bus คือ the command/response transaction. ชนิดเหล่านี้ของ bus transaction ส่งถ่าย information ของพวกมันโดยตรงภายใน the command หรือ response structure. นอกจากนี้ การดำเนินการบางอย่างมี a data token.

Data transfers ถึง/จาก SD/SDIO memory cards ถูกทำใน data blocks. Data transfers ถึง/จาก MMC ถูกทำใน data blocks หรือ streams. Data transfers ถึง/จาก the CE-ATA Devices ถูกทำใน data blocks.




Note: The SDIO จะไม่ส่ง data ใดๆตราบเท่าที่ the Busy signal ถูกยืนยัน(ถือสิทธิ์) (SDIO_D0 pulled low).




tha

22.3 SDIO functional description

The SDIO ประกอบด้วยสองส่วน:
•      The SDIO adapter block จัดให้มีฟังชั่นทั้งหมดเฉพาะกับ the MMC/SD/SD I/O card อย่างเช่น the clock generation unit,
        command and data transfer.
•      The AHB interface เข้าถึง the SDIO adapter registers, และสร้าง interrupt และ DMA request signals.



โดยค่าเริ่มต้น SDIO_D0 ถูกใช้สำหรับ data transfer. หลังจากเริ่มต้น, the host สามารถเปลี่ยน the databus width.

ถ้า a MultiMediaCard ถูกเชื่อมต่อถึง the bus, SDIO_D0, SDIO_D[3:0] or SDIO_D[7:0] สามารถถูกใช้สำหรับ data transfer. MMC V3.31 หรือก่อนหน้า, รองรับเพียง 1 bit ของ data ดังนั้นมีเพียง SDIO_D0 สามารถถูกใช้.

ถ้า an SD or SD I/O card ถูกเชื่อมต่อถึง the bus, data transfer สามารถถูกกำหนดค่าโดย the host เพื่อใช้ SDIO_D0 or SDIO_D[3:0]. data lines ทั้งหมดจะทำงานใน push-pull mode.

SDIO_CMD มีสอง operational modes:
•      Open-drain สำหรับการเริ่มต้น (เฉพาะสำหรับ MMCV3.31 หรือก่อนหน้า)
•      Push-pull สำหรับ command transfer (SD/SD I/O card MMC4.2 ใช้ push-pull drivers ด้วยสำหรับการเริ่มต้น)

SDIO_CK คือ the clock ไปยัง the card: one bit ถูกส่งถ่ายบนทั้ง command and data lines ด้วยแต่ละ clock cycle. The clock frequency สามารถเปลี่ยนแปลงได้ระหว่าง 0 MHz and 20 MHz (สำหรับ a MultiMediaCard V3.31), ระหว่าง 0 and 48 MHz สำหรับ a MultiMediaCard V4.0/4.2, หรือระหว่าง 0 and 25 MHz (สำหรับ an SD/SD I/O card).

The SDIO ใช้สอง clock signals:
•      SDIO adapter clock (SDIOCLK = HCLK)
•      AHB bus clock (HCLK/2)

PCLK2 and SDIO_CK clock frequencies ต้องเป็นไปตามเงื่อนไขต่อไปนี้:



The signals ที่แสดงใน Table 137 ถูกใช้บน the MultiMediaCard/SD/SD I/O card bus.


tha

22.3.1 SDIO adapter

Figure 213 แสดง a simplified block diagram ของ an SDIO adapter.



The SDIO adapter คือ a multimedia/secure digital memory card bus master ที่จัดให้มี an interface ไปยัง a multimedia card stack หรือไปยัง a secure digital memory card. มันประกอบด้วยห้าหน่วยย่อย:

•      Adapter register block
•      Control unit
•      Command path
•      Data path
•      Data FIFO

Note: The adapter registers and FIFO ใช้ the AHB bus clock domain (HCLK/2). The control unit, command path and data path ใช้ the SDIO adapter clock domain (SDIOCLK).

tha

Adapter register block

The adapter register block บรรจุ system registers ทั้งหมด. block นี้สร้าง the signals ที่เคลียร์ the static flags ใน the multimedia card ด้วย. The clear signals ถูกสร้างเมื่อ 1 ถูกเขียนลงในตำแหน่งบิตที่ตรงกันใน the SDIO Clear register.

tha

Control unit

The control unit บรรจุ the power management functions และ the clock divider สำหรับ the memory card clock.

มีสาม power phases:
•     power-off
•     power-up
•     power-on



The control unit ถูกแสดงใน Figure 214. มันประกอบด้วย a power management sub-unit และ a clock management sub-unit.

The power management subunit จะปิดการใช้งาน the card bus output signals ในระหว่าง the power-off และ power-up phases.

The clock management subunit สร้างและควบคุม the SDIO_CK signal. The SDIO_CK output สามารถใช้อย่างใดอย่างหนึ่ง the clock divide หรือ the clock bypass mode. The clock output จะไม่ทำงานเมื่อ:

•     หลังจาก reset
•     ในระหว่าง the power-off หรือ power-up phases
•     ถ้า the power saving mode ถูกเปิดการใช้งานและ the card bus อยู่ใน the Idle state (แปด clock periods หลังจากทั้ง the
       command และ data path subunits เข้าสู่ the Idle phase)

tha

Command path

The command path unit ส่ง commands ไปยังและรับ responses จาก the cards.



•     Command path state machine (CPSM)
       –   เมื่อ the command register ถูกเขียนถึงและ the enable bit ถูกเซ็ต, command transfer จะสตาร์ท. เมื่อ the
            command ถูกส่งแล้ว, the command path state machine (CPSM) จะเซ็ต the status flags และเข้าสู่ the Idle state
            ถ้า a response ไม่ถูกต้องการ. ถ้า a response ถูกต้องการ, มันจะรอสำหรับ the response (ดู Figure 216). เมื่อ the
            response ถูกรับ, the received CRC code และ the internally generated code จะถูกเปรียบเทียบกัน, และ the
            appropriate status flags จะถูกเซ็ต.