Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DigiSpark Attiny85 fix for compiling errors due to missing gnu++11 flag #60

Open
git-Space opened this issue Jun 4, 2018 · 1 comment

Comments

@git-Space
Copy link

Compiling can fail with all sorts of errors, due to a missing -std=gnu++11 flag in:

"C:\Users%username%\AppData\Local\Arduino15\packages\digispark\hardware\avr\1.0.0\platform.txt"

I got it working modifying compiler.cpp.flags= by adding the missing flag at the end of the list, like so:

compiler.cpp.flags=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -std=gnu++11

After this, everything is fine !

Sketch uses 5910 bytes (98%) of program storage space. Maximum is 6012 bytes.
Global variables use 181 bytes of dynamic memory.
Running Digispark Uploader...
Plug in device now... (will timeout in 60 seconds)

By the way, I am running the Attiny85 slave on pin 0 (contrary to the suggested pin 2, because I needed all the A0-A3):

/*   4CH ADC over 1-Wire  
          +-DigiSpark-----------------+
          |  __                       |
          | /  \               A0 [o] |1 P5
          | \__/               A2 [o]~|3 P4 USB-
         ++-----+              A3 [o] |2 P3 USB+
         | uUSB |  i0 SCK  SCL A1 [o]~|7 P2 USCK
         ++--__-+     MISO        [ ]~|6 P1
          | /  \      MOSI SDA    [o]~|5 P0 AREF
          | \__/  [o][o][ ]           | 
          +------------------Attiny85-+          
                  5V GND Vin(6-16V)
*/

constexpr uint8_t pin_onewire   { 0 }; //0 is P0, 1 is P1

and it worked well, 4x DS18B20 are received on the master which is a NANO running orgua's OneWire.h (but I still can't get the DS2450 to work without a CRC error, neither on the NANO as slave nor the Attiny85 as slave, and I am not sure if it's due to the CRC calculation itself or a bus timing issue - logic analyser should arrive soon 🍾 ).

In summary, I fixed my compiling issues by adding the above mentioned flag.
Oh, and OneWireHub is an awesome library!

@orgua
Copy link
Owner

orgua commented Jul 23, 2018

thanks for the detailed log!
it is odd that this crc is failing, i have tested these examples with a lot of combinations. did your logic analyser help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants