fix MCU speed 64MHz instead of 16MHz
use 32Khz crystal instead of RC for clock
This commit is contained in:
1 parent
8bd5c43b55
commit
d0677e6b99
4 files changed
+25
-5
No files matched your search
+3
-1
@@ -34,7 +34,7 @@ feather52.upload.native_usb=false
|
||||
feather52.bootloader.tool=nrfjprog
|
||||
|
||||
feather52.build.mcu=cortex-m4
|
||||
feather52.build.f_cpu=16000000
|
||||
feather52.build.f_cpu=64000000
|
||||
feather52.build.board=FEATHER52
|
||||
feather52.build.core=nRF5
|
||||
feather52.build.variant=feather52
|
||||
@@ -43,6 +43,8 @@ feather52.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
|
||||
feather52.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
|
||||
feather52.build.ldscript=feather52_s132.ld
|
||||
|
||||
feather52.build.lfclk_flags=-DUSE_LFXO
|
||||
|
||||
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
|
||||
|
||||
@@ -27,7 +27,16 @@ extern "C" {
|
||||
|
||||
void init( void )
|
||||
{
|
||||
#if defined( USE_LFXO )
|
||||
// 32Khz XTAL
|
||||
NRF_CLOCK->LFCLKSRC = (uint32_t)((CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos) & CLOCK_LFCLKSRC_SRC_Msk);
|
||||
#elif defined(USE_LFRC)
|
||||
// Internal OSC
|
||||
NRF_CLOCK->LFCLKSRC = (uint32_t)((CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos) & CLOCK_LFCLKSRC_SRC_Msk);
|
||||
#else
|
||||
#error Clock Source is not configured, define USE_LFXO or USE_LFRC according to your board
|
||||
#endif
|
||||
|
||||
NRF_CLOCK->TASKS_LFCLKSTART = 1UL;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ AdafruitBluefruit Bluefruit;
|
||||
static void bluefruit_blinky_cb( TimerHandle_t xTimer )
|
||||
{
|
||||
(void) xTimer;
|
||||
|
||||
ledToggle(LED_CONN);
|
||||
}
|
||||
|
||||
@@ -128,10 +127,19 @@ err_t AdafruitBluefruit::begin(bool prph_enable, bool central_enable)
|
||||
// Configure Clock
|
||||
nrf_clock_lf_cfg_t clock_cfg =
|
||||
{
|
||||
#if defined( USE_LFXO )
|
||||
// LFXO
|
||||
.source = NRF_CLOCK_LF_SRC_XTAL,
|
||||
.rc_ctiv = 0,
|
||||
.rc_temp_ctiv = 0,
|
||||
.xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM
|
||||
#else
|
||||
// LFRC
|
||||
.source = NRF_CLOCK_LF_SRC_RC,
|
||||
.rc_ctiv = 16,
|
||||
.rc_temp_ctiv = 2,
|
||||
.xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM
|
||||
#endif
|
||||
};
|
||||
|
||||
VERIFY_STATUS( sd_softdevice_enable(&clock_cfg, NULL) );
|
||||
|
||||
+4
-3
@@ -50,6 +50,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
|
||||
@@ -74,13 +75,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} {build.debug_flags} {compiler.nrf.flags} {includes} {nffs.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.lfclk_flags} {build.debug_flags} {compiler.nrf.flags} {includes} {nffs.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} -DARDUINO_BSP_VERSION="{version}" {compiler.cpp.extra_flags} {build.extra_flags} {build.debug_flags} {compiler.nrf.flags} {includes} {nffs.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} -DARDUINO_BSP_VERSION="{version}" {compiler.cpp.extra_flags} {build.extra_flags} {build.lfclk_flags} {build.debug_flags} {compiler.nrf.flags} {includes} {nffs.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.debug_flags} {includes} {nffs.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.lfclk_flags} {build.debug_flags} {includes} {nffs.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}"
|
||||
|
||||
Reference in new issue
Block a user