'TWI_CLOCK_FREQ' error when upload

In file included from sketch\Repetier.h:539:0,

                 from sketch\BedLeveling.cpp:107:

sketch\HAL.h: In static member function 'static void HAL::hwSetup()':

HAL.h:343: error: 'TWI_CLOCK_FREQ' was not declared in this scope



... (long list of errors)

exit status 1
'TWI_CLOCK_FREQ' was not declared in this scope

I did try to solve it for my own but all the time when I fix one error it just give me another one...
I do have
-board: arduino due (programing)  //I did try with the mega 2560 and it give me sam.h error. And USB give me same error
-port: COM X arduino mega 2560

please if more information just let me know. I do really want to have my 3D project printer working :)



  • TWI_CLOCK_FREQ gets define in pins.h in your boards section. If you did not select a Due based board this would be a problem. Most boards use
    #define TWI_CLOCK_FREQ          400000

  • on pins.h I already have deifine it as #define TWI_CLOCK_FREQ          400000. I just double check it.
    I did try to verify before uploading and give me this error

    exit status 1
    invalid preprocessing directive #PINS_H

  • when I created the Firmware I did select Arduino Due with RADDS.

  • Where do you have #PINS_H ? In pins.h it is not ther eyou only have 
    #ifndef PINS_H
    #define PINS_H

    at the beginning. Did you delete the define somehow?

  • #ifndef PINS_H
    #define PINS_H

    The board assignment defines the capabilities of the motherboard and the used pins.
    Each board definition follows the following scheme:
      ARCH_AVR for AVR based boards
      ARCH_ARM for all arm based boards

    that the beginning on my pin.h
  • Quote: "that the beginning on my pin.h"

    don´t change the original file pins.h, if you want your own definitions , write a file "userpins.h " that contains your pins
    and in configuration.h set :

    #define MOTHERBOARD 999

  • I am just loosing my head!

    In file included from sketch\Repetier.h:198:0,
                     from sketch\BedLeveling.cpp:107:
    sketch\Configuration.h:463:0: warning: "SDCARDDETECTINVERTED" redefined [enabled by default]
    In file included from sketch\Configuration.h:42:0,
                     from sketch\Repetier.h:198,
                     from sketch\BedLeveling.cpp:107:
    sketch\pins.h:321:0: note: this is the location of the previous definition

    now it is giving me different errors!!!

    I am not trying to change the pin.h. I am just trying to make it work.
    I try to make a new firmware on the page,

    -with the Arduino 2560
    -ramps v1.4 (Arduino Due with RAMPS -FD)
    -display reprap 128x64
    -stepper Nema17


  • Sketch uses 173456 bytes (33%) of program storage space. Maximum is 524288 bytes.
    No device found on COM3
    An error occurred while uploading the sketch

    at the end of the SDCARDDETECTINVERTED is giving me this error, sorry I thought I had it on the upper post
  • in the device manager the device is detected.
    I did upload some basic code from the examples (led blink) and it communicate when I have the Board: Arduino mega, if I select Due it just crash and give me:
     No device found on COM3
     An error occurred while uploading the sketch

  • that just means you have arduino mega, not due.
    that also expains all the trouble from your previous posts.

  • yes!!! i just realize it.

    SORRY about this misunderstood, and THANK you for your time.
    probably i will be coming up with some other dumb questions <span>:expressionless:</span>
Sign In or Register to comment.