Skip to content

Commit 868395e

Browse files
committed
allow to change optimization level with debug mode
1 parent 107b196 commit 868395e

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

boards.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ feather52.build.extra_flags=-DARDUINO_FEATHER52
4848

4949
# Debug Menu
5050
feather52.menu.debug.l0=Level 0 (Release)
51-
feather52.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
51+
feather52.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 -Os
5252
feather52.menu.debug.l1=Level 1 (Error Message)
53-
feather52.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
53+
feather52.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 -Os
5454
feather52.menu.debug.l2=Level 2 (Full Debug)
55-
feather52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
55+
feather52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os
5656

5757
#**********************************************
5858
# Metro nrf52 Board
@@ -78,8 +78,8 @@ feather52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
7878

7979
# Debug Menu
8080
#metro52.menu.debug.l0=Level 0 (Release)
81-
#metro52.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0
81+
#metro52.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 -Os
8282
#metro52.menu.debug.l1=Level 1 (Error Message)
83-
#metro52.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1
83+
#metro52.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 -Os
8484
#metro52.menu.debug.l2=Level 2 (Full Debug)
85-
#metro52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2
85+
#metro52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 -Os

libraries/Bluefruit52Lib/src/utility/bootloader_util.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*
2929
* @note This function will never return but issue a reset into provided application.
3030
*/
31+
static inline void bootloader_util_reset(uint32_t start_addr) __attribute__ ((optimize("-fomit-frame-pointer")));
3132
static inline void bootloader_util_reset(uint32_t start_addr)
3233
{
3334
__asm volatile(

platform.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ compiler.warning_flags.all=-Wall -Wextra -Wno-unused-parameter -Wno-missing-fiel
3030

3131
compiler.path={runtime.tools.gcc-arm-none-eabi-5_2-2015q4.path}/bin/
3232
compiler.c.cmd=arm-none-eabi-gcc
33-
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g -Os {compiler.warning_flags} {build.float_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD -DSOFTDEVICE_PRESENT
33+
compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags} {build.float_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD -DSOFTDEVICE_PRESENT
3434
compiler.c.elf.cmd=arm-none-eabi-gcc
3535
compiler.c.elf.flags=-Os -Wl,--gc-sections -save-temps
3636
compiler.S.cmd=arm-none-eabi-gcc
3737
compiler.S.flags=-c -g -x assembler-with-cpp
3838
compiler.cpp.cmd=arm-none-eabi-g++
39-
compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g -Os {compiler.warning_flags} {build.float_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD
39+
compiler.cpp.flags=-mcpu={build.mcu} -mthumb -c -g {compiler.warning_flags} {build.float_flags} -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD
4040
compiler.ar.cmd=arm-none-eabi-ar
4141
compiler.ar.flags=rcs
4242
compiler.objcopy.cmd=arm-none-eabi-objcopy
@@ -51,7 +51,7 @@ compiler.size.cmd=arm-none-eabi-size
5151
# this can be overriden in boards.txt
5252
build.extra_flags=
5353
build.lfclk_flags=-DUSE_LFXO
54-
build.debug_flags=
54+
build.debug_flags=-DCFG_DEBUG=0 -Os
5555
build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
5656
build.ldscript=bluefruit52_s132_v201.ld
5757

@@ -61,7 +61,7 @@ nffs.path={runtime.platform.path}/libraries/nffs/src
6161

6262
compiler.nrf.flags=-DARDUINO_NRF52_ADAFRUIT -DNRF5 -DNRF52 -DS132 "-I{nrf.sdk.path}/components/toolchain/" "-I{nrf.sdk.path}/components/toolchain/CMSIS/Include" "-I{nrf.sdk.path}/components/toolchain/gcc/" "-I{nrf.sdk.path}/components/device/" "-I{nrf.sdk.path}/components/drivers_nrf/delay/" "-I{nrf.sdk.path}/components/softdevice/s132/headers/" "-I{rtos.path}/source/include" "-I{rtos.path}/config" "-I{rtos.path}/portable/GCC/nrf52" "-I{rtos.path}/portable/CMSIS/nrf52"
6363

64-
nffs.includes="-I{nffs.path}/fs/nffs/include" "-I{nffs.path}/fs/fs/include" "-I{nffs.path}/util/crc/include" "-I{nffs.path}/kernel/os/include" "-I{nffs.path}/kernel/os/include/os/arch/cortex_m4" "-I{nffs.path}/hw/hal/include" "-I{nffs.path}/sys/flash_map/include"
64+
nffs.includes="-I{nffs.path}/fs/nffs/include" "-I{nffs.path}/fs/fs/include" "-I{nffs.path}/util/crc/include" "-I{nffs.path}/kernel/os/include" "-I{nffs.path}/kernel/os/include/os/arch/cortex_m4" "-I{nffs.path}/hw/hal/include" "-I{nffs.path}/sys/flash_map/include" "-I{nffs.path}/sys/defs/include"
6565

6666
# These can be overridden in platform.local.txt
6767
compiler.c.extra_flags=

0 commit comments

Comments
 (0)