WXK
2024-12-16 78e84fcf264afd731cd66c807d9fcb690fe12126
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#
 
syscfg.defs:
    MCU_TARGET:
        description: >
            Specifies target MCU, shall be set by BSP.
        value:
        restrictions:
            - $notnull
        choices:
            - nRF52810
            - nRF52811
            - nRF52832
            - nRF52840
 
    MCU_FLASH_MIN_WRITE_SIZE:
        description: >
            Specifies the required alignment for internal flash writes.
            Used internally by the newt tool.
        value: 1
 
    MCU_DCDC_ENABLED:
        description: >
            Specifies whether or not to enable DC/DC regulator. This requires
            external circuitry so is defined to be zero by default and
            expected to be overridden by the BSP.
        value: 0
 
    MCU_HFCLK_SOURCE:
        description: >
            Selected source for high frequency clock (HFCLK).
            Selecting HFXO will still mostly use the HFINT but will switch to HFXO when requested (BLE, certain timers, etc...)
            Selecting HFINT should only be used in the case where an external 32MHz crystal oscillator is not present.
        value: HFXO
        choices:
            - HFXO
            - HFINT
        restrictions:
            - '(MCU_HFCLK_SOURCE == "HFXO") || (MCU_LFCLK_SOURCE != "LFSYNTH")'
 
    MCU_LFCLK_SOURCE:
        description: >
            Selected source for low frequency clock (LFCLK).
        value:
        choices:
            - LFRC      # 32.768 kHz RC oscillator
            - LFXO      # 32.768 kHz crystal oscillator
            - LFSYNTH   # 32.768 kHz synthesized from HFCLK
 
    MCU_I2C_RECOVERY_DELAY_USEC:
        description: >
            Time to wait for activity on SCL line after triggering start task
            before restarting TWI controller. This is to recover from state
            where controller is unresponsive due to glitch on I2C bus.
            Note: Default value seems to work fine, but may need to be tuned.
        value: 100
 
    MCU_BUS_DRIVER_I2C_USE_TWIM:
        description: >
            Enables usage of i2c_nrf52_twim bus driver for I2C.
            If disabled, standard i2c_hal driver is used.
        value: 0
 
    MCU_GPIO_USE_PORT_EVENT:
        description: >
            When enabled, hal_gpio will use GPIOTE PORT event instead of PIN
            events for interrupts. This mode may be less accurate (i.e. pulse
            length needs to be longer in order to be detected) but it reduces
            power consumption since it does not require HFCLK to be running.
            Refer to nRF52xxx Product Specification document for more details.
        value: 0
 
    MCU_DEBUG_IGNORE_BKPT:
       description: >
            When enabled, asm(bkpt) will be ignored. If not set, it will hit
            the breakpoint wherever it gets called, For example, reset and crash
       value: 0
 
 
# MCU peripherals definitions
    I2C_0:
        description: 'Enable nRF52xxx I2C (TWI) 0'
        value: 0
        restrictions:
            - '!(SPI_0_MASTER && ((MCU_TARGET == "nrf52832") || (MCU_TARGET == "nrf52840")))'
            - '!(SPI_0_SLAVE  && ((MCU_TARGET == "nrf52832") || (MCU_TARGET == "nrf52840")))'
            - '!(SPI_1_MASTER && (MCU_TARGET == "nrf52811"))'
            - '!(SPI_1_SLAVE  && (MCU_TARGET == "nrf52811"))'
    I2C_0_PIN_SCL:
        description: 'SCL pin for I2C_0'
        value: ''
    I2C_0_PIN_SDA:
        description: 'SDA pin for I2C_0'
        value: ''
    I2C_0_FREQ_KHZ:
        description: 'Frequency [kHz] for I2C_0'
        value: 100
 
    I2C_1:
        description: 'Enable nRF52xxx I2C (TWI) 1'
        value: 0
        restrictions:
            - "!SPI_1_MASTER"
            - "!SPI_1_SLAVE"
    I2C_1_PIN_SCL:
        description: 'SCL pin for I2C_1'
        value: ''
    I2C_1_PIN_SDA:
        description: 'SDA pin for I2C_1'
        value: ''
    I2C_1_FREQ_KHZ:
        description: 'Frequency [kHz] for I2C_1'
        value: 100
 
    SPI_0_MASTER:
        description: 'Enable nRF52xxx SPI Master 0'
        value: 0
        restrictions:
            - "!SPI_0_SLAVE"
            - '!(I2C_0 && ((MCU_TARGET == "nrf52832") || (MCU_TARGET == "nrf52840")))'
    SPI_0_MASTER_PIN_SCK:
        description: 'SCK pin for SPI_0_MASTER'
        value: ''
    SPI_0_MASTER_PIN_MOSI:
        description: 'MOSI pin for SPI_0_MASTER'
        value: ''
    SPI_0_MASTER_PIN_MISO:
        description: 'MISO pin for SPI_0_MASTER'
        value: ''
 
    SPI_0_SLAVE:
        description: 'Enable nRF52xxx SPI Slave 0'
        value: 0
        restrictions:
            - "!SPI_0_MASTER"
            - '!(I2C_0 && ((MCU_TARGET == "nrf52832") || (MCU_TARGET == "nrf52840")))'
    SPI_0_SLAVE_PIN_SCK:
        description: 'SCK pin for SPI_0_SLAVE'
        value: ''
    SPI_0_SLAVE_PIN_MOSI:
        description: 'MOSI pin for SPI_0_SLAVE'
        value: ''
    SPI_0_SLAVE_PIN_MISO:
        description: 'MISO pin for SPI_0_SLAVE'
        value: ''
    SPI_0_SLAVE_PIN_SS:
        description: 'SS pin for SPI_0_SLAVE'
        value: ''
 
    SPI_1_MASTER:
        description: 'Enable nRF52xxx SPI Master 1'
        value: 0
        restrictions:
            - "!SPI_1_SLAVE"
            - '!(I2C_1 && ((MCU_TARGET == "nrf52832") || (MCU_TARGET == "nrf52840")))'
            - '!(I2C_0 && ((MCU_TARGET == "nrf52811")))'
    SPI_1_MASTER_PIN_SCK:
        description: 'SCK pin for SPI_1_MASTER'
        value: ''
    SPI_1_MASTER_PIN_MOSI:
        description: 'MOSI pin for SPI_1_MASTER'
        value: ''
    SPI_1_MASTER_PIN_MISO:
        description: 'MISO pin for SPI_1_MASTER'
        value: ''
 
    SPI_1_SLAVE:
        description: 'Enable nRF52xxx SPI Slave 1'
        value: 0
        restrictions:
            - "!SPI_1_MASTER"
            - '!(I2C_1 && ((MCU_TARGET == "nrf52832") || (MCU_TARGET == "nrf52840")))'
            - '!(I2C_0 && ((MCU_TARGET == "nrf52811")))'
    SPI_1_SLAVE_PIN_SCK:
        description: 'SCK pin for SPI_1_SLAVE'
        value: ''
    SPI_1_SLAVE_PIN_MOSI:
        description: 'MOSI pin for SPI_1_SLAVE'
        value: ''
    SPI_1_SLAVE_PIN_MISO:
        description: 'MISO pin for SPI_1_SLAVE'
        value: ''
    SPI_1_SLAVE_PIN_SS:
        description: 'SS pin for SPI_1_SLAVE'
        value: ''
 
    SPI_2_MASTER:
        description: 'Enable nRF52xxx SPI Master 2'
        value: 0
        restrictions:
            - "!SPI_2_SLAVE"
    SPI_2_MASTER_PIN_SCK:
        description: 'SCK pin for SPI_2_MASTER'
        value: ''
    SPI_2_MASTER_PIN_MOSI:
        description: 'MOSI pin for SPI_2_MASTER'
        value: ''
    SPI_2_MASTER_PIN_MISO:
        description: 'MISO pin for SPI_2_MASTER'
        value: ''
 
    SPI_2_SLAVE:
        description: 'Enable nRF52xxx SPI Slave 2'
        value: 0
        restrictions:
            - "!SPI_2_MASTER"
    SPI_2_SLAVE_PIN_SCK:
        description: 'SCK pin for SPI_2_SLAVE'
        value: ''
    SPI_2_SLAVE_PIN_MOSI:
        description: 'MOSI pin for SPI_2_SLAVE'
        value: ''
    SPI_2_SLAVE_PIN_MISO:
        description: 'MISO pin for SPI_2_SLAVE'
        value: ''
    SPI_2_SLAVE_PIN_SS:
        description: 'SS pin for SPI_2_SLAVE'
        value: ''
 
    SPI_3_MASTER:
        description: 'Enable nRF52xxx SPI Master 3'
        value: 0
        restrictions:
            - 'MCU_TARGET == "nRF52840" || !SPI_3_MASTER'
    SPI_3_MASTER_PIN_SCK:
        description: 'SCK pin for SPI_3_MASTER'
        value: ''
    SPI_3_MASTER_PIN_MOSI:
        description: 'MOSI pin for SPI_3_MASTER'
        value: ''
    SPI_3_MASTER_PIN_MISO:
        description: 'MISO pin for SPI_3_MASTER'
        value: ''
 
    ADC_0:
        description: 'Enable nRF52xxx ADC 0'
        value:  0
 
    ADC_0_REFMV_0:
        description: 'reference mV in AREF0 if used'
        value: 0
 
    PWM_0:
        description: 'Enable nRF52xxx PWM 0'
        value: 0
    PWM_1:
        description: 'Enable nRF52xxx PWM 1'
        value: 0
    PWM_2:
        description: 'Enable nRF52xxx PWM 2'
        value: 0
    PWM_3:
        description: 'Enable nRF52xxx PWM 3'
        value: 0
        restrictions:
            - 'MCU_TARGET == "nRF52840" || !PWM_3'
 
    TRNG:
        description: 'Enable nRF52xxx TRNG'
        value: 0
 
    CRYPTO:
        description: 'Enable nRF52xxx CRYPTO'
        value: 0
 
    UART_0:
        description: 'Enable nRF52xxx UART0'
        value: 1
    UART_0_PIN_TX:
        description: 'TX pin for UART0'
        value: ''
    UART_0_PIN_RX:
        description: 'RX pin for UART0'
        value: ''
    UART_0_PIN_RTS:
        description: 'RTS pin for UART0'
        value: -1
    UART_0_PIN_CTS:
        description: 'CTS pin for UART0'
        value: -1
 
    UART_1:
        description: 'Enable nRF52xxx UART1'
        value: 0
        restrictions:
            - 'MCU_TARGET == "nRF52840" || !UART_1'
    UART_1_PIN_TX:
        description: 'TX pin for UART1'
        value: ''
    UART_1_PIN_RX:
        description: 'RX pin for UART1'
        value: ''
    UART_1_PIN_RTS:
        description: 'RTS pin for UART1'
        value: -1
    UART_1_PIN_CTS:
        description: 'CTS pin for UART1'
        value: -1
 
    TEMP:
        description: 'Enable nRF52xxx internal temperature mesurement'
        value:  0
 
    TIMER_0:
        description: 'Enable nRF52xxx Timer 0'
        value:  1
    TIMER_1:
        description: 'Enable nRF52xxx Timer 1'
        value:  0
    TIMER_2:
        description: 'Enable nRF52xxx Timer 2'
        value:  0
    TIMER_3:
        description: 'Enable nRF52xxx Timer 3'
        value:  0
    TIMER_4:
        description: 'Enable nRF52xxx Timer 4'
        value:  0
    TIMER_5:
        description: 'Enable nRF52xxx RTC 0'
        value:  0
 
    QSPI_ENABLE:
        description: 'NRF52 QSPI'
        value: 0
 
    QSPI_READOC:
        description: >
            QSPI Command to use
            0 - 0x09 Fast Read
            1 - 0x3B Fast Read Dual Output
            2 - 0xBB Fast Read Dual I/O
            3 - 0x6B Fast Read Quad Output
            4 - 0xEB Fast Read Quad I/O
        value: 0
    QSPI_WRITEOC:
        description: >
            QSPI Command to use
            0 - 0x02 Page program
            1 - 0xA2 Page program Dual Data
            2 - 0x32 Page program Quad Data
            3 - 0x38 Page program Quad I/O
        value: 0
    QSPI_ADDRMODE:
        description: 'Address lentgh 0=24 bits, 1=32 bits'
        value: 0
    QSPI_DPMCONFIG:
        description: 'Deep power mode enable'
        value: 0
    QSPI_SCK_DELAY:
        description: >
            Minimum amount of time that the CSN pin must stay high
            before it can go low again. Value is specified in number of 16
            MHz periods (62.5 ns).
        value: 0
    QSPI_SCK_FREQ:
        description: '32MHz clock divider (0-31). Clock = 32MHz / (1+divider)'
        value: 0
    QSPI_SPI_MODE:
        description: 'SPI 0=Mode0 or 1=Mode3'
        value: 0
 
    QSPI_FLASH_SECTOR_SIZE:
        description: 'QSPI sector size. In most cases it should be 4096.'
        value: 0
    QSPI_FLASH_PAGE_SIZE:
        description: >
            QSPI page size. Writes can only be performed to one page at a time.
            In most cases it should be 256.
        value: 0
 
    QSPI_FLASH_SECTOR_COUNT:
        description: 'QSPI sector count'
        value: -1
    QSPI_PIN_CS:
        description: 'CS pin for QSPI'
        value: -1
    QSPI_PIN_SCK:
        description: 'SCK pin for QSPI'
        value: -1
    QSPI_PIN_DIO0:
        description: 'DIO0 pin for QSPI'
        value: -1
    QSPI_PIN_DIO1:
        description: 'DIO1 pin for QSPI'
        value: -1
    QSPI_PIN_DIO2:
        description: 'DIO2 pin for QSPI'
        value: -1
    QSPI_PIN_DIO3:
        description: 'DIO3 pin for QSPI'
        value: -1
 
    NFC_PINS_AS_GPIO:
        description: 'Use NFC pins as GPIOs instead of NFC functionality'
        value: 1
 
    GPIO_AS_PIN_RESET:
        description: 'Enable pin reset'
        value: 0
 
# Deprecated settings
 
    MCU_NRF52832:
        description: Use MCU_TARGET instead
        value: 0
        restrictions:
            - "!MCU_NRF52840"
        deprecated: 1
    MCU_NRF52840:
        description: Use MCU_TARGET instead
        value: 0
        restrictions:
            - "!MCU_NRF52832"
        deprecated: 1
 
    XTAL_32768:
        description: Use MCU_LFCLK_SOURCE instead
        value: 0
        restrictions:
            - "!XTAL_RC"
            - "!XTAL_32768_SYNTH"
        deprecated: 1
    XTAL_RC:
        description: Use MCU_LFCLK_SOURCE instead
        value: 0
        restrictions:
            - "!XTAL_32768"
            - "!XTAL_32768_SYNTH"
        deprecated: 1
    XTAL_32768_SYNTH:
        description: Use MCU_LFCLK_SOURCE instead
        value: 0
        restrictions:
            - "!XTAL_32768"
            - "!XTAL_RC"
        deprecated: 1
 
    MCU_NATIVE_USE_SIGNALS:
        description: >
            Whether to use POSIX signals to implement context switches.  Valid
            values are as follows:
                1: More correctness; less stability.  The OS tick timer will
                   cause a high-priority task to preempt a low-priority task.
                   This causes stability issues because a task can be preempted
                   while it is in the middle of a system call, potentially
                   causing deadlock or memory corruption.
 
                0: Less correctness; more stability.  The OS tick timer only
                   runs while the idle task is active.  Therefore, a sleeping
                   high-priority task will not preempt a low-priority task due
                   to a timing event (e.g., delay or callout expired).
                   However, this version of sim does not suffer from the
                   stability issues that affect the "signals" implementation.
 
            Unit tests should use 1.  Long-running sim processes should use 0.
 
        value: 1
    MCU_NATIVE:
        description: >
            Set to indicate that we are using native mcu.
        value: 1
    MCU_FLASH_STYLE_ST:
        description: Emulated flash layout is similar to one in STM32.
        value: 0
        restrictions:
            - "!MCU_FLASH_STYLE_NORDIC"
    MCU_FLASH_STYLE_NORDIC:
        description: >
            Emulated flash layout is similar to one in NRF51/2 and SAMD21.
        value: 1
        restrictions:
            - "!MCU_FLASH_STYLE_ST"
    MCU_UART_POLLER_PRIO:
        description: 'Priority of native UART poller task.'
        type: task_priority
        value: 1
    MCU_TIMER_POLLER_PRIO:
        description: 'Priority of native HAL timer task.'
        type: task_priority
        value: 0
 
syscfg.vals:
    OS_TICKS_PER_SEC: 128
 
syscfg.vals.MCU_NRF52832:
    MCU_TARGET: nRF52832
syscfg.vals.MCU_NRF52840:
    MCU_TARGET: nRF52840
 
syscfg.vals.XTAL_32768:
    MCU_LFCLK_SOURCE: LFXO
syscfg.vals.XTAL_RC:
    MCU_LFCLK_SOURCE: LFRC
syscfg.vals.XTAL_32768_SYNTH:
    MCU_LFCLK_SOURCE: LFSYNTH
 
syscfg.restrictions:
    - "!I2C_0 || (I2C_0_PIN_SCL && I2C_0_PIN_SDA)"
    - "!I2C_1 || (I2C_1_PIN_SCL && I2C_1_PIN_SDA)"
    - "!SPI_0_MASTER || (SPI_0_MASTER_PIN_SCK && SPI_0_MASTER_PIN_MOSI && SPI_0_MASTER_PIN_MISO)"
    - "!SPI_1_MASTER || (SPI_1_MASTER_PIN_SCK && SPI_1_MASTER_PIN_MOSI && SPI_1_MASTER_PIN_MISO)"
    - "!SPI_2_MASTER || (SPI_2_MASTER_PIN_SCK && SPI_2_MASTER_PIN_MOSI && SPI_2_MASTER_PIN_MISO)"
    - "!SPI_3_MASTER || (SPI_3_MASTER_PIN_SCK && SPI_3_MASTER_PIN_MOSI && SPI_3_MASTER_PIN_MISO)"
    - "!SPI_0_SLAVE || (SPI_0_SLAVE_PIN_SCK && SPI_0_SLAVE_PIN_MOSI && SPI_0_SLAVE_PIN_MISO && SPI_0_SLAVE_PIN_SS)"
    - "!SPI_1_SLAVE || (SPI_1_SLAVE_PIN_SCK && SPI_1_SLAVE_PIN_MOSI && SPI_1_SLAVE_PIN_MISO && SPI_1_SLAVE_PIN_SS)"
    - "!SPI_2_SLAVE || (SPI_2_SLAVE_PIN_SCK && SPI_2_SLAVE_PIN_MOSI && SPI_2_SLAVE_PIN_MISO && SPI_2_SLAVE_PIN_SS)"
    - "!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)"