Skip to content

Commit cbca99d

Browse files
authored
Merge pull request #12160 from AGlass0fMilk/fix-prs-config
nRF52: Properly configure nRF SDK for nRF52-series targets
2 parents f4842c7 + d8fbfbf commit cbca99d

File tree

7 files changed

+133
-68
lines changed

7 files changed

+133
-68
lines changed

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x/stack/sources/pal_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static struct
5252
PalUartConfig_t config; /*!< PAL UART configuration. */
5353
PalUartState_t state; /*!< PAL UART state. */
5454
nrfx_uarte_t uart; /*!< NRF UART driver instance */
55-
} palUartCb[UART0_ENABLED + UART1_ENABLED] = {{0, {0}, 0, {NRF_UARTE0, NRFX_UARTE0_INST_IDX}}};
55+
} palUartCb[NRFX_UARTE0_ENABLED + NRFX_UARTE1_ENABLED] = {{0, {0}, 0, {NRF_UARTE0, NRFX_UARTE0_INST_IDX}}};
5656

5757
/**************************************************************************************************
5858
Local Functions

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/config/sdk_config.h

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3804,20 +3804,20 @@
38043804
// <e> NRFX_TWIM_ENABLED - nrfx_twim - TWIM peripheral driver
38053805
//==========================================================
38063806
#ifndef NRFX_TWIM_ENABLED
3807-
#define NRFX_TWIM_ENABLED 1
3807+
#define NRFX_TWIM_ENABLED 0
38083808
#endif
38093809
// <q> NRFX_TWIM0_ENABLED - Enable TWIM0 instance
38103810

38113811

38123812
#ifndef NRFX_TWIM0_ENABLED
3813-
#define NRFX_TWIM0_ENABLED 1
3813+
#define NRFX_TWIM0_ENABLED 0
38143814
#endif
38153815

38163816
// <q> NRFX_TWIM1_ENABLED - Enable TWIM1 instance
38173817

38183818

38193819
#ifndef NRFX_TWIM1_ENABLED
3820-
#define NRFX_TWIM1_ENABLED 1
3820+
#define NRFX_TWIM1_ENABLED 0
38213821
#endif
38223822

38233823
// <o> NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY - Frequency
@@ -4038,9 +4038,45 @@
40384038

40394039
// </e>
40404040

4041+
// <e> NRFX_PRS_ENABLED - nrfx_prs - Peripheral Resource Sharing module
4042+
//==========================================================
40414043
#ifndef NRFX_PRS_ENABLED
40424044
#define NRFX_PRS_ENABLED 1
40434045
#endif
4046+
// <q> NRFX_PRS_BOX_0_ENABLED - Enables box 0 in the module.
4047+
4048+
4049+
#ifndef NRFX_PRS_BOX_0_ENABLED
4050+
#define NRFX_PRS_BOX_0_ENABLED 1
4051+
#endif
4052+
4053+
// <q> NRFX_PRS_BOX_1_ENABLED - Enables box 1 in the module.
4054+
4055+
4056+
#ifndef NRFX_PRS_BOX_1_ENABLED
4057+
#define NRFX_PRS_BOX_1_ENABLED 1
4058+
#endif
4059+
4060+
// <q> NRFX_PRS_BOX_2_ENABLED - Enables box 2 in the module.
4061+
4062+
4063+
#ifndef NRFX_PRS_BOX_2_ENABLED
4064+
#define NRFX_PRS_BOX_2_ENABLED 1
4065+
#endif
4066+
4067+
// <q> NRFX_PRS_BOX_3_ENABLED - Enables box 3 in the module.
4068+
4069+
4070+
#ifndef NRFX_PRS_BOX_3_ENABLED
4071+
#define NRFX_PRS_BOX_3_ENABLED 1
4072+
#endif
4073+
4074+
// <q> NRFX_PRS_BOX_4_ENABLED - Enables box 4 in the module.
4075+
4076+
4077+
#ifndef NRFX_PRS_BOX_4_ENABLED
4078+
#define NRFX_PRS_BOX_4_ENABLED 1
4079+
#endif
40444080

40454081
// </e>
40464082

@@ -4278,11 +4314,11 @@
42784314
// <e> NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver
42794315
//==========================================================
42804316
#ifndef NRFX_UART_ENABLED
4281-
#define NRFX_UART_ENABLED 1
4317+
#define NRFX_UART_ENABLED 0
42824318
#endif
42834319
// <o> NRFX_UART0_ENABLED - Enable UART0 instance
42844320
#ifndef NRFX_UART0_ENABLED
4285-
#define NRFX_UART0_ENABLED 1
4321+
#define NRFX_UART0_ENABLED 0
42864322
#endif
42874323

42884324
// <o> NRFX_UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control
@@ -5595,13 +5631,13 @@
55955631

55965632

55975633
#ifndef UART_LEGACY_SUPPORT
5598-
#define UART_LEGACY_SUPPORT 1
5634+
#define UART_LEGACY_SUPPORT 0
55995635
#endif
56005636

56015637
// <e> UART0_ENABLED - Enable UART0 instance
56025638
//==========================================================
56035639
#ifndef UART0_ENABLED
5604-
#define UART0_ENABLED 1
5640+
#define UART0_ENABLED 0
56055641
#endif
56065642
// <q> UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA
56075643

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/config/sdk_config.h

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3804,20 +3804,20 @@
38043804
// <e> NRFX_TWIM_ENABLED - nrfx_twim - TWIM peripheral driver
38053805
//==========================================================
38063806
#ifndef NRFX_TWIM_ENABLED
3807-
#define NRFX_TWIM_ENABLED 1
3807+
#define NRFX_TWIM_ENABLED 0
38083808
#endif
38093809
// <q> NRFX_TWIM0_ENABLED - Enable TWIM0 instance
38103810

38113811

38123812
#ifndef NRFX_TWIM0_ENABLED
3813-
#define NRFX_TWIM0_ENABLED 1
3813+
#define NRFX_TWIM0_ENABLED 0
38143814
#endif
38153815

38163816
// <q> NRFX_TWIM1_ENABLED - Enable TWIM1 instance
38173817

38183818

38193819
#ifndef NRFX_TWIM1_ENABLED
3820-
#define NRFX_TWIM1_ENABLED 1
3820+
#define NRFX_TWIM1_ENABLED 0
38213821
#endif
38223822

38233823
// <o> NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY - Frequency
@@ -4040,9 +4040,47 @@
40404040

40414041
// </e>
40424042

4043+
// <e> NRFX_PRS_ENABLED - nrfx_prs - Peripheral Resource Sharing module
4044+
//==========================================================
40434045
#ifndef NRFX_PRS_ENABLED
40444046
#define NRFX_PRS_ENABLED 1
40454047
#endif
4048+
// <q> NRFX_PRS_BOX_0_ENABLED - Enables box 0 in the module.
4049+
4050+
4051+
#ifndef NRFX_PRS_BOX_0_ENABLED
4052+
#define NRFX_PRS_BOX_0_ENABLED 1
4053+
#endif
4054+
4055+
// <q> NRFX_PRS_BOX_1_ENABLED - Enables box 1 in the module.
4056+
4057+
4058+
#ifndef NRFX_PRS_BOX_1_ENABLED
4059+
#define NRFX_PRS_BOX_1_ENABLED 1
4060+
#endif
4061+
4062+
// <q> NRFX_PRS_BOX_2_ENABLED - Enables box 2 in the module.
4063+
4064+
4065+
#ifndef NRFX_PRS_BOX_2_ENABLED
4066+
#define NRFX_PRS_BOX_2_ENABLED 1
4067+
#endif
4068+
4069+
// <q> NRFX_PRS_BOX_3_ENABLED - Enables box 3 in the module.
4070+
4071+
4072+
#ifndef NRFX_PRS_BOX_3_ENABLED
4073+
#define NRFX_PRS_BOX_3_ENABLED 1
4074+
#endif
4075+
4076+
// <q> NRFX_PRS_BOX_4_ENABLED - Enables box 4 in the module.
4077+
4078+
4079+
#ifndef NRFX_PRS_BOX_4_ENABLED
4080+
#define NRFX_PRS_BOX_4_ENABLED 1
4081+
#endif
4082+
4083+
// </e>
40464084

40474085
// <e> NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver
40484086
//==========================================================
@@ -4278,11 +4316,11 @@
42784316
// <e> NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver
42794317
//==========================================================
42804318
#ifndef NRFX_UART_ENABLED
4281-
#define NRFX_UART_ENABLED 1
4319+
#define NRFX_UART_ENABLED 0
42824320
#endif
42834321
// <o> NRFX_UART0_ENABLED - Enable UART0 instance
42844322
#ifndef NRFX_UART0_ENABLED
4285-
#define NRFX_UART0_ENABLED 1
4323+
#define NRFX_UART0_ENABLED 0
42864324
#endif
42874325

42884326
// <o> NRFX_UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control
@@ -5607,13 +5645,13 @@
56075645

56085646

56095647
#ifndef UART_LEGACY_SUPPORT
5610-
#define UART_LEGACY_SUPPORT 1
5648+
#define UART_LEGACY_SUPPORT 0
56115649
#endif
56125650

56135651
// <e> UART0_ENABLED - Enable UART0 instance
56145652
//==========================================================
56155653
#ifndef UART0_ENABLED
5616-
#define UART0_ENABLED 1
5654+
#define UART0_ENABLED 0
56175655
#endif
56185656
// <q> UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA
56195657

@@ -5627,7 +5665,7 @@
56275665
// <e> UART1_ENABLED - Enable UART1 instance
56285666
//==========================================================
56295667
#ifndef UART1_ENABLED
5630-
#define UART1_ENABLED 1
5668+
#define UART1_ENABLED 0
56315669
#endif
56325670
// </e>
56335671

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/objects.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
extern "C" {
5353
#endif
5454

55-
#include "nrf_uart.h"
55+
#include "nrf_uarte.h"
5656

5757
#if defined(FEATURE_CRYPTOCELL310)
5858
#include "objects_cryptocell.h"
@@ -68,9 +68,9 @@ struct serial_s {
6868
uint32_t rx;
6969
uint32_t cts;
7070
uint32_t rts;
71-
nrf_uart_hwfc_t hwfc;
72-
nrf_uart_parity_t parity;
73-
nrf_uart_baudrate_t baudrate;
71+
nrf_uarte_hwfc_t hwfc;
72+
nrf_uarte_parity_t parity;
73+
nrf_uarte_baudrate_t baudrate;
7474
uint32_t context;
7575
uint32_t handler;
7676
uint32_t mask;

0 commit comments

Comments
 (0)