Skip to content

Commit 6d38ba4

Browse files
committed
boards/xg23-pk6068a: remove HFXO_FREQ and LFXO_FREQ
Prior to the use of Gecko SDK 4.5, RIOT shipped with patched vendor files, such as `system_xxx.c`. These system files included `periph_config.h`, which allowd one to redefine `HFXO_FREQ` and `LFXO_FREQ`. This was not intended, and other EFM32-based boards documented this to redefine this using compiler defines. After all, a board configuration is considered to be somewhat pre-defined and static. With the new Gecko SDK 4.5, this (unintended) feature got lost for the `xg23-pk6068a` board. To bring it in-line with the other boards, remove the defines, and document how it should be used. Within the codebase, `LFXO_FREQ` was used for ztimer configuration. Similar to the other boards, this has been replaced with a static value. Behind the scenes, the vendor `system_xxx.c` file will still use the same values.
1 parent 1caae60 commit 6d38ba4

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

boards/xg23-pk6068a/doc.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,23 @@ PIN 1 is the bottom-left contact when the header faces you horizontally.
9494
| LCD driver | LS013B7DH03 | yes | Sharp Low Power Memory LCD via the U8g2 package |
9595
| Temperature + humidity sensor | Si7021 | yes | Silicon Labs Temperature + Humidity sensor |
9696

97+
## Board configuration
98+
99+
### Clock selection
100+
There are several clock sources that are available for the different
101+
peripherals. You are advised to read [AN0004.0](https://www.silabs.com/documents/public/application-notes/an0004.0-efm32-cmu.pdf)
102+
to get familiar with the different clocks.
103+
104+
| Source | Internal | Speed | Comments |
105+
|--------|----------|------------|------------------------------------|
106+
| HFXO | No | 39 MHz | |
107+
| LFXO | No | 32.768 kHz | |
108+
109+
It is important that the clock speeds are known to the code, for proper
110+
calculations of speeds and baud rates. If the HFXO or LFXO are different from
111+
the speeds above, ensure to pass `HFXO_FREQ=freq_in_hz` and
112+
`LFXO_FREQ=freq_in_hz` to your compiler defines.
113+
97114
## Flashing the device
98115
To flash, [SEGGER JLink](https://www.segger.com/jlink-software.html) is
99116
required.

boards/xg23-pk6068a/include/board.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern "C" {
3636
* @{
3737
*/
3838
#define CONFIG_ZTIMER_LPTIMER_DEV TIMER_DEV(1)
39-
#define CONFIG_ZTIMER_LPTIMER_FREQ LFXO_FREQ
39+
#define CONFIG_ZTIMER_LPTIMER_FREQ (32768UL)
4040
#define CONFIG_ZTIMER_LPTIMER_WIDTH 24
4141
#define CONFIG_ZTIMER_LPTIMER_BLOCK_PM_MODE EFM32_PM_MODE_EM3
4242
/** @} */

boards/xg23-pk6068a/include/periph_conf.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ extern "C" {
2828
* @name Clock configuration
2929
* @{
3030
*/
31-
#define HFXO_FREQ (39000000UL)
3231
#define CMU_HFXOINIT CMU_HFXOINIT_DEFAULT
33-
34-
#define LFXO_FREQ (32768UL)
3532
#define CMU_LFXOINIT CMU_LFXOINIT_DEFAULT
3633

3734
static const clk_mux_t clk_mux_config[] = {

0 commit comments

Comments
 (0)