diff --git a/boards.txt b/boards.txt index e8fe66ac..1a2e4f45 100644 --- a/boards.txt +++ b/boards.txt @@ -15,18 +15,13 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -menu.chip=Chip -#menu.softdevice=Softdevice -#menu.version=Version -menu.lfclk=Low Frequency Clock -menu.board_variant=Board Variant +menu.debug=Debug Level feather52.name=Adafruit Bluefruit nRF52 Feather feather52.vid.0=0x10C4 feather52.pid.0=0xEA60 -#feather52.upload.tool=sandeepmistry:openocd feather52.upload.tool=nrfutil feather52.upload.protocol=nrfutil feather52.upload.interface=serial @@ -36,7 +31,6 @@ feather52.upload.use_1200bps_touch=false feather52.upload.wait_for_upload_port=false feather52.upload.native_usb=false -#feather52.bootloader.tool=sandeepmistry:openocd feather52.bootloader.tool=nrfjprog feather52.build.mcu=cortex-m4 @@ -53,18 +47,11 @@ feather52.build.nrfutil=nrfutil feather52.build.nrfutil.windows={runtime.platform.path}/tools/nrfutil-0.5.2/binaries/win32/nrfutil.exe feather52.build.nrfutil.macosx=/usr/local/bin/nrfutil -feather52.menu.lfclk.lfxo=Crystal Oscillator -feather52.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO -feather52.menu.lfclk.lfrc=RC Oscillator -feather52.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC -feather52.menu.lfclk.lfsynt=Synthesized -feather52.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT +feather52.menu.debug.l0=Level 0 (Release) +feather52.menu.debug.l0.build.debug_flags=-DCFG_DEBUG=0 -#feather52.menu.softdevice.none=None -#feather52.menu.softdevice.none.softdevice=none -#feather52.menu.softdevice.s132=S132 -#feather52.menu.softdevice.s132.softdevice=s132 -#feather52.menu.softdevice.s132.softdeviceversion=2.0.1 -#feather52.menu.softdevice.s132.upload.maximum_size=409600 -#feather52.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132 -#feather52.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld +feather52.menu.debug.l1=Level 1 (Error Mess) +feather52.menu.debug.l1.build.debug_flags=-DCFG_DEBUG=1 + +feather52.menu.debug.l2=Level 2 (TBD) +feather52.menu.debug.l2.build.debug_flags=-DCFG_DEBUG=2 diff --git a/cores/nRF5/verify.h b/cores/nRF5/verify.h index 3d435686..c21cf239 100644 --- a/cores/nRF5/verify.h +++ b/cores/nRF5/verify.h @@ -47,8 +47,6 @@ extern "C" { #endif -#define CFG_DEBUG 1 - #define RETURN_VOID //--------------------------------------------------------------------+ @@ -66,7 +64,7 @@ extern "C" // VERIFY Helper //--------------------------------------------------------------------+ #if CFG_DEBUG >= 1 -// #define VERIFY_MESS(format, ...) printf("[%08ld] %s: %d: verify failed\n", get_millis(), __func__, __LINE__) +// #define VERIFY_MESS(format, ...) cprintf("[%08ld] %s: %d: verify failed\n", get_millis(), __func__, __LINE__) #define VERIFY_MESS(_status) cprintf("%s: %d: verify failed, status = 0x%04X\n", __PRETTY_FUNCTION__, __LINE__, _status); #else #define VERIFY_MESS(_status) diff --git a/platform.txt b/platform.txt index 15b33bd7..9be7f80c 100644 --- a/platform.txt +++ b/platform.txt @@ -49,7 +49,7 @@ compiler.size.cmd=arm-none-eabi-size # this can be overriden in boards.txt build.extra_flags= -build.lfclk_flags= +build.debug_flags= nrf.sdk.path={build.core.path}/SDK rtos.path={build.core.path}/freertos @@ -70,13 +70,13 @@ compiler.elf2hex.extra_flags= # ---------------- ## Compile c files -recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {compiler.nrf.flags} {build.lfclk_flags} {includes} "{source_file}" -o "{object_file}" +recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {build.debug_flags} {compiler.nrf.flags} {includes} "{source_file}" -o "{object_file}" ## Compile c++ files -recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {compiler.nrf.flags} {build.lfclk_flags} {includes} "{source_file}" -o "{object_file}" +recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {build.debug_flags} {compiler.nrf.flags} {includes} "{source_file}" -o "{object_file}" ## Compile S files -recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.lfclk_flags} {includes} "{source_file}" -o "{object_file}" +recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {build.debug_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}"