SD Card Info Returns wrong size

I had the same problem. Sorry about replying to old thread, but search led me to this. Sd2card.cpp file is incorrect. I figured a solution:

the previous code in function

else if (csd.v2.csd_ver == 1) {
    uint32_t c_size = ((uint32_t)csd.v2.c_size_high << 16)
                      | (csd.v2.c_size_mid << 8) | csd.v2.c_size_low;
    return (c_size + 1) << 10;

to:

else if (csd.v2.csd_ver == 1) {
	  
    uint32_t c_size = (csd.v2.c_size_high<<16) | (csd.v2.c_size_mid << 8) | csd.v2.c_size_low ;//combine byte
    return (c_size+1)<<9;//(c_size+1)*512; 
	
  }

The mistake was multipling by 512 they bitshift 10 instead of 9. So your result ends up being twice.