åä½ç¶æ³ã¨ã¾ã¨ã
ï¼ï¼åä½ç¶æ³
ï¼ï¼SDã«ã¼ãåæåã³ã¼ã
ãåæåCLK 400kHz
ãRaw bits æ¬ã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ã¯ Viewer表示ã®ãã°Â
STM32F4 |
SD card |
CMD0ããâ |
No Reply |
CMD8ããâ |
Reply : R7 âï¸ |
CMD55ãâï¸ |
|
Reply : R1 â |
|
to SD 4bit |
ï¼ï¼æ¸è¾¼ã¿é度
ï¼ï¼æ¸è¾¼ã¿é度ä¸è¦§
ãå®å®ãã¦æ¸è¾¼ããSDIO_CKå¨æ³¢æ°ã¨æ¸è¾¼ã¿é度
ï¼ï¼ï¼æ¸¬å®æ¡ä»¶
ãSDã«ã¼ã : Transcend Premium 400x 32GB Class10
ããã¼ã¿ï¼15360byte x 125åæ¸è¾¼ã¿ååã®å¹³åå¤
ï¼ï¼ï¼æ¸¬å®çµæ SDIO_CK 24MHz
ï¼ï¼è§£èª¬
ï¼ï¼åæåã³ã¼ã
ãã»ãããã§èª¿ã¹ã㨠CMD0 â CMD8 â CMD55 ã®å¾ã« ACMD41ãããããã§ããããã¾ã§è¿½ãã¦ãã¾ãã
ãã»åæåæã®ã¯ããã¯ã¯èªåçã«400kHzã«ãªãããã§ãã®å¾ã« hsd.Init.ClockDiv ã§è¨å®ããå¨æ³¢æ°ã«é·ç§»ãã
ï¼ï¼æ¸è¾¼ã¿é度
ãæã
å¹³åå¤ã®åå以ä¸ã®é度ã¾ã§è½ã¡ãããéåæãã¼ã¿ãåãæ±ãå ´åã¯å¯¾çããªãã¨ãã¼ã¿ãåããã¼ã
ãæ¸è¾¼ã¿é度ã¯ã³ã³ãã¤ã©æé©åã§ã¢ããããã®ã§ã³ã¼ãã«ä¾åããé¨åãå¤ã
ãã»SDIO hardware flow control : disable ã®ã¾ã¾ã§ã¯ SD 4bitã¢ã¼ãã§ã¯ 6MHzã¾ã§ããå®å®ããªã
ãã»SD 1bitã¢ã¼ã㯠disableã§ã24MHzã¾ã§åã
ãã»SD 4bitã¢ã¼ãã¯FIFO underrun (TX mode) ã¨ã©ã¼ã¨ãªãã®ã§ã½ããã追ãã¤ãã¦ããªãã¨æããã
ãã»ï¼ï¼ï¼ã§ãè²¼ãä»ããä¸è¨åèè³æï¼ï¼ï¼ã«ããã¨SD 4bitã¢ã¼ãã§ã¯è»¢éã¿ã¤ãã³ã°ã«åé¡ãããããã«æããã
ãSDã«ã¼ãã½ã±ããå¤ä»ãã®BlackPill ãã¼ãã§ã¯I2C(OLED)å®è£
ã§ã¯ããã¯ãä¸ããããªãã£ã
ãSTM32F4_64Pãã¼ãã§ã¯24MHzã§ãæ£å¸¸ã«åä½ãã
ï¼ï¼åè
ï¼ï¼ï¼STM32F2xx / STM32F4xx SDIO Interface Part 2
ï¼ï¼ï¼SDã«ã¼ãã®èªã¿åºãé度åä¸ã¨ãªã¼ãã¼ã¯ããã¯
Â
ï¼ï¼ã¾ã¨ã
ãä»åæ°ãã¤ããä¸å
·åç¾è±¡ã¨å¯¾çä¸è¦§
åå |
対ç |
ä¸å ·åç¾è±¡ |
||||
f_mount ã¨ã©ã¼ |
æ¸è¾¼ããªã å ´åããã |
æ¸è¾¼ããªã |
PC㧠èªããªã |
|||
SDã«ã¼ã |
ã«ã¼ãä¸å ·å |
FAT32ãã©ã¼ãããå®æ½ ã¯ã¤ãã¯ãã©ã¼ããããã§ãã¯å¤ã |
⯠|
⯠|
⯠|
⯠|
SDã«ã¼ã ã¢ã¸ã¥ã¼ã« |
ä¾çµ¦é»æµä¸è¶³ |
é»æºåè·¯å èµã¢ã¸ã¥ã¼ã«ã«ãã |
⯠|
⯠|
⯠|
ã¼ |
å¥é»æºã«ãã |
||||||
ã¬ãã«å¤æ ãããã¡ãã |
ãããã¡ãªãã¢ã¸ã¥ã¼ã«ã«ãã |
⯠|
ã¼ |
ã¼ |
ã¼ |
|
ä¿¡å·ç· ãã«ã¢ãããªã |
ãã«ã¢ãããã |
⯠|
ã¼ |
ã¼ |
ã¼ |
|
1 CDãã³ Lã¬ãã« |
Hã¬ãã«ã«ãã |
⯠|
ã¼ |
ã¼ |
ã¼ |
|
ã«ã¼ãæ¤åºå ¥å Hã¬ãã« |
ãã«ã¢ãããã |
⯠|
ã¼ |
ã¼ |
ã¼ |
|
Platform Setting å²å½ããªã |
||||||
STM32 CubeMX |
ã»SDIO_CK ãéããã ã»å²è¾¼å¦çæé ãé·ã ã»FIFO ãunderrun |
SDIO_CK é ããã |
⯠|
⯠|
⯠|
ã¼ |
ã³ã³ãã¤ã©æé©å |
ã¼ |
⯠|
⯠|
ã¼ |
||
SDIO hardware flow control : enable STM32F411xC/xE 使ç¨ç¦æ¢ |
ã¼ |
⯠|
⯠|
ã¼ |
||
ã³ã¼ã |
FATFSé¢æ°å¦çä¸å²è¾¼ç¦æ¢ |
ã¼ |
⯠|
⯠|
ã¼ |
|
å²è¾¼å¦çä¸ SDIO_CKåæ¢ |
||||||
Debug |
ST LINKãã ä¾çµ¦é»æµä¸è¶³ |
å¤é¨é»æºã§é§å |
⯠|
⯠|
⯠|
ã¼ |
SD 4bit Middleware |
Middleware ãã° |
SD 1bitã§èµ·åãåæè¨å®ã®å¾ SD 4bitã«åæ¿ãã |
⯠|
ã¼ |
ã¼ |
ã¼ |
åãã¦ã³ã |
unmount, UnLinkå¾ã« åLinkãåãã¦ã³ããã |
⯠|
ã¼ |
ã¼ |
ã¼ |
Â
ããã¾ã