# I2c Code works on a WebIDE build but not a local build

**URL:** https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835
**Category:** Troubleshooting
**Created:** [November 2, 2014, 3:47am UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835 "2014-11-02T03:47:09Z")
**Posts on this page:** 11
**Page:** 2

<div class="post-metadata">

### Author: ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)
#### Post date: [November 5, 2014, 3:15am UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/21 "2014-11-05T03:15:13Z")

</div>

Ok in the name of science I just upgraded my toolchain:

```auto
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.8.4 20140725 (release) [ARM/embedded-4_8-branch revision 213147]
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

```

now when performing a `make clean all` on current master I get:

```auto
Invoking: ARM GNU Print Size
arm-none-eabi-size --format=berkeley core-firmware.elf
   text data bss dec hex	filename
  78768 1224 11860 91852 166cc	core-firmware.elf

```

I’d say that’s close enough between windows and mac that we probably have the same code now.

I then ran `make program-dfu` with this build and it put Tinker on my Core. After testing with the iPhone Spark app I was able to toggle the D7 led no problem.

Would you please try this as well and see if you can get Tinker to work?

If yours doesn’t, give mine a try:  
[https://dl.dropboxusercontent.com/u/41117656/firmware/core-firmware.bin](https://dl.dropboxusercontent.com/u/41117656/firmware/core-firmware.bin)

You can flash it to your Core by going to the directory where you download it to, and typing:  
`dfu-util -d 1d50:607f -a 0 -s 0x08005000:leave -D core-firmware.bin`

Don’t give up!! We’re going to 👊 this problem in the 😵

---

<div class="post-metadata">

### Author: ![Geekbozu](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Geekbozu](https://community.particle.io/u/Geekbozu)
#### Post date: [November 5, 2014, 3:21am UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/22 "2014-11-05T03:21:30Z")

</div>

I will say now I can not flash currently via DFU my install of DFU utils broke and I have fought with that to no avail. (I’ts a mix of me having done USB dev a few weeks ago and messing up my lib-usb install. And I just have not been willing to fight with it.)

I am going to install tinker, and let you know how it goes.  
Also is d7 the user led? Or do I need to put one on d7 ( I have been manually checking it with my DMM because I was not sure)

EDIT: Tinker does work, User application is still not working.

EDIT2: also not giving up, I can not stand the webide, but to me my browser is a browser not a replacement for everything 😛 Tho it is nice for whipping up quick examples and finding libraries to use.

---

<div class="post-metadata">

### Author: ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)
#### Post date: [November 5, 2014, 4:12am UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/23 "2014-11-05T04:12:14Z")

</div>

Hmm, so if dfu-util is not working for you… how are you compiling locally and getting that compiled binary onto your Core? Spark CLI?

I know we can get dfu-util working pretty easily for you…

Just drop the EXE from here into a folder like c:/dfu-util/dfu-util.exe and then add this `;c:/dfu-util/` to the end of your PATH Variable Value located in System / Advanced System Settings / Environmental Variables.

> **[Latest 2014 DFU-UTIL for Windows \[compiled\]](https://community.particle.io/t/latest-2014-dfu-util-for-windows-compiled/5264/3)**
>
> @kennethlimcp, hope you don’t mind, I went ahead and built the dfu-util.exe. @BDub, what’s the best way to get this to you so you can try it out? EDIT: for testing, I’ve put it on my dropbox account....

You also need the DFU UTIL driver (sounds like you know already but just pointing this out for all following along):

> **[Tutorial: Installing DFU-Driver on Windows \[24 Feb 2015\]](https://community.particle.io/t/tutorial-installing-dfu-driver-on-windows/3518)**
>
> So it seems like some :spark: owners want to go slightly advanced but instructions for installing the DFU-driver is a little vague. How to put your core in DFU-mode Press on BOTH buttons Release only the Reset button Release the Mode button once...

---

<div class="post-metadata">

### Author: ![Geekbozu](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Geekbozu](https://community.particle.io/u/Geekbozu)
#### Post date: [November 5, 2014, 4:22am UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/24 "2014-11-05T04:22:43Z")

</div>

yeah spark-cli for all extensive purposes (make file pushes it for me via the api), It was working It’s been yelling that this device is not DFUable or not able to be looked up via vendor ID. I forget exactly but ill poke at it.

And yeah I know this already I was playing with LibUsb for an arduino project and borked everything 😛

OK DFU flashing works again, User application code still does not work.

---

<div class="post-metadata">

### Author: ![Geekbozu](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Geekbozu](https://community.particle.io/u/Geekbozu)
#### Post date: [November 6, 2014, 11:29pm UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/25 "2014-11-06T23:29:41Z")

</div>

Bump @BDub any other ideas so far I’m still at a loss.

---

<div class="post-metadata">

### Author: ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)
#### Post date: [November 6, 2014, 11:34pm UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/26 "2014-11-06T23:34:38Z")

</div>

I’ll be back in a bit and think about it 🙂

**EDIT:** Back! @Geekbozu So did you try to DFU the bin I linked up above, that should put Tinker on your Core and you should be able to turn on the D7 LED by setting D7 to a digital output and then setting it HIGH.

---

<div class="post-metadata">

### Author: ![Geekbozu](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Geekbozu](https://community.particle.io/u/Geekbozu)
#### Post date: [November 7, 2014, 3:52am UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/27 "2014-11-07T03:52:31Z")

</div>

Sorry pinged you then had family stuff! Tinker runs from my local build flashed over cloud or DFU. Running a flash the led application how ever does not.

---

<div class="post-metadata">

### Author: ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)
#### Post date: [November 7, 2014, 5:40am UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/28 "2014-11-07T05:40:35Z")

</div>

No worries!

Specifically, the Tinker that I supplied or can you also get the `make clean all` default build to work as well, which is also Tinker.

---

<div class="post-metadata">

### Author: ![Geekbozu](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Geekbozu](https://community.particle.io/u/Geekbozu)
#### Post date: [November 8, 2014, 6:37pm UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/29 "2014-11-08T18:37:13Z")

</div>

Make clean all does work ^^

So To clarify the current issues.

Building works. Running built applications seem to lose access to spark\_wiring.  
Tinker Does work. The wifi API features of the core do work with applications (the cloud connects and accepts flash requests)  
i2c Does not work presumably from the fact that the spark\_wiring is lost.

Hopefully that helps sum whats going on up @BDub

---

<div class="post-metadata">

### Author: ![Geekbozu](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Geekbozu](https://community.particle.io/u/Geekbozu)
#### Post date: [November 13, 2014, 9:59pm UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/30 "2014-11-13T21:59:52Z")

</div>

Bump. Been trying random things as i get ideas. Still nada ☹

@BDub

> [@Geekbozu](#):
>
> Building works. Running built applications seem to lose access to spark\_wiring.Tinker Does work. The wifi API features of the core do work with applications (the cloud connects and accepts flash requests, A Telnet console library does work.)  
> i2c Does not work presumably from the fact that the spark\_wiring is lost.

---

<div class="post-metadata">

### Author: ![Geekbozu](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@Geekbozu](https://community.particle.io/u/Geekbozu)
#### Post date: [November 17, 2014, 9:11pm UTC](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835/31 "2014-11-17T21:11:04Z")

</div>

So this has been solved. Reason being that I had my source code in the wrong structure.

I moved my libraries to the Libraries Dir modified the Make file to include them. Added build.mk files for them and now it works.

Followed the instructions here and it solved everything.

> **[Local built application and library usage](https://community.particle.io/t/local-built-application-and-library-usage/7217/11)**
>
> editted 10/17/2014 I forgot some stuff. @Hootie81 and @peekay123 thanks for the posts and work. Below is how I implemented local libraries. A big goal for me was to be able to import (clone) the libraries right from the github repositories if...

[Previous page](https://community.particle.io/t/i2c-code-works-on-a-webide-build-but-not-a-local-build/7835.md?page=1)
