File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 2
2
# This program is free software; you can redistribute it and/or modify
3
3
# it under the terms of the GNU General Public License version 3.
4
4
5
- BOOT_DIR =bootloader
6
- PROG_DIR =programmer
5
+ BOOT_NAME =bootloader_fw.hex
6
+ PROG_NAME =app_fw.hex
7
+ GEN_NAME =nando_fw
8
+
9
+ BOOT_DIR =bootloader/
10
+ PROG_DIR =programmer/
11
+
12
+ BOOT_OBJ_DIR =$(BOOT_DIR ) obj/
13
+ PROG_OBJ_DIR =$(PROG_DIR ) obj/
14
+
15
+ BOOT_PATH =$(BOOT_OBJ_DIR )$(BOOT_NAME )
16
+ PROG_PATH =$(PROG_OBJ_DIR )$(PROG_NAME )
17
+
18
+ OBJ_DIR =obj/
19
+
20
+ TOOLCHAIN =../../../compiler/gcc-arm-none-eabi-4_9-2015q1/bin/arm-none-eabi-
21
+ OBJCOPY =$(TOOLCHAIN ) objcopy
7
22
8
23
all :
9
24
$(MAKE ) -C $(BOOT_DIR )
10
25
$(MAKE ) -C $(PROG_DIR )
26
+ mkdir -p $(OBJ_DIR )
27
+ cp $(BOOT_PATH ) $(OBJ_DIR )
28
+ cp $(PROG_PATH ) $(OBJ_DIR )
29
+ cd $(OBJ_DIR ) && sed -i ' $$d' $(BOOT_NAME ) && \
30
+ cat $(BOOT_NAME ) $(PROG_NAME ) > $(GEN_NAME ) .hex && \
31
+ $(OBJCOPY ) --input-target=ihex --output-target=binary $(GEN_NAME ) .hex \
32
+ $(GEN_NAME ) .bin
11
33
12
34
clean :
13
35
$(MAKE ) -C $(BOOT_DIR ) clean
14
36
$(MAKE ) -C $(PROG_DIR ) clean
37
+ rm -rf obj/
15
38
16
39
distclean :
17
40
$(MAKE ) -C $(BOOT_DIR ) distclean
18
41
$(MAKE ) -C $(PROG_DIR ) distclean
42
+ rm -rf obj/
43
+
44
+ erase :
45
+ st-flash erase
19
46
20
47
program :
21
- $(MAKE ) -C $(BOOT_DIR ) program
22
- $(MAKE ) -C $(PROG_DIR ) program
48
+ st-flash write $(OBJ_DIR )$(GEN_NAME ) .bin 0x08000000
Original file line number Diff line number Diff line change 2
2
# This program is free software; you can redistribute it and/or modify
3
3
# it under the terms of the GNU General Public License version 3.
4
4
5
- PROG_NAME =nando_fw
5
+ PROG_NAME =app_fw
6
6
7
7
SRC_DIR =./
8
8
USB_DIR =../usb_cdc/
You can’t perform that action at this time.
0 commit comments