Skip to content

Compile to Teensy 3.0 on Windows using Makefile

Good Night,

If you don’t want to use Arduino IDE (Or Teensy IDE? 😉 to programming and uploading your code to Teensy 3.0 you can use Makefiles.

The last IDE version can be found on PJRC Forum . As he said in the Beta 10 version, there is an Makefile example on “arduino-1.0.3\hardware/teensy/cores/teensy3” but to use it you need to add the arm binaries to your system path. To do this, open your command prompt. Start – execute – cmd.

And then type:

PATH = %PATH%;C:\CAMINHO_PARA_O_ARDUINO\arduino-1.0.3\hardware\tools\arm-none-eabi\bin

[If you don’t want to know the modifications that I did, just jump to the end where you can find a resume]

To guarantee that I will not screw everything, I did a copy of “arduino-1.0.3\hardware/teensy/cores/teensy3” and did my modifications on it. I executed:

cs-make.exe

Receveid this error message:

C:\CAMINHO_PARA_O_ARDUINO\arduino-1.0.3\Projects\Example_not_working>cs-make.exe
C:/Users/X-warrior/Desktop/tools/arm-none-eabi/bin/arm-none-eabi-gcc -Wall -g -Os -mcpu=cortex-m4 -mthumb -nostdlib -MMD -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I. -c -o analog.o analog.c
process_begin: CreateProcess(NULL, C:/Users/X-warrior/Desktop/tools/arm-none-eabi/bin/arm-none-eabi-gcc -Wall -g -Os -mcpu=cortex-m4 -mthumb -nostdlib -MMD -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I. -c -o analog.o analog.c, …) failed.
make (e=2): The system cannot find the file specified.
cs-make.exe: *** [analog.o] Error 2

Checking the Makefile I decided to change some configs and used FULL PATH for it.
TOOLSPATH = C:\CAMINHO_PARA_O_ARDUINO\arduino-1.0.3\hardware\tools
COMPILERPATH = C:\CAMINHO_PARA_O_ARDUINO\arduino-1.0.3\hardware\tools\arm-none-eabi\bin

The error received was the same, so checking the code again I saw the “abspath” and thought that maybe the problem was this, since I changed my folder location. So I removed all “$(abspath” remember that it has a parenthesis that closes the command. So for example:

$(abspath $(COMPILERPATH)) will be $(COMPILERPATH)

Trying to get it working again with cs-make, it started compiling it, but on the end I received this error:

C:\Users\X-warrior\Desktop\arduino-1.0.3\hardware\tools\arm-none-eabi\bin/arm-none-eabi-objcopy -O ihex -R .eeprom main.elf main.hex
C:\Users\X-warrior\Desktop\arduino-1.0.3\hardware\tools/teensy_post_compile -file=main -path= -tools=C:\Users\X-warrior\Desktop\arduino-1.0.3\hardware\tools
Opening Teensy Loader…
Teensy Loader could not find the file main
cs-make.exe: *** [main.hex] Error 1

Triple checking the Makefile I found “path=$(shell pwd)” and I didn’t remember this pwm command on windows so I tried to execute it and it didn’t work. So I changed it to “path=$(shell echo %cd%)”. Before I start compiling again I decide to clean directory using cs-make clean

I received the following errors:

C:\Users\X-warrior\Desktop\arduino-1.0.3\Projects\Example_not_working>cs-make.exe clean
rm -f *.o *.d main.elf main.hex
process_begin: CreateProcess(NULL, rm -f *.o *.d main.elf main.hex, …) failed.
make (e=2): The system cannot find the file specified.
cs-make.exe: *** [clean] Error 2

And then I noticed that it was calling rm -f which isn’t a windows command too. I changed the rm command to:

del *.o
del *.d
del $(TARGET).elf
del $(TARGET).hex

With this I managed to clean the files and tried to compile again, and… IT WORKS! I did a few tests using main.cpp that was being compiled and uploaded to my Teensy 3. Anyways to work with all that files wasn’t attractive so I decided to go a little further and do some cleaning. So inside my “Project” folder I copied all files excluding Makefile and main.cpp to my new folder inside my project “teensy/”. This way I can compile it without all that files on my working folder. I needed to do a few more changes on Makefile as follow:

C_FILES := $(wildcard *.c) \
$(wildcard $(addprefix teensy/, *.c)) \
$(wildcard $(addprefix teensy/util, *.c)) \
$(wildcard $(addprefix teensy/avr, *.c))
CPP_FILES := $(wildcard *.cpp) \
$(wildcard $(addprefix teensy/, *.cpp)) \
$(wildcard $(addprefix teensy/util, *.cpp)) \
$(wildcard $(addprefix teensy/avr, *.cpp))
OBJS := $(C_FILES:.c=.o) $(CPP_FILES:.cpp=.o)

Linker configuration to:

LDFLAGS = -Os -Wl,–gc-sections -mcpu=cortex-m4 -mthumb -Tteensy/mk20dx128.ld

And to keep it consistent:

$(TARGET).elf: $(OBJS) teensy/mk20dx128.ld
$(CC) $(LDFLAGS) -o $@ $(OBJS)

And then I found this error:

teensy/keylayouts.c:1: fatal error: avr/pgmspace.h: No such file or directory
compilation terminated.
cs-make: *** [teensy/keylayouts.o] Error 1

So I updated the CPPFLAGS to:

CPPFLAGS = -Wall -g -Os -mcpu=cortex-m4 -mthumb -nostdlib -MMD $(OPTIONS) -I. -Iteensy/

And also remembered that the clean should be updated too.

clean:
del *.o
del *.d
del $(TARGET).elf
del $(TARGET).hex
del $(CURRENT_PATH)\teensy\*.o
del $(CURRENT_PATH)\teensy\*.d

And add this on the begin of “Configurations that shouldn’t be updated”

CURRENT_PATH=$(shell echo %cd%)

With all this I managed to get the Makefile working on Windows compiling and uploading for Teensy 3.0

Summary:
You must update TOOLSPATH , COMPILERPATH and use your FULL PATH
Then create a folder “My_Project”
Create another folder inside your project called “teensy” (My_Project/teensy/)
Copy “arduino-1.0.3\hardware/teensy/cores/teensy3/” to “My_Project/teensy/” (subdir too, but not the Makefile)
Add the Makefile that you can download on the end of this post inside “My_Project”
Copy “Meu_Projeto/teensy/main.cpp” too “Meu_Projeto/main.cpp”
Programm inside main.cpp
Compile and upload with cs-make.exe

Makefile to Teensy on Windows

Matheus

Published inCcppTeensywindows

4,404 Comments

  1. والله بصراحة أنا بقالي تقريبًا نص سنة بجرب المنصة دي وكنت شايف إن الموضوع هيبقى زي غيره، بس اتفاجئت شوية. اللي شدني من البداية إن التسجيل ماخدش مني ٣ دقايق وأول شحن صغير جدًا — في حدود ١-٢ دولار، يعني مش محتاج تحط مبلغ كبير عشان تجرب.

    اللعبة اللي بضيع فيها وقتي السلوتات وخصوصًا Book of Dead — براغماتيك بلاي ليها حضور قوي. كمان في إصدارات من Play’n GO وBig Time Gaming، وعدد الألعاب ضخم — بيتكلموا عن آلاف العناوين وفعلًا حاسس بيه وأنا بتصفح. جزء الديلر المباشر شغال على Evolution وفيه موزعين حقيقيين وشو Crazy Time ناس كتير بتلعبها بالليل.

    موضوع العرض الترحيبي، استفدت من عرض أول إيداع وكان مضاعفة للإيداع الأول بالإضافة لفري سبينز حوالي ١٥٠ لفة بتتصرف على مراحل. بس خد بالك: متطلب المراهنة محتاج صبر وأنا شخصيًا اتحرقت أول مرة. وأحيانًا بينزلوا مكافآت بدون شحن، والأفضل تشوف الشروط المحدثة عند تنزيل 888starz للاندرويد قبل ما تحط فلوسك.

    موضوع سحب الأرباح كان أحسن من توقعاتي. المرة اللي فاتت وصلت خلال ساعات. الخيارات مريحة: Visa وMastercard، Skrill وNeteller، وE-wallets، والكريبتو موجود برضه — والصراحة ده بيحل مشاكل كتير عندنا هنا بسبب مشاكل الكروت البنكية.

    النسخة المحمولة هو اللي بلعب عليه ٩٠٪ من الوقت. تنزيل تطبيق 888 سهل — بتاخد الملف مباشرة منهم لأن السياسة عندهم مانعة، وده طبيعي مش حاجة مقلقة. التطبيق خفيف ومش بياكل بطارية بشكل مبالغ فيه، إنما اللي مضايقني إن فيه نوتيفيكشنز بتيجي طول الوقت وقفلتها من الإعدادات.

    الدعم الفني ردهم سريع في الشات بس مش دايمًا بالعربي. فيه رخصة كوراساو ويعني مش MGA بس معروف ومنتشر. مش هقولك إنه كامل، التحقق من الهوية أخد مني يومين وكنت متوتر لحد ما خلصت.

  2. Ребята кто хочет заработать То график убийственный Объехал кучу сайтов Короче, единственный где есть нормальные предложения — работа в казахстане с высокой зарплатой Оплата вовремя В общем, смотрите сами по ссылке — найти работу в казахстане найти работу в казахстане Найдите нормальную работу Перешлите тому кто ищет работу

  3. Nudde photoss off elaine aldenVideo off nudistsEriin mcnaught nuude in heelsJeewish bitches pornBreas
    cance wazlk nnj 2011Frree hikibg pornTeen eting andd nutritionHorny gaay boy galleryYoung hornery guys nakedAshlee impson teen eople coverJessica albaa nde
    cellphome picsWomn spoorts nudee photosSeexy annd pretty aisia wemonCuckiold porn clipsVideo gikrl having ssex
    inn publicAsian fuucks black natife videoAmputee femape seex partnersRedd tube yooung
    lesbians fistingNacy bbenoit husrler protestHaalloween adult partty game ideasTilaa nguyrn ssex fuckFully ckothed
    cum shotBlasck milf seex clipsFrenc erdotic artNakled tteen buttsGayy pornstar
    hhot rodPorrn tar midoiMeshng pornWiife coaxing guuy too uck herNihole gravees anal tubesVintage razce car pictureErotica l.aKayie pprice jordran frse orn videoThdee
    gijrls sare hhis cuum https://xnxxgo.cc/line/blowjob Malee midget fucming femaleCheereleaders nudde gymMedication uuse
    forr sexLesbian wedings aat castleCuum inn hoot pussyOrgasm gaes onlineHot babes xxxx viseosShkrt sesxy stoiesAlysda milao nudeMultiplle intelligence forr adilt literacy
    aand educationFreee thai filipoino pussy creanlie sexHaijfa wwehbe serxy photoFemale esclrts st paull minnesotaPasst actreses nudde pictures
    befoore 1980Lesbian groups greenviloe scPaiid forr blow jobKrisral marshyall njde
    picsVirtgin falls parkDickk chenesy heartt attackLesboan seex sstories collegeLesboan tub lrgs poolAdult dday halth kennerLitttel irl nudistFreee pporn mobvile videPacchiaa
    escortVaginaal ultrawound bleeding12 2006 gazaa september stripGant ranny cocksItaliuan frree polrn moviesLinesey lohan nnude movieFajous asia
    menErrin andews nide videoImddb forty year old virgin6119 grrtsch vintageTaraji henson seex sceneDry
    peeVeronica zemmanoga pornHomemde fazcial pornGlamlur upskirtMasss effet 2 sucksBijiin facial clransing powderEvva grwen masturbationBisexual cuntFreee lynhdsay loan nudePolicemen porn nhde movi clipsSeual discipliningOktoberfest upskirtFree sexx
    ccum redd youtubeInternbal inflamstion oof vaginaNudee jimm brown picsDildfo bonnds agee furnitureXnxx frde sexx storiesJenbifer anisston sex videosGiilf blowjobVictooria diplard nude picsToogo pornstar galleriesTeen stsrs aand
    panties

  4. GustavoUnift GustavoUnift

    Перед началом лечения на дому нарколог собирает анамнез, измеряет необходимые показатели и уточняет сведения о состоянии пациента. Врач определяет степень интоксикации, длительность запоя и допустимость капельницы на дому. Нарколог подбирает индивидуальный состав раствора с учетом состояния пациента, стадии алкоголизма, сопутствующих заболеваний, возраста и других факторов.
    Подробнее – нарколог на дом вывод из запоя Санкт-Петербург

Leave a Reply

Your email address will not be published. Required fields are marked *