Hi Ivan,
It is correct. It fixes a bug that was added when the imxrt1020 came in. Apparently Dave did not wire the CD pin of the IC to the socket (He used a GPIO). But that change broke the case were the CD pin of the IC is wired to the socket Please See https://github.com/apache/incubator-nuttx/commit/2e71e0632f8106d1505d313e7171904536feec45#diff-787575b8e98a29e0a9d088767a68b280 It is to use allow the use of a standard GPIO pin for card detect OR the use of the USDHC dedicated CD pin. (it also supports inversion of the pin or CD detect bit) If you wire CD to the USDHC CD pin you define PIN_USDHC1_CD (as PIN_USDHC1_CD_n) in board.h. See https://github.com/apache/incubator-nuttx/blob/master/boards/arm/imxrt/imxrt1060-evk/include/board.h#L215 If you use a regular GPIO you define PIN_USDHC1_CD_GPIO (as GPIO_PORTn | GPIO_PINn) in board.h See https://github.com/apache/incubator-nuttx/blob/master/boards/arm/imxrt/imxrt1020-evk/include/board.h#L271 Regards, David -----Original Message----- From: Embedded Systems [mailto:ivanucherdj...@gmail.com] Sent: Wednesday, January 29, 2020 11:51 PM To: dev@nuttx.apache.org Subject: IMXRT1050 USDHC Hello, I found a typo mistake in the USDHC driver related to the card detect pin. It is a pretty simple one. Can someone tell me how toapplay a patch for it. Or someone who know how to do it do the following changes and apply them. Thank you in advance! in file /arch/arm/src/imxrt/imxrt_usdhc.c Line 379-381 #if defined(PIN_USDHC1_CD_GPIO) .sw_cd_gpio = PIN_USDHC1_CD_GPIO, #endif should be changed to #if defined(PIN_USDHC1_CD) .sw_cd_gpio = PIN_USDHC1_CD, #endif And same file at lines 437-439 #if defined(PIN_USDHC2_CD_GPIO) .sw_cd_gpio = PIN_USDHC2_CD_GPIO, #endif should be changed to #if defined(PIN_USDHC2_CD) .sw_cd_gpio = PIN_USDHC2_CD, #endif -- Kind regards, Ivan Ucherdzhiev Team Lead @ Barin Sports Bulgaria skype: ipy_44 tel: +359888927760