Hello, I have a problem with my own designed board, It has nRF52832 and some other sensors which communicate over SPI, also I have a SD card on the same bus that works fine while I use fatfs example. I tried to merge my code with fatfs example but I faced many problems because SPI driver was initialized in my main code and also It is going to be reinitialized in app_sdc_init() function (in app_sdcard.c). Is it possible to change the app_sdcard.h and also app_sdcard.c to solve my problem? What can I do? by the way I use SDK17 and also I use 1v8 as VCC of nRF52832 so I used a voltage level translator (TXB0108) to communicate with 3v3 on SD card.
Some SD cards requires pullup on the MISO line, but this is related to the SD card, and not the nRF SoC. You should pullup the line on the SD card side of the level converter for the pullup to have any…
See my answer in this thread. Do you need to have the SD-card and the other slaves on the same SPI bus? It would be much simpler to run the SD-card on a separate SPI instance, with its own GPIOs. The nRF52832 has 3 available SPI(M) instances.
Thanks for you reply, I tried another idea, I uninitialized SPI just before start of the SD card code using "nrf_drv_spi_uninit(&spi);" and again reinitialized it at the end of using SD card, but it stays at "diskio_blkdev.c" line 120: "m_drives[drv].config.wait_func();", I can't find what is wrong with this.
Unfortunately I designed and got the PCB, for next time I will change it, But for now is this possible?
If you fully uninitialize the SPI driver and SD-card library/FatFS between each time it is used, this should be possible, however you need to do this for both, as the SD-card library uses the same SPI driver and instance as you use in your application. If you keep one running, it will be left in a wrong state in one of the places being used.
Can you post the full code for how you have implemented this?
I decided to redesign my PCB, But I have another problem, should I pull up the MISO pin of SD card? As I said before I use TXB0108 as level translator (my micro uses 1v8 but my SD card uses 3v3), Which side of TXB0108 should be pulled up (near micro or near sdcard)?