I’m having trouble getting my local build version of the excellent OneWire library by @Hotaman to work on my Photon. If I build from the web IDE everything works perfectly - so I doubt it’s the fault of the library, more likely something up with my build setup.
I’ve got fresh checkouts of the latest
firmware branch, and of the OneWire library. I’ve even cut down the platform-conditional logic around the fast pin access setup (and removed the non-Photon blocks), to ensure the right code is being used.
When I build from Eclipse or the command line with make all APP=myapp PLATFORM=photon
I get garbage in the search results - sometimes all zeroes, sometimes garbage, e.g.:
0 - Sensor: 0000000000000000
1 - Sensor: 000000000C020000
0 - Sensor: 4800B7FF5D02000E
1 - Sensor: 0000000000000000
(These are two DS18B20s, so the address above should start with a ‘28’) OneWire is heavily timing dependent, so it feels like this is maybe running with the wrong clock rate/delay scaling or something?
One thing that might be relevant - I have GCC 5.2 (Arch Linux), which I understand from @mdma (Local build failing (in src/cc3000_spi.c)) is not yet fully tested/supported, so this could be the cause. How can I go about narrowing this down and identifying the problem?