Skip to content

Commit

Permalink
mcu/nordic: Require LF clock source to be specified
Browse files Browse the repository at this point in the history
This is typically specified by BSP and omitting to do so is an error.
Also, if BLE controller is enabled restrict it to not allow to set
it to LFRC (which doesn't have required precission).
  • Loading branch information
sjanc committed Sep 26, 2023
1 parent 79a45ea commit 1bc4cdd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hw/mcu/nordic/nrf51xxx/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ syscfg.defs:
description: >
Selected source for low frequency clock (LFCLK).
value:
restrictions:
- $notnull
choices:
- LFRC # 32.768 kHz RC oscillator
- LFXO # 32.768 kHz crystal oscillator
Expand Down Expand Up @@ -143,3 +145,6 @@ syscfg.vals.XTAL_RC:
MCU_LFCLK_SOURCE: LFRC
syscfg.vals.XTAL_32768_SYNTH:
MCU_LFCLK_SOURCE: LFSYNTH

syscfg.restrictions.BLE_CONTROLLER:
- 'MCU_LFCLK_SOURCE != "LFRC"'
5 changes: 5 additions & 0 deletions hw/mcu/nordic/nrf52xxx/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ syscfg.defs:
description: >
Selected source for low frequency clock (LFCLK).
value:
restrictions:
- $notnull
choices:
- LFRC # 32.768 kHz RC oscillator
- LFXO # 32.768 kHz crystal oscillator
Expand Down Expand Up @@ -500,3 +502,6 @@ syscfg.restrictions:
- "!UART_0 || (UART_0_PIN_TX && UART_0_PIN_RX)"
- "!UART_1 || (UART_1_PIN_TX && UART_1_PIN_RX)"
- "(OS_TICKS_PER_SEC == 128 || OS_TICKS_PER_SEC == 256 || OS_TICKS_PER_SEC == 512 || OS_TICKS_PER_SEC == 1024)"

syscfg.restrictions.BLE_CONTROLLER:
- 'MCU_LFCLK_SOURCE != "LFRC"'
2 changes: 2 additions & 0 deletions hw/mcu/nordic/nrf5340/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ syscfg.defs:
description: >
Selected source for low frequency clock (LFCLK).
value:
restrictions:
- $notnull
choices:
- LFRC # 32.768 kHz RC oscillator
- LFXO # 32.768 kHz crystal oscillator
Expand Down
5 changes: 5 additions & 0 deletions hw/mcu/nordic/nrf5340_net/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ syscfg.defs:
description: >
Selected source for low frequency clock (LFCLK).
value:
restrictions:
- $notnull
choices:
- LFRC # 32.768 kHz RC oscillator
- LFXO # 32.768 kHz crystal oscillator
Expand Down Expand Up @@ -158,3 +160,6 @@ syscfg.vals:

syscfg.restrictions:
- "!UART_0 || (UART_0_PIN_TX && UART_0_PIN_RX)"

syscfg.restrictions.BLE_CONTROLLER:
- 'MCU_LFCLK_SOURCE != "LFRC"'
2 changes: 2 additions & 0 deletions hw/mcu/nordic/nrf91xx/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ syscfg.defs:
description: >
Selected source for low frequency clock (LFCLK).
value:
restrictions:
- $notnull
choices:
- LFRC # 32.768 kHz RC oscillator
- LFXO # 32.768 kHz crystal oscillator
Expand Down

0 comments on commit 1bc4cdd

Please sign in to comment.