Optimizing Power of sd card problem

Hi,

  In my project, I use SPIM4 to access sd card . It is worked well.    Then ,I optimizing power of sd card. The power of my sd card is controlled by LDO.The LDO is enabled by P0.12.

 When P0.12  output high level, LDO is enable.So SD card get the 3.3V power. After this step, I mount the SD card successfull. 

 Until now , there is no problem. But when  I set P0.12 to low level after unmount sd card, the sd card power pin still have 2.7 voltage.After debugging ,I found the reason is that sd card fetch the power source mosi and cs pin.But no matter how i set the GPIO register of MOSI and CS,  it  still can't solve. Then I tried to disable the SPIM4, the problem is solved.

So, I need to disable SDMMC driver when I goto sleep,enable SDMMC driver when i need use it. Therefore, my question : How to turn off the SPIM4 after unmount the sd card in zephyr? I use the nrf connect sdk.

Parents Reply
  • Yes, I am using nrfx SPIM driver. And you will see two figures below. 

    I have used subsystem moudule "disk", the zephyr dirver "disk" and the spi driver "spi_nrfx_spim".

    I disable the spim4 by to configure the spim4 register using vscode debug console.As shown below.

    If I use directly spi dirver.I suppose that the sdmmc will not mount successfull again,beause the sdmmc finnally use spim4 dirver.

Children
Related