Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Teensy 4.0 MakeFile

  1. #1
    Junior Member
    Join Date
    Nov 2021
    Posts
    8

    Teensy 4.0 MakeFile

    Hi, I'm new to the makefile world. I have installed WinAVR and have compiled a small test program for the teensy 2.0, following these instructions here.

    I want to upload the same "blinky" program to the Teensy 4.0 but just changing the MCU to imxrt1062 doesn't cut it. It tells me the MCU is unknown. I'm not even sure if WinAVR is the correct tool for the teensy 4.0.

    Has anyone got any information that could help me set this up?

    Thanks.

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,505
    There is a makefile for Teensy 4.x in :: {local install}\hardware\teensy\avr\cores\teensy4\Makefil e

  3. #3
    Junior Member
    Join Date
    Nov 2021
    Posts
    8
    Quote Originally Posted by defragster View Post
    There is a makefile for Teensy 4.x in :: {local install}\hardware\teensy\avr\cores\teensy4\Makefil e
    Found it, thanks. Not sure if this is the right way to go about it though - I made a BAT file with the following in it;

    Code:
    make
    pause
    - and dropped it into the same directory you specified. I get this as the output;

    Click image for larger version. 

Name:	Error.png 
Views:	38 
Size:	27.9 KB 
ID:	26578

  4. #4
    Junior Member
    Join Date
    Nov 2021
    Posts
    8
    Got it too work!

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,505
    Good to know. Makefile not used here - just knew it was there.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,491
    Glad you got it working.

    Is there any brief info you might share, which I could add (as comments in the makefile) to help other Windows users? I personally use Linux and only test the makefile on Linux... so could really use a little help to make this better for Windows users in the future.

  7. #7
    Junior Member
    Join Date
    Nov 2021
    Posts
    8
    Sure thing. The first problem I had was not knowing how to define the NO_ARDUINO environment variable, I ended up just deleting all the Arduino lines which left me with COMPILERPATH, which I had to set to a sub folder in the Arduino "tools" directory; "C:\Program Files (x86)\Arduino\hardware\tools\arm\bin" (this file path had to be enclosed in quotation marks in the MakeFile or it threw an unexpected token error '(x' I think it was in the x86 part of the folder name?).

    The next error was in WProgram.h which said : ambiguating new declaration of 'int32_t random()'. I had to open WProgram.h and comment out '//int32_t random(void);' After that it made everything perfectly. Once I edited main.cpp to get rid of setup() and loop() and recompiled and uploaded with TeensyLoader it all worked great.

    I also made two .BAT files in the same folder as the source;

    Code:
    make
    pause
    Code:
    make clean
    pause

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •