##// END OF EJS Templates
Fixed nemiver target issue => force program loading with stflash
jeandet -
r84:fdbc71e07f96 dev_alexis
parent child
Show More
@@ -1,87 +1,88
1 #
1 #
2 # qmake configuration for stm32f4
2 # qmake configuration for stm32f4
3 #
3 #
4 #
4 #
5
5
6
6
7 isEmpty(_stm32f4_conf){
7 isEmpty(_stm32f4_conf){
8 _stm32f4_conf="oneshot"
8 _stm32f4_conf="oneshot"
9
9
10 QMAKE_CFLAGS+= -g -mlittle-endian -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c99
10 QMAKE_CFLAGS+= -g -mlittle-endian -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c99
11
11
12 include(../../common/arm-none-eabi.conf)
12 include(../../common/arm-none-eabi.conf)
13
13
14 DEFINES += __OPTIMIZED_MATH
14 DEFINES += __OPTIMIZED_MATH
15 DEFINES += \"assert_param(expr)=((void)0)\"
15 DEFINES += \"assert_param(expr)=((void)0)\"
16 INCLUDEPATH += $$PWD
16 INCLUDEPATH += $$PWD
17
17
18 DEFINES += __FPU_PRESENT=1
18 DEFINES += __FPU_PRESENT=1
19 DEFINES += ARM_MATH_CM4
19 DEFINES += ARM_MATH_CM4
20
20
21 DEFINES += BSP="\"\\\"$$BSP"\\\"\"
21 DEFINES += BSP="\"\\\"$$BSP"\\\"\"
22
22
23
23
24 contains(CPU, stm32f42x){
24 contains(CPU, stm32f42x){
25 LDSCRIPT=stm32f42.ld
25 LDSCRIPT=stm32f42.ld
26 }
26 }
27 contains(CPU, stm32f4xxxG){
27 contains(CPU, stm32f4xxxG){
28 LDSCRIPT=stm32f4.ld
28 LDSCRIPT=stm32f4.ld
29 }
29 }
30
30
31
31
32 contains( TEMPLATE, app ) {
32 contains( TEMPLATE, app ) {
33
33
34 unix:QMAKE_POST_LINK += arm-none-eabi-objcopy -O ihex "$(TARGET)" $$DESTDIR/"$(QMAKE_TARGET).hex" $$escape_expand(\\n\\t)
34 unix:QMAKE_POST_LINK += arm-none-eabi-objcopy -O ihex "$(TARGET)" $$DESTDIR/"$(QMAKE_TARGET).hex" $$escape_expand(\\n\\t)
35 unix:QMAKE_POST_LINK += arm-none-eabi-objcopy -O binary "$(TARGET)" $$DESTDIR/"$(QMAKE_TARGET).bin" $$escape_expand(\\n\\t)
35 unix:QMAKE_POST_LINK += arm-none-eabi-objcopy -O binary "$(TARGET)" $$DESTDIR/"$(QMAKE_TARGET).bin" $$escape_expand(\\n\\t)
36 win32:QMAKE_POST_LINK += arm-none-eabi-objcopy -O ihex "$(DESTDIR_TARGET)" $$DESTDIR/"$(QMAKE_TARGET).hex" $$escape_expand(\\n\\t)
36 win32:QMAKE_POST_LINK += arm-none-eabi-objcopy -O ihex "$(DESTDIR_TARGET)" $$DESTDIR/"$(QMAKE_TARGET).hex" $$escape_expand(\\n\\t)
37 win32:QMAKE_POST_LINK += arm-none-eabi-objcopy -O binary "$(DESTDIR_TARGET)" $$DESTDIR/"$(QMAKE_TARGET).bin" $$escape_expand(\\n\\t)
37 win32:QMAKE_POST_LINK += arm-none-eabi-objcopy -O binary "$(DESTDIR_TARGET)" $$DESTDIR/"$(QMAKE_TARGET).bin" $$escape_expand(\\n\\t)
38
38
39 contains( CONFIG, dfu ){
39 contains( CONFIG, dfu ){
40 unix:QMAKE_POST_LINK += python $$[QT_INSTALL_BINS]/dfu.py -b 0x08000000:$$DESTDIR/"$(QMAKE_TARGET).bin" $$DESTDIR/"$(QMAKE_TARGET).dfu" $$escape_expand(\\n\\t)
40 unix:QMAKE_POST_LINK += python $$[QT_INSTALL_BINS]/dfu.py -b 0x08000000:$$DESTDIR/"$(QMAKE_TARGET).bin" $$DESTDIR/"$(QMAKE_TARGET).dfu" $$escape_expand(\\n\\t)
41 }
41 }
42
42
43 LIBS += -L$$[QT_INSTALL_PREFIX]/bsp/lib/$$BSP -lbsp
43 LIBS += -L$$[QT_INSTALL_PREFIX]/bsp/lib/$$BSP -lbsp
44 LIBS += -L$$[QT_INSTALL_LIBS]/$$UCMODEL
44 LIBS += -L$$[QT_INSTALL_LIBS]/$$UCMODEL
45 LIBS += -lcpu
45 LIBS += -lcpu
46 LIBS += -lcore -lm -lc
46 LIBS += -lcore -lm -lc
47
47
48 QMAKE_LFLAGS += -g -mlittle-endian -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c99 -T $$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/$$LDSCRIPT
48 QMAKE_LFLAGS += -g -mlittle-endian -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c99 -T $$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/$$LDSCRIPT
49
49
50
50
51
51
52 SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/syscalls.c
52 SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/syscalls.c
53 SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/fs.c
53 SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/fs.c
54 SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/crt0.s
54 SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/crt0.s
55 SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/cpuinit.c
55 SOURCES +=$$[QT_INSTALL_PREFIX]/mkspecs/features/stm32f4/cpuinit.c
56
56
57
57
58 stflash.target = stflash
58 stflash.target = stflash
59 stflash.commands = cd $$DESTDIR && st-flash write $(QMAKE_TARGET).bin 0x08000000
59 stflash.commands = cd $$DESTDIR && st-flash write $(QMAKE_TARGET).bin 0x08000000
60 dfu.target = dfu
60 dfu.target = dfu
61 dfu.commands = cd $$DESTDIR && dfu-util d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D $(QMAKE_TARGET).bin 0x08000000
61 dfu.commands = cd $$DESTDIR && dfu-util d 0483:df11 -c 1 -i 0 -a 0 -s 0x08000000 -D $(QMAKE_TARGET).bin 0x08000000
62 gdb-server.target = gdb-server
62 gdb-server.target = gdb-server
63 gdb-server.commands = st-util -p 3333 &
63 gdb-server.commands = st-util -p 3333 &
64 gdb-server.depends = stflash
64 nemiver.target = nemiver
65 nemiver.target = nemiver
65 nemiver.commands = cd $$DESTDIR && nemiver --remote=localhost:3333 --gdb-binary=`which arm-none-eabi-gdb` $(QMAKE_TARGET)
66 nemiver.commands = cd $$DESTDIR && nemiver --remote=localhost:3333 --gdb-binary=`which arm-none-eabi-gdb` $(QMAKE_TARGET)
66 nemiver.depends = gdb-server
67 nemiver.depends = gdb-server
67 QMAKE_EXTRA_TARGETS += stflash dfu nemiver gdb-server
68 QMAKE_EXTRA_TARGETS += stflash dfu nemiver gdb-server
68 }
69 }
69
70
70
71
71
72
72 }
73 }
73
74
74
75
75
76
76
77
77
78
78
79
79
80
80
81
81
82
82
83
83
84
84
85
85
86
86
87
87
88
General Comments 0
You need to be logged in to leave comments. Login now