STM32F1 SDIO

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

Previous topic - Next topic

tha

6.   The active cards ส่งพร้อมกัน their CID numbers แบบอนุกรม. Cards ที่มี outgoing CID bits ที่ไม่ตรงกับ the bits บน the
      command line จะหยุดการส่งและต้องรอสำหรับ the next identification cycle. เมื่อ card ส่งเสร็จ a full CID ไปยัง the SDIO
      card host และเข้าสู่ the Identification state
7.   The SDIO card host ปล่อยออก SET_RELATIVE_ADDR (CMD3) ไปยัง card นั้น. address ใหม่นี้ถูกเรียกว่า the relative card
      address (RCA); มันสั้นกว่า the CID และแอดเดรส the card. The assigned card เปลี่ยนไปยัง the Standby state, มันจะไม่
      ตอบสนองต่อ identification cycles ต่อไป, และ output ของมันจะสวิทช์จาก open-drain ไปเป็น push-pull.
8.   The SDIO card host ทำซ้ำขั้นตอน 5 ถึง 7 จนกว่ามันรับ a timeout condition.

tha

สำหรับ the SD card, the identification process สตาร์ทที่ clock rate Fod, และ the SDIO_CMD line output drives เป็น push-pull drivers แทน open-drain. The registration process ถูกทำให้สำเร็จได้ดังต่อไปนี้:

1.   The bus ถูกเปิดใช้งาน.
2.   The SDIO card host ออกอากาศ(broadcasts) SD_APP_OP_COND (ACMD41).
3.   The cards ตอบสนองด้วยสิ่งที่บรรจุอยู่ภายในของ their operation condition registers.
4.   Incompatible cards ถูกวางลงใน the inactive state.
5.   The SDIO card host ออกอากาศ(broadcasts) ALL_SEND_CID (CMD2) ไปยังทุก active cards.

tha

6.   The cards ส่งกลับ their unique card identification numbers (CIDs) และเข้าสู่ the Identification state.
7.   The SDIO card host ปล่อยออก SET_RELATIVE_ADDR (CMD3) ไปยัง an active card พร้อมกับ an address. address ใหม่
      นี้ถูกเรียกว่า the relative card address (RCA); มันสั้นกว่า the CID และแอดเดรส the card. The assigned card เปลี่ยนไปยัง
      the Standby state. The SDIO card host สามารถปล่อยออกซ้ำคำสั่งนี้เพื่อเปลี่ยน the RCA. The RCA of the card เป็นค่าที่
      กำหนดล่าสุด
8.   The SDIO card host ทำซ้ำขั้นตอน 5 ถึง 7 กับทุก active cards.


tha

สำหรับ the SD I/O card, the registration process ถูกทำให้สำเร็จได้ดังต่อไปนี้:

1.   The bus ถูกเปิดใช้งาน.
2.   The SDIO card host ส่ง IO_SEND_OP_COND (CMD5).
3.   The cards ตอบสนองด้วยสิ่งที่บรรจุอยู่ภายในของ their operation condition registers.
4.   Incompatible cards ถูกเซ็ตไปยัง the inactive state.
5.   The SDIO card host ปล่อยออก SET_RELATIVE_ADDR (CMD3) ไปยัง an active card พร้อมกับ an address. address
      ใหม่นี้ถูกเรียกว่า the relative card address (RCA); มันสั้นกว่า the CID และแอดเดรส the card. The assigned card เปลี่ยน
      ไปยัง the Standby state. The SDIO card host สามารถปล่อยออกซ้ำคำสั่งนี้เพื่อเปลี่ยน the RCA. The RCA of the card เป็น
      ค่าที่กำหนดล่าสุด

tha

22.4.5 Block write

ในระหว่าง block write (CMD24 - 27) อย่างน้อยหนึ่ง blocks of data ถูกส่งถ่ายจาก the host ไปยัง the card พร้อมกับ a CRC ต่อท้าย the end ของแต่ละ block โดย the host. A card supporting block write สามารถยอมรับ a block of data ที่กำหนดโดย WRITE_BL_LEN เสมอ. ถ้า the CRC ล้มเหลว, the card แสดงให้เห็น the failure บน the SDIO_D line และ the transferred data ถูกละทิ้งและไม่ถูกเขียน, และ blocks ที่จะส่งต่อไปทั้งหมด (ใน multiple(หลาย) block write mode) ถูกละเว้น.

tha

ถ้า the host ใช้ partial blocks ที่ความยาวสะสมไม่เป็น block aligned และ, block misalignment ไม่ถูกอนุญาติ (CSD parameter WRITE_BLK_MISALIGN ไม่ถูกเซ็ต), the card จะตรวจพบ the block misalignment error ก่อนการเริ่มต้นของ the first misaligned block. (ADDRESS_ERROR error bit ถูกเซ็ตใน the status register). The write operation จะถูกยกเลิกด้วยถ้า the host พยายามเขียนบน a write-protected area. ในกรณีนี้, อย่างไรก็ตาม, the card จะเซ็ต the WP_VIOLATION bit.

tha

การโปรแกรมของ the CID and CSD registers ไม่ต้องการ a previous block length setting. The transferred data เป็น CRC protected ด้วย. ถ้าส่วนหนึ่งของ the CSD or CID register ถูกเก็บใน ROM, ดังนั้น unchangeable part นี้ต้องตรงกับ the corresponding part of the receive buffer. ถ้าการตรงกันนี้ล้มเหลว, ดังนั้น the card รายงาน an error และไม่เปลี่ยน any register contents. Some cards อาจต้องการเวลาที่ยาวและไม่สามารถคาดเดาได้เพื่อเขียน a block of data. หลังจากการรับ a block of data และเสร็จ the CRC check, the card เริ่มการเขียนและยึด the SDIO_D line ต่ำ(low) ถ้า write buffer ของมันเต็มและไม่สามารถยอมรับ new data จาก a new WRITE_BLOCK command. The host อาจวนตรวจสอบ the status of the card ด้วย a SEND_STATUS command (CMD13) ที่เวลาใดๆ, และ the card จะตอบสนองด้วย status ของมัน. The READY_FOR_DATA status bit แสดงให้เห็นว่า the card สามารถยอมรับ new data ได้หรือไม่หรือว่า the write process กำลังดำเนินการอยู่หรือไม่. The host อาจยกเลิกการเลือก the card โดยการปล่อยออก CMD7 (เพื่อเลือกการ์ดอื่น), ซึ่งจะวาง the card ใน the Disconnect state และปลดปล่อย the SDIO_D line(s) โดยปราศจากการขัดจังหวะ the write operation. เมื่อเลือก the card ซ้ำ, มันจะเปิดใช้งานการบ่งชี้ว่าไม่ว่างอีกครั้งโดยการดึง SDIO_D เป็น low ถ้าการโปรแกรมกำลังดำเนินการอยู่และ the write buffer ไม่พร้อมใช้งาน.

tha

22.4.6 Block read

ใน Block read mode หน่วยพื้นฐานของ data transfer คือ a block ที่ maximum size ถูกกำหนดใน the CSD (READ_BL_LEN). ถ้า READ_BL_PARTIAL ถูกเซ็ต, smaller blocks ที่ start and end addresses ถูกบรรจุทั้งหมดภายใน one physical block (ตามที่กำหนดโดย READ_BL_LEN) อาจถูกส่งด้วย. A CRC ถูกต่อท้ายไปยัง the end ของแต่ละ block, เพื่อให้แน่ใจว่า data transfer integrity. CMD17 (READ_SINGLE_BLOCK) เริ่มต้น a block read และหลังจากเสร็จสมบูรณ์ the transfer, the card คืนกลับไปยัง the Transfer state.

CMD18 (READ_MULTIPLE_BLOCK) สตาร์ท a transfer ของ several consecutive blocks.