Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Low Frequency Clock (LFCLK) Build Flag Setting on NRF52 #189

Closed
dennowiggle opened this issue Jan 8, 2024 · 1 comment
Closed

Comments

@dennowiggle
Copy link

dennowiggle commented Jan 8, 2024

I have just been experimenting with a BBC Micro:bit V2.20 and could not get a stable program running. It would always lockup after running for some time.

My very simple program controlling LED's using the platformio Arduino framework would lockup while calling delay() after a period of time running successfully. (No BLE configured anywhere).

The delay() function uses millis() which uses the counter driven by RTC1.

It turns out by default the build uses the LFCLK configuration = LFXO, yet the BBC Micro:bit V2 board has no 32.768kHz crsytal oscillator or crystal. Therefore, the correct configuration is to use the LFSYNT config. To do this set this in the platformio.ini file
build_flags = -DUSE_LFSYNT

I am running NRF52 platform 10.3.0. I also tried 10.2.0


platformio/nordicnrf52
Platform • 10.3.0 • Public • Published on Wed Dec 27 12:36:37 2023

The nRF52 Series are built for speed to carry out increasingly complex tasks in the shortest possible time and return to sleep, conserving precious battery power. They have a Cortex-M4F processor which makes them quite capable Bluetooth Smart SoCs.

---------------------  ----------------------------------------------------------------
Registry               https://registry.platformio.org/platforms/platformio/nordicnrf52
Homepage               https://www.nordicsemi.com/Products/nRF52-Series-SoC
Repository             https://github.com/platformio/platform-nordicnrf52.git
License                Apache-2.0
Popularity             9
Stars                  97
Examples               12
Installed Size         3.87MB
Dependencies           17
Compatible Frameworks  arduino, mbed, zephyr
Keywords               dev-platform, arm, cortex-m, nordic semiconductor, nrf52
---------------------  ----------------------------------------------------------------

Version    Size      Published
---------  --------  -------------------
10.3.0     221.79KB  2023-12-27 12:36:37
10.2.0     221.67KB  2023-09-29 10:24:23
10.1.0     221.64KB  2023-07-28 11:31:53
10.0.0     220.89KB  2023-06-30 09:45:54
9.6.0      228.45KB  2023-03-28 11:51:07
9.5.0      228.38KB  2023-02-28 10:47:44
9.4.0      228.23KB  2022-05-30 15:54:02
9.3.0      232.17KB  2022-04-01 11:32:07
9.2.0      234.03KB  2022-01-28 13:19:39
8.2.0      232.42KB  2021-07-30 18:30:28
3.7.0      109.89KB  2019-09-02 09:56:05

By default the Arduino IDE uses the "-DUSE_LFSYNT" build option.

It would be nice is the build system for NRF52 would use this "-DUSE_LFSYNT" as the default otherwise many newbies like myself will continue to have trouble. At minimumit would be great if the doc mentions this issue such as here
https://docs.platformio.org/en/latest/platforms/nordicnrf52.html
or here
https://docs.platformio.org/en/latest/boards/nordicnrf52/bbcmicrobit_v2.html

@dennowiggle dennowiggle changed the title Default LFCLK Build Flag Setting on NRF52 Default Low Frequency Clock (LFCLK) Build Flag Setting on NRF52 Jan 8, 2024
@valeros valeros closed this as completed in a4c82fe Jan 9, 2024
@valeros
Copy link
Member

valeros commented Jan 9, 2024

Thanks for reporting, should be fixed in the development branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants