How to mount an SD card on the Huangshanpai Xiao Zhi?
I tried mounting a TF card on Xiao Zhi based on the SPI_TF example. The mounting shows success, but I cannot read the contents of the TF card. This issue only occurs on Xiao Zhi; other examples work normally.
After using sd_optimize, I get the following output. How should I modify it? The same card and same board work fine with other SPI examples, and the highlighted part shows 10MHz there.
The “12M” shown above was forcibly modified, but it still doesn’t work. Not sure if the modification was correct.
I tried it—the exact same code compiles and successfully recognizes and reads the TF card on the 52LCD board, but not on the Huangshan Pi. My Huangshan Pi isn’t connected to a battery; could this be the reason?
》》“Compilation fails on Huangshan Pai”
》》All other routines can be used normally
Hello, does it fail on Huangshan Pai itself, or does it fail specifically on Xiao Zhi’s routine on Huangshan Pai?
The thing is, the same XiaoZhi code compiles and works normally on the LCD board without giving a “No such directory” error. I’ve also tested the same configuration in other routines, and they all work fine.
Oh, I found the cause. Huangshan Pai briefly cut off the 3V3 power at the moment the screen lost power.
The TF card is powered by 3V3.
The spi_tf example program doesn’t handle hot-plugging. Once the power is lost, even if power is restored, it won’t work anymore, hence the “fail” error.
If power consumption is not a concern, you can temporarily comment out the code at the arrow location in the image, as I did, to see if it helps. We will later use a better method to fix it.