Skip to content

Commit e3c3beb

Browse files
author
Paul Adams
committed
this adds and option to set the LFCLK on the nRF52DK which can also be used on custom boards with or without an external 32.xxxkhz crystal, defaults to use external crystal
1 parent 683419f commit e3c3beb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

boards.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
menu.chip=Chip
1919
menu.softdevice=Softdevice
2020
menu.version=Version
21+
menu.lfclk=Low Frequency Clock
2122

2223
nRF52DK.name=nRF52 DK
2324

@@ -56,6 +57,12 @@ nRF52DK.menu.softdevice.s132.upload.maximum_size=409600
5657
nRF52DK.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
5758
nRF52DK.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld
5859

60+
nRF52DK.menu.lfclk.lfxo=Crystal Oscillator
61+
nRF52DK.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO
62+
nRF52DK.menu.lfclk.lfrc=RC Oscillator
63+
nRF52DK.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
64+
nRF52DK.menu.lfclk.lfsynt=Synthesized
65+
nRF52DK.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
5966

6067
BluzDK.name=Bluz DK
6168

platform.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ compiler.define=-DARDUINO=
5050

5151
# this can be overriden in boards.txt
5252
build.extra_flags=
53+
build.lfclk_flags=
5354

5455
nrf.sdk.path={runtime.platform.path}/cores/nRF5/SDK
5556

@@ -69,13 +70,13 @@ compiler.elf2hex.extra_flags=
6970
# ----------------
7071

7172
## Compile c files
72-
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} {includes} "{source_file}" -o "{object_file}"
73+
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} {includes} "{source_file}" -o "{object_file}"
7374

7475
## Compile c++ files
75-
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} {includes} "{source_file}" -o "{object_file}"
76+
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.lfclk_flags} {includes} "{source_file}" -o "{object_file}"
7677

7778
## Compile S files
78-
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} {includes} "{source_file}" -o "{object_file}"
79+
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}"
7980

8081
## Create archives
8182
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"

0 commit comments

Comments
 (0)