ADXL345 not working with RamDisk

This could be the problem:

  SPI.setDataMode(SPI_MODE3);      //Configure the SPI connection for the ADXL345.

The SdFat and M23LCV1024 library set SPI mode and speed each time they access the SPI bus. They both use mode zero.

Try setting the mode before each ADXL345 SPI access. The SPI.setDataMode() call is very fast.

void SPIClass::setDataMode(uint8_t mode)
{
  SPCR = (SPCR & ~SPI_MODE_MASK) | mode;
}