Skip to content

Commit 28e17d8

Browse files
Added FASTBOOT option, and changed makefile to allow an additional define to be sppecificed e.g make make generic-pc13 DEFINES=-DFASTBOOT
1 parent d20b2f1 commit 28e17d8

File tree

3 files changed

+33
-26
lines changed

3 files changed

+33
-26
lines changed

Makefile

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ gd32f1-frankenmaple: begin clean gccversion build_gd32f1-frankenmaple sizeafter
139139

140140
build: elf bin lss sym
141141

142-
build_maple-mini: TARGETFLAGS= -DTARGET_MAPLE_MINI
142+
build_maple-mini: TARGETFLAGS= -DTARGET_MAPLE_MINI $(DEFINES)
143143
# Set the linker script
144144
build_maple-mini: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
145145

@@ -151,7 +151,7 @@ copy_maple_mini:
151151
cp $(TARGET).bin bootloader_only_binaries/maple_mini_boot20.bin
152152
@echo
153153

154-
build_maple-rev3: TARGETFLAGS= -DTARGET_MAPLE_REV3
154+
build_maple-rev3: TARGETFLAGS= -DTARGET_MAPLE_REV3 $(DEFINES)
155155
# Set the linker script
156156
build_maple-rev3: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
157157

@@ -163,7 +163,7 @@ copy_maple-rev3:
163163
cp $(TARGET).bin bootloader_only_binaries/maple_rev3_boot20.bin
164164
@echo
165165

166-
build_maple-rev5: TARGETFLAGS= -DTARGET_MAPLE_REV5
166+
build_maple-rev5: TARGETFLAGS= -DTARGET_MAPLE_REV5 $(DEFINES)
167167
# Set the linker script
168168
build_maple-rev5: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
169169
build_maple-rev5: elf bin lss sym
@@ -175,7 +175,7 @@ copy_maple-rev5:
175175
@echo
176176

177177

178-
build_generic-pc13: TARGETFLAGS= -DTARGET_GENERIC_F103_PC13
178+
build_generic-pc13: TARGETFLAGS= -DTARGET_GENERIC_F103_PC13 $(DEFINES)
179179
# Set the linker script
180180
build_generic-pc13: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
181181
build_generic-pc13: elf bin lss sym
@@ -186,7 +186,7 @@ copy_generic-pc13:
186186
cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pc13.bin
187187
@echo
188188

189-
build_generic-pg15: TARGETFLAGS= -DTARGET_GENERIC_F103_PG15
189+
build_generic-pg15: TARGETFLAGS= -DTARGET_GENERIC_F103_PG15 $(DEFINES)
190190
# Set the linker script
191191
build_generic-pg15: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
192192
build_generic-pg15: elf bin lss sym
@@ -198,7 +198,7 @@ copy_generic-pg15:
198198
@echo
199199

200200

201-
build_generic-pd2: TARGETFLAGS= -DTARGET_GENERIC_F103_PD2
201+
build_generic-pd2: TARGETFLAGS= -DTARGET_GENERIC_F103_PD2 $(DEFINES)
202202
# Set the linker script
203203
build_generic-pd2: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
204204
build_generic-pd2: elf bin lss sym
@@ -210,7 +210,7 @@ copy_generic-pd2:
210210
@echo
211211

212212

213-
build_generic-pd1: TARGETFLAGS= -DTARGET_GENERIC_F103_PD1
213+
build_generic-pd1: TARGETFLAGS= -DTARGET_GENERIC_F103_PD1 $(DEFINES)
214214
# Set the linker script
215215
build_generic-pd1: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
216216
build_generic-pd1: elf bin lss sym
@@ -221,7 +221,7 @@ copy_generic-pd1:
221221
cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pd1.bin
222222
@echo
223223

224-
build_generic-pa1: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1
224+
build_generic-pa1: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1 $(DEFINES)
225225
# Set the linker script
226226
build_generic-pa1: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
227227
build_generic-pa1: elf bin lss sym
@@ -232,7 +232,7 @@ copy_generic-pa1:
232232
cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pa1.bin
233233
@echo
234234

235-
build_generic-pa1-button-pa8: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1_BUTTON_PA8
235+
build_generic-pa1-button-pa8: TARGETFLAGS= -DTARGET_GENERIC_F103_PA1_BUTTON_PA8 $(DEFINES)
236236
# Set the linker script
237237
build_generic-pa1-button-pa8: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
238238
build_generic-pa1-button-pa8: elf bin lss sym
@@ -243,7 +243,7 @@ copy_generic-pa1-button-pa8:
243243
cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pa1_button_pa8.bin
244244
@echo
245245

246-
build_generic-pb9: TARGETFLAGS= -DTARGET_GENERIC_F103_PB9
246+
build_generic-pb9: TARGETFLAGS= -DTARGET_GENERIC_F103_PB9 $(DEFINES)
247247
# Set the linker script
248248
build_generic-pb9: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
249249
build_generic-pb9: elf bin lss sym
@@ -255,7 +255,7 @@ copy_generic-pb9:
255255
@echo
256256

257257

258-
build_generic-pe2: TARGETFLAGS= -DTARGET_GENERIC_F103_PE2
258+
build_generic-pe2: TARGETFLAGS= -DTARGET_GENERIC_F103_PE2 $(DEFINES)
259259
# Set the linker script
260260
build_generic-pe2: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
261261
build_generic-pe2: elf bin lss sym
@@ -267,7 +267,7 @@ copy_generic-pe2:
267267
@echo
268268

269269

270-
build_generic-pa9: TARGETFLAGS= -DTARGET_GENERIC_F103_PA9
270+
build_generic-pa9: TARGETFLAGS= -DTARGET_GENERIC_F103_PA9 $(DEFINES)
271271
# Set the linker script
272272
build_generic-pa9: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
273273
build_generic-pa9: elf bin lss sym
@@ -279,7 +279,7 @@ copy_generic-pa9:
279279
@echo
280280

281281

282-
build_generic-pe5: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5
282+
build_generic-pe5: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5 $(DEFINES)
283283
# Set the linker script
284284
build_generic-pe5: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
285285
build_generic-pe5: elf bin lss sym
@@ -291,7 +291,7 @@ copy_generic-pe5:
291291
@echo
292292

293293

294-
build_generic-pe5-button-pa0: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5_BUTTON_PA0
294+
build_generic-pe5-button-pa0: TARGETFLAGS= -DTARGET_GENERIC_F103_PE5_BUTTON_PA0 $(DEFINES)
295295
# Set the linker script
296296
build_generic-pe5-button-pa0: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
297297
build_generic-pe5-button-pa0: elf bin lss sym
@@ -303,7 +303,7 @@ copy_generic-pe5-button-pa0:
303303
@echo
304304

305305

306-
build_generic-pb7: TARGETFLAGS= -DTARGET_GENERIC_F103_PB7
306+
build_generic-pb7: TARGETFLAGS= -DTARGET_GENERIC_F103_PB7 $(DEFINES)
307307
# Set the linker script
308308
build_generic-pb7: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
309309
build_generic-pb7: elf bin lss sym
@@ -314,7 +314,7 @@ copy_generic-pb7:
314314
cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pb7.bin
315315
@echo
316316

317-
build_generic-pb0: TARGETFLAGS= -DTARGET_GENERIC_F103_PB0
317+
build_generic-pb0: TARGETFLAGS= -DTARGET_GENERIC_F103_PB0 $(DEFINES)
318318
# Set the linker script
319319
build_generic-pb0: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
320320
build_generic-pb0: elf bin lss sym
@@ -326,7 +326,7 @@ copy_generic-pb0:
326326
@echo
327327

328328

329-
build_stbee: TARGETFLAGS= -DTARGET_STBEE
329+
build_stbee: TARGETFLAGS= -DTARGET_STBEE $(DEFINES)
330330
# Set the linker script
331331
build_stbee: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
332332
build_stbee: elf bin lss sym
@@ -337,7 +337,7 @@ copy_stbee:
337337
cp $(TARGET).bin bootloader_only_binaries/stbee_boot20.bin
338338
@echo
339339

340-
build_naze32: TARGETFLAGS= -DTARGET_NAZE32
340+
build_naze32: TARGETFLAGS= -DTARGET_NAZE32 $(DEFINES)
341341
# Set the linker script
342342
build_naze32: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
343343
build_naze32: elf bin lss sym
@@ -348,7 +348,7 @@ copy_naze32:
348348
cp $(TARGET).bin bootloader_only_binaries/naze32_boot20.bin
349349
@echo
350350

351-
build_generic-pb12: TARGETFLAGS= -DTARGET_GENERIC_F103_PB12
351+
build_generic-pb12: TARGETFLAGS= -DTARGET_GENERIC_F103_PB12 $(DEFINES)
352352
# Set the linker script
353353
build_generic-pb12: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
354354
build_generic-pb12: elf bin lss sym
@@ -359,7 +359,7 @@ copy_generic-pb12:
359359
cp $(TARGET).bin bootloader_only_binaries/generic_boot20_pb12.bin
360360
@echo
361361

362-
build_hytiny-stm32f103t: TARGETFLAGS= -DTARGET_HYTINY_STM32F103T
362+
build_hytiny-stm32f103t: TARGETFLAGS= -DTARGET_HYTINY_STM32F103T $(DEFINES)
363363
# Set the linker script
364364
build_hytiny-stm32f103t: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
365365
build_hytiny-stm32f103t: elf bin lss sym
@@ -370,7 +370,7 @@ copy_hytiny-stm32f103t:
370370
cp $(TARGET).bin bootloader_only_binaries/generic_boot20_hytiny.bin
371371
@echo
372372

373-
build_dso138: TARGETFLAGS= -DTARGET_DSO138
373+
build_dso138: TARGETFLAGS= -DTARGET_DSO138 $(DEFINES)
374374
# Set the linker script
375375
build_dso138: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
376376
build_dso138: elf bin lss sym
@@ -381,7 +381,7 @@ copy_dso138:
381381
cp $(TARGET).bin bootloader_only_binaries/dso138_boot20.bin
382382
@echo
383383

384-
build_gd32f1-generic-pc13: TARGETFLAGS= -DTARGET_GD32F1_GENERIC_F103_PC13
384+
build_gd32f1-generic-pc13: TARGETFLAGS= -DTARGET_GD32F1_GENERIC_F103_PC13 $(DEFINES)
385385
# Set the linker script
386386
build_gd32f1-generic-pc13: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
387387
build_gd32f1-generic-pc13: elf bin lss sym
@@ -392,7 +392,7 @@ copy_gd32f1-generic-pc13:
392392
cp $(TARGET).bin bootloader_only_binaries/gd32f1_generic_boot20_pc13.bin
393393
@echo
394394

395-
build_gd32f1-frankenmaple: TARGETFLAGS= -DTARGET_GD32F1_FRANKENMAPLE
395+
build_gd32f1-frankenmaple: TARGETFLAGS= -DTARGET_GD32F1_FRANKENMAPLE $(DEFINES)
396396
# Set the linker script
397397
build_gd32f1-frankenmaple: LDFLAGS +=-T$(ST_LIB)/c_only_md_high_density.ld
398398
build_gd32f1-frankenmaple: elf bin lss sym

generic_boot20_pc13_fastboot.bin

6.96 KB
Binary file not shown.

main.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,21 @@ int main()
5656
dont_wait=TRUE;
5757
break;
5858
default:
59-
strobePin(LED_BANK, LED_PIN, STARTUP_BLINKS, BLINK_FAST,LED_ON_STATE);
60-
if (!checkUserCode(USER_CODE_FLASH0X8005000) && !checkUserCode(USER_CODE_FLASH0X8002000))
59+
#ifdef FASTBOOT
60+
dont_wait=TRUE;
61+
#else
62+
strobePin(LED_BANK, LED_PIN, STARTUP_BLINKS, BLINK_FAST,LED_ON_STATE);
63+
#endif
64+
if (!checkUserCode(USER_CODE_FLASH0X8005000) && !checkUserCode(USER_CODE_FLASH0X8002000))
6165
{
6266
no_user_jump = TRUE;
6367
}
6468
else if (readButtonState())
6569
{
66-
no_user_jump = TRUE;
70+
no_user_jump = TRUE;
71+
#ifdef FASTBOOT
72+
dont_wait=FALSE;
73+
#endif
6774
}
6875
break;
6976
}

0 commit comments

Comments
 (0)