From aa44e4d62ed6e0b342f0e70854dab83d9d4d5179 Mon Sep 17 00:00:00 2001 From: Dave Lamb Date: Thu, 21 Sep 2023 23:58:31 +0200 Subject: [PATCH] Use VECT_TAB_OFFSET from upload method Add bootloader flags to compilation of c, cpp and S files. --- boards.txt | 8 ++++---- platform.txt | 6 +++--- .../CMSIS/GD/GD32E23x/Source/system_gd32e23x.c | 2 +- .../CMSIS/GD/GD32E50x/Source/system_gd32e50x.c | 2 +- .../CMSIS/GD/GD32F1x0/Source/system_gd32f1x0.c | 2 +- .../CMSIS/GD/GD32F3x0/Source/system_gd32f3x0.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/boards.txt b/boards.txt index e23286e6..ef8c52ce 100644 --- a/boards.txt +++ b/boards.txt @@ -568,7 +568,7 @@ gd_generic_gd32f3x0.menu.upload_method.dfuUtilMethod.upload.options= gd_generic_gd32f3x0.menu.upload_method.dfuUtilMethod.build.upload_flags= gd_generic_gd32f3x0.menu.upload_method.dfuUtilMethod.upload.tool=dfu-util -gd_generic_gd32f3x0.menu.upload_method.dfuUtilMethod.build.flash_offset=0x0x2000 +gd_generic_gd32f3x0.menu.upload_method.dfuUtilMethod.build.flash_offset=0x2000 gd_generic_gd32f3x0.menu.upload_method.dfuUtilMethod.upload.pid=0x004 gd_generic_gd32f3x0.menu.upload_method.dfuUtilMethod.upload.vid=0x1209 @@ -644,7 +644,7 @@ gd_generic_gd32f30x.menu.upload_method.dfuUtilMethod.upload.options= gd_generic_gd32f30x.menu.upload_method.dfuUtilMethod.build.upload_flags= gd_generic_gd32f30x.menu.upload_method.dfuUtilMethod.upload.tool=dfu-util -gd_generic_gd32f30x.menu.upload_method.dfuUtilMethod.build.flash_offset=0x0x2000 +gd_generic_gd32f30x.menu.upload_method.dfuUtilMethod.build.flash_offset=0x2000 gd_generic_gd32f30x.menu.upload_method.dfuUtilMethod.upload.pid=0x004 gd_generic_gd32f30x.menu.upload_method.dfuUtilMethod.upload.vid=0x1209 @@ -854,7 +854,7 @@ gd_generic_gd32e23x.menu.upload_method.dfuUtilMethod.upload.options= gd_generic_gd32e23x.menu.upload_method.dfuUtilMethod.build.upload_flags= gd_generic_gd32e23x.menu.upload_method.dfuUtilMethod.upload.tool=dfu-util -gd_generic_gd32e23x.menu.upload_method.dfuUtilMethod.build.flash_offset=0x0x2000 +gd_generic_gd32e23x.menu.upload_method.dfuUtilMethod.build.flash_offset=0x2000 gd_generic_gd32e23x.menu.upload_method.dfuUtilMethod.upload.pid=0x004 gd_generic_gd32e23x.menu.upload_method.dfuUtilMethod.upload.vid=0x1209 @@ -1248,7 +1248,7 @@ gd_generic_gd32f1x0.menu.upload_method.dfuUtilMethod.upload.options= gd_generic_gd32f1x0.menu.upload_method.dfuUtilMethod.build.upload_flags= gd_generic_gd32f1x0.menu.upload_method.dfuUtilMethod.upload.tool=dfu-util -gd_generic_gd32f1x0.menu.upload_method.dfuUtilMethod.build.flash_offset=0x0x2000 +gd_generic_gd32f1x0.menu.upload_method.dfuUtilMethod.build.flash_offset=0x2000 gd_generic_gd32f1x0.menu.upload_method.dfuUtilMethod.upload.pid=0x004 gd_generic_gd32f1x0.menu.upload_method.dfuUtilMethod.upload.vid=0x1209 diff --git a/platform.txt b/platform.txt index 5ce9f19c..3ec8b80a 100644 --- a/platform.txt +++ b/platform.txt @@ -71,11 +71,11 @@ build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} "-DUSB_MANUFACTURER= # compile patterns ## Compile c files -recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} {build.info.flags} {compiler.c.extra_flags} {build.extra_flags} {build.enable_usb} {includes} "{source_file}" -o "{object_file}" +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} {build.info.flags} {compiler.c.extra_flags} {build.extra_flags} {build.enable_usb} {build.bootloader_flags} {includes} "{source_file}" -o "{object_file}" ## Compile c++ files -recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {build.info.flags} {compiler.cpp.extra_flags} {build.extra_flags} {build.enable_usb} {includes} "{source_file}" -o "{object_file}" +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {build.info.flags} {compiler.cpp.extra_flags} {build.extra_flags} {build.enable_usb} {build.bootloader_flags} {includes} "{source_file}" -o "{object_file}" ## Compile S files -recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} {build.info.flags} {compiler.S.extra_flags} {build.extra_flags} {build.enable_usb} {includes} "{source_file}" -o "{object_file}" +recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} {build.info.flags} {compiler.S.extra_flags} {build.extra_flags} {build.enable_usb} {build.bootloader_flags} {includes} "{source_file}" -o "{object_file}" ## Create archives recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" ## Combine gc-sections, archives, and objects diff --git a/system/GD32E23x_firmware/CMSIS/GD/GD32E23x/Source/system_gd32e23x.c b/system/GD32E23x_firmware/CMSIS/GD/GD32E23x/Source/system_gd32e23x.c index a3296eaf..879f5285 100644 --- a/system/GD32E23x_firmware/CMSIS/GD/GD32E23x/Source/system_gd32e23x.c +++ b/system/GD32E23x_firmware/CMSIS/GD/GD32E23x/Source/system_gd32e23x.c @@ -40,7 +40,7 @@ #define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ #define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ -#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ +//#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ /* select a system clock by uncommenting the following line */ //#define __SYSTEM_CLOCK_8M_HXTAL (__HXTAL) diff --git a/system/GD32E50x_firmware/CMSIS/GD/GD32E50x/Source/system_gd32e50x.c b/system/GD32E50x_firmware/CMSIS/GD/GD32E50x/Source/system_gd32e50x.c index fe326560..2265094c 100644 --- a/system/GD32E50x_firmware/CMSIS/GD/GD32E50x/Source/system_gd32e50x.c +++ b/system/GD32E50x_firmware/CMSIS/GD/GD32E50x/Source/system_gd32e50x.c @@ -40,7 +40,7 @@ #define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ #define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ -#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ +//#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ /* select a system clock by uncommenting the following line */ /* use IRC8M */ diff --git a/system/GD32F1x0_firmware/CMSIS/GD/GD32F1x0/Source/system_gd32f1x0.c b/system/GD32F1x0_firmware/CMSIS/GD/GD32F1x0/Source/system_gd32f1x0.c index bd31d4a0..2e78b10f 100644 --- a/system/GD32F1x0_firmware/CMSIS/GD/GD32F1x0/Source/system_gd32f1x0.c +++ b/system/GD32F1x0_firmware/CMSIS/GD/GD32F1x0/Source/system_gd32f1x0.c @@ -40,7 +40,7 @@ #define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ #define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ -#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ +//#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ /* select a system clock by uncommenting the following line */ //#define __SYSTEM_CLOCK_8M_HXTAL (__HXTAL) diff --git a/system/GD32F3x0_firmware/CMSIS/GD/GD32F3x0/Source/system_gd32f3x0.c b/system/GD32F3x0_firmware/CMSIS/GD/GD32F3x0/Source/system_gd32f3x0.c index eb477af8..7665193b 100644 --- a/system/GD32F3x0_firmware/CMSIS/GD/GD32F3x0/Source/system_gd32f3x0.c +++ b/system/GD32F3x0_firmware/CMSIS/GD/GD32F3x0/Source/system_gd32f3x0.c @@ -40,7 +40,7 @@ #define __HXTAL (HXTAL_VALUE) /* high speed crystal oscillator frequency */ #define __SYS_OSC_CLK (__IRC8M) /* main oscillator frequency */ -#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ +//#define VECT_TAB_OFFSET (uint32_t)0x00 /* vector table base offset */ /* select a system clock by uncommenting the following line */ #if defined (GD32F330)