-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.example
67 lines (51 loc) · 1.79 KB
/
Makefile.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
NUCLEO_VERSION := L432KC
TARGET := NUCLEO_$(NUCLEO_VERSION)
COMPILER := GCC_ARM
BUILD_DST := pod-src/BUILD
BIN := include.bin
YOUR_PATH := `pwd`
#### CHECK WITH YOUR TEAMLEAD TO MAKE SURE THIS INFORMATION IS CORRECT ####
PI := hitl.badgerloop.org
PI_UNAME := ubuntu
####==================================================================#####
##### USER/OS SPECIFIC #####
NUCLEO_PATH := /run/media/$(USERNAME)/NODE_$(NUCLEO_VERSION)# Works for Manjaro (maybe all Linux)
PATH_TO_GCC_ARM := /home/eudlis/badgerloop/gcc-arm-none-eabi/bin# Replace with your path
############################
.PHONY: all build flash open install
all: post build flash
rem: post build rem-flash rem-force
flash:
@echo "-----------------"
@echo "Copying to board"
@echo "-----------------"
-cp $(BUILD_DST)/$(BIN) $(NUCLEO_PATH)
-cp $(BUILD_DST)/$(BIN) $(NUCLEO_PATH)1
rem-flash:
@echo "-----------------"
@echo "Remote Flash"
@echo "-----------------"
-scp $(BUILD_DST)/$(BIN) $(PI_UNAME)@$(PI):/media/nucleo_main
-scp $(BUILD_DST)/$(BIN) $(PI_UNAME)@$(PI):/media/nucleo_uart
rem-force:
ssh $(PI_UNAME)@$(PI) sync
# Lazy way to open a terminal to control a nucleo, can't promise it'll work for
# you
open:
screen /dev/ttyACM0
build:
mbed compile -v -t $(COMPILER) -m $(TARGET) --source pod-src/include --source pod-src/src --source mbed-os/ --build $(BUILD_DST)
post:
cd pod-src/src && python3 POST.py
# installs Mbed related stuff
install:
pip install mbed-cli --user
git clone https://github.com/ARMmbed/mbed-os
cd mbed-os && pip install -r requirements.txt --user && cd ..
config
config:
mbed config TOOLCHAIN $(COMPILER)
mbed config MBED_OS_DIR $(YOUR_PATH)/mbed-os/
mbed config TARGET $(TARGET)
mbed config $(COMPILER) $(PATH_TO_GCC_ARM)
mbed config GCC_ARM_PATH $(PATH_TO_GCC_ARM)