An exception occurs when the SD card is inserted or removed repeatedly. Procedure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

An exception occurs when the SD card is inserted or removed repeatedly. Procedure

1,060 Views
Display_Chen
Contributor I

The SDK software version is 2.12.1,MCU is  i.MX-RT1170 

When I quickly insert and remove the SD card, I wait for a semaphore to arrive, causing the software to fall into an endless loop. So, I modified the wait time of the semaphore so that it automatically releases the semaphore after 1000ms.

But this did not solve my problem, after I quickly SD card, it is still likely to be trapped in a dead loop, the problem is that my SD card is not in the normal recognition, whether it is inserted or removed, can not respond to my application properly.

May I ask from what aspects should I investigate this problem?

0 Kudos
Reply
2 Replies

1,033 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Display_Chen,

Firstly, I would highly suggest you update your SDK version to the latest version, as version 2.12 is close to two years old and therefore missing two years of development and bugfixes. 

Secondly, are you purposely causing this scenario to have a remedy for it in the field? The SD Card connectors have physical measures to ensure a proper connection with the card at all times, as well as ensure an accurate card detect signal until the card it fully and adequately inserted. In other words, the scenario where the MCU is inadvertently stuck on a dead loop because a quick insertion and desertion of the SD card is not very likely.

That said, you could check the Card Detect Pin to ensure that the card is fully inserted and able to detect or not, and this way determine if the application should stick inside the semaphore to communicate with the card or not.

BR,
Edwin

0 Kudos
Reply

948 Views
Display_Chen
Contributor I

 Hi,@EdwinHz,

I will replace the SDK according to your suggestion and try again.

My SD card uses an SD pin to detect if the card is inserted or pulled out. Here is my schematic section.

Display_Chen_0-1721733436493.png

When I inserted and removed the SD card several times, my led could not correctly recognize the SD card status, I checked the pin level and it seemed to have been clamped by the MCU at 3.3, because when I disconnected the MCU, it was able to correct the status of my SD card.

My software program also contains FATFS library, when FATFS calls uSDHC when the SD card is pulled out, or certain conditions are met, the software will be stuck.

Sorry for taking so long to reply you, please believe that I must be too busy.

0 Kudos
Reply