# Error when using the SD card library

**URL:** <https://community.particle.io/t/error-when-using-the-sd-card-library/14164>\
**Category:** Troubleshooting\
**Created:** [August 6, 2015, 5:34pm UTC](https://community.particle.io/t/error-when-using-the-sd-card-library/14164 "2015-08-06T17:34:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrm145](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@shrm145](https://community.particle.io/u/shrm145)\
**Post date:** [August 6, 2015, 5:34pm UTC](https://community.particle.io/t/error-when-using-the-sd-card-library/14164/1 "2015-08-06T17:34:21Z")

</div>

Hello,

I tried using the SD card library in Particle Build. However, whenever I try to flash an example, it gives me the following error.

“sd-card-library/sd2-card.cpp:764:5: error: ‘PIN\_MAP’ was not declared in this scope  
PIN\_MAP[mosiPin\_].gpio\_peripheral-\>BSRR = PIN\_MAP[mosiPin\_].gpio\_pin; // Data High”

A similar error appears for the clock pin. I am manually wiring the SEEED SD card shield to the Photon. I am pretty confident that I got the wiring right. Any help will be greatly appreciated 😄

---

<div class="post-metadata">

**Author:** ![Bspranger](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bspranger/32/5725_2.png) [@Bspranger](https://community.particle.io/u/Bspranger)\
**Post date:** [August 6, 2015, 5:57pm UTC](https://community.particle.io/t/error-when-using-the-sd-card-library/14164/2 "2015-08-06T17:57:45Z")

</div>

Is it possible the firmware is having issues with the PIN\_MAP? I am on my phone, but I just saw a pinned topic about this.

---

<div class="post-metadata">

**Author:** ![shrm145](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@shrm145](https://community.particle.io/u/shrm145)\
**Post date:** [August 6, 2015, 6:03pm UTC](https://community.particle.io/t/error-when-using-the-sd-card-library/14164/3 "2015-08-06T18:03:46Z")

</div>

I’m not really sure ? It doesn’t give me an error related to PIN\_MAP(PIN\_MAP[misoPin\_].gpio\_peripheral) ? I’m just going to try and rewire everything, just to make sure . I’m pretty new to this.

---

<div class="post-metadata">

**Author:** ![Bspranger](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bspranger/32/5725_2.png) [@Bspranger](https://community.particle.io/u/Bspranger)\
**Post date:** [August 6, 2015, 9:13pm UTC](https://community.particle.io/t/error-when-using-the-sd-card-library/14164/4 "2015-08-06T21:13:13Z")

</div>

I think that error is a compiler error which would have nothing to do with the wiring.

Check out this thread:

> [@Photon and the PIN\_MAP\[\] challenge!](https://community.particle.io/t/photon-and-the-pin-map-challenge/12223/2):
>
> With your permission, I’d like to work on this header a little then include it in the firmware, so that we have one copy to maintain, along with any other library compatibility tweaks that people need.

---

<div class="post-metadata">

**Author:** ![shrm145](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@shrm145](https://community.particle.io/u/shrm145)\
**Post date:** [August 7, 2015, 5:25pm UTC](https://community.particle.io/t/error-when-using-the-sd-card-library/14164/5 "2015-08-07T17:25:09Z")

</div>

Thanks !! I will look into that
