Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions drivers/pwm/pwm_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@

LOG_MODULE_REGISTER(pwm_nrfx, CONFIG_PWM_LOG_LEVEL);

/* NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED can be undefined or defined
/* NRF52_ERRATA_109_ENABLE_WORKAROUND can be undefined or defined
* to 0 or 1, hence the use of #if IS_ENABLED().
*/
#if IS_ENABLED(NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED)
#if IS_ENABLED(NRF52_ERRATA_109_ENABLE_WORKAROUND)
#define ANOMALY_109_EGU_IRQ_CONNECT(idx) _EGU_IRQ_CONNECT(idx)
#define _EGU_IRQ_CONNECT(idx) \
extern void nrfx_egu_##idx##_irq_handler(void); \
Expand Down
27 changes: 23 additions & 4 deletions modules/hal_nordic/nrfx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,35 @@ if(NOT DEFINED NRFX_DIR)
set(NRFX_DIR ${ZEPHYR_CURRENT_MODULE_DIR}/nrfx CACHE PATH "nrfx Directory")
endif()

if(NOT DEFINED CONFIG_SOC_NORDIC_BSP_NAME)
message(FATAL_ERROR "CONFIG_SOC_NORDIC_BSP_NAME has to be defined.")
endif()

set(INC_DIR ${NRFX_DIR}/drivers/include)
set(SRC_DIR ${NRFX_DIR}/drivers/src)
set(MDK_DIR ${NRFX_DIR}/mdk)
set(BSP_DIR ${NRFX_DIR}/bsp)
set(HELPERS_DIR ${NRFX_DIR}/helpers)
set(SOC_DIR ${BSP_DIR}/${CONFIG_SOC_NORDIC_BSP_NAME})
set(MDK_DIR ${SOC_DIR}/mdk)

if(NOT CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable")
zephyr_compile_definitions(NRFX_BSP_NRF_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/mdk/nrf.h")
zephyr_compile_definitions(NRFX_BSP_ERRATAS_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/mdk/nrf_erratas.h")
zephyr_compile_definitions(NRFX_BSP_SOC_IRQS_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/soc/nrfx_irqs.h")
zephyr_compile_definitions(NRFX_BSP_NRFX_EXT_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/nrfx_ext.h")
zephyr_compile_definitions(NRFX_BSP_NRFX_COREDEP_PATH="${CONFIG_SOC_NORDIC_BSP_NAME}/soc/nrfx_coredep_defs.h")
endif()

zephyr_include_directories(${NRFX_DIR})
zephyr_include_directories(${INC_DIR})
zephyr_include_directories(${BSP_DIR})
zephyr_include_directories(${SOC_DIR})
zephyr_include_directories(${SOC_DIR}/templates)
zephyr_include_directories(${MDK_DIR})
zephyr_include_directories(.)

include(${SOC_DIR}/zephyr/nrfx.cmake OPTIONAL)

# Define MDK defines globally
zephyr_compile_definitions_ifdef(CONFIG_SOC_SERIES_NRF51X NRF51)
zephyr_compile_definitions_ifdef(CONFIG_SOC_NRF51822_QFAA NRF51422_XXAA)
Expand Down Expand Up @@ -215,13 +234,13 @@ endif()

if(CONFIG_SOC_COMPATIBLE_NRF54LX AND CONFIG_NRFX_GPPI)
zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib_lumos.c)
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c)
zephyr_library_sources(${SOC_DIR}/soc/interconnect/dppic_ppib/nrfx_interconnect_dppic_ppib.c)
endif()

if(CONFIG_SOC_SERIES_NRF54HX AND CONFIG_NRFX_GPPI)
zephyr_library_sources(${HELPERS_DIR}/nrfx_gppi_dppi_ppib.c)
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c)
zephyr_library_sources(${NRFX_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c)
zephyr_library_sources(${SOC_DIR}/soc/interconnect/apb/nrfx_interconnect_apb.c)
zephyr_library_sources(${SOC_DIR}/soc/interconnect/ipct/nrfx_interconnect_ipct.c)
endif()

# Get the SVD file for the current SoC
Expand Down
80 changes: 1 addition & 79 deletions modules/hal_nordic/nrfx/nrfx_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,83 +29,5 @@
#endif

/* Use defaults for undefined symbols. */
#include <templates/nrfx_config_common.h>
#if defined(NRF51)
#include <templates/nrfx_config_nrf51.h>
#elif defined(NRF52805_XXAA)
#include <templates/nrfx_config_nrf52805.h>
#elif defined(NRF52810_XXAA)
#include <templates/nrfx_config_nrf52810.h>
#elif defined(NRF52811_XXAA)
#include <templates/nrfx_config_nrf52811.h>
#elif defined(NRF52820_XXAA)
#include <templates/nrfx_config_nrf52820.h>
#elif defined(NRF52832_XXAA) || defined (NRF52832_XXAB)
#include <templates/nrfx_config_nrf52832.h>
#elif defined(NRF52833_XXAA)
#include <templates/nrfx_config_nrf52833.h>
#elif defined(NRF52840_XXAA)
#include <templates/nrfx_config_nrf52840.h>
#elif defined(NRF5340_XXAA_APPLICATION)
#include <templates/nrfx_config_nrf5340_application.h>
#elif defined(NRF5340_XXAA_NETWORK)
#include <templates/nrfx_config_nrf5340_network.h>
#elif defined(NRF54H20_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf54h20_application.h>
#elif defined(NRF54H20_XXAA) && defined(NRF_RADIOCORE)
#include <templates/nrfx_config_nrf54h20_radiocore.h>
#elif defined(NRF54H20_XXAA) && defined(NRF_PPR)
#include <templates/nrfx_config_nrf54h20_ppr.h>
#elif defined(NRF54H20_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf54h20_flpr.h>
#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf54h20_enga_application.h>
#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_RADIOCORE)
#include <templates/nrfx_config_nrf54h20_enga_radiocore.h>
#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_PPR)
#include <templates/nrfx_config_nrf54h20_enga_ppr.h>
#elif defined(NRF54H20_ENGA_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf54h20_enga_flpr.h>
#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf54h20_engb_application.h>
#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_RADIOCORE)
#include <templates/nrfx_config_nrf54h20_engb_radiocore.h>
#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_PPR)
#include <templates/nrfx_config_nrf54h20_engb_ppr.h>
#elif defined(NRF54H20_ENGB_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf54h20_engb_flpr.h>
#elif defined(NRF54L05_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf54l05_application.h>
#elif defined(NRF54L05_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf54l05_flpr.h>
#elif defined(NRF54L10_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf54l10_application.h>
#elif defined(NRF54L10_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf54l10_flpr.h>
#elif defined(NRF54L15_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf54l15_application.h>
#elif defined(NRF54L15_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf54l15_flpr.h>
#elif defined(NRF54LM20A_ENGA_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf54lm20a_enga_application.h>
#elif defined(NRF54LM20A_ENGA_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf54lm20a_enga_flpr.h>
#elif defined(NRF54LV10A_ENGA_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf54lv10a_enga_application.h>
#elif defined(NRF54LV10A_ENGA_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf54lv10a_enga_flpr.h>
#elif defined(NRF9120_XXAA) || defined(NRF9160_XXAA)
#include <templates/nrfx_config_nrf91.h>
#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_APPLICATION)
#include <templates/nrfx_config_nrf9230_engb_application.h>
#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_RADIOCORE)
#include <templates/nrfx_config_nrf9230_engb_radiocore.h>
#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_PPR)
#include <templates/nrfx_config_nrf9230_engb_ppr.h>
#elif defined(NRF9230_ENGB_XXAA) && defined(NRF_FLPR)
#include <templates/nrfx_config_nrf9230_engb_flpr.h>
#else
#include "nrfx_config_ext.h"
#endif

#include "nrfx_templates_config.h"
#endif // NRFX_CONFIG_H__
11 changes: 4 additions & 7 deletions modules/hal_nordic/nrfx/nrfx_kconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
#ifdef CONFIG_NRFX_SPIM3
#define NRFX_SPIM3_ENABLED 1
#ifdef CONFIG_NRF52_ANOMALY_198_WORKAROUND
#define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 1
#define NRF52_ERRATA_198_ENABLE_WORKAROUND 1
#endif
#endif
#ifdef CONFIG_NRFX_SPIM4
Expand Down Expand Up @@ -806,10 +806,10 @@
#define NRFX_TWIM137_ENABLED 1
#endif
#ifdef CONFIG_NRF52_ANOMALY_219_WORKAROUND
#define NRFX_TWIM_NRF52_ANOMALY_219_WORKAROUND_ENABLED 1
#define NRF52_ERRATA_219_ENABLE_WORKAROUND 1
#endif
#ifdef CONFIG_SOC_NRF53_ANOMALY_47_WORKAROUND
#define NRFX_TWIM_NRF53_ANOMALY_47_WORKAROUND_ENABLED 1
#define NRF53_ERRATA_47_ENABLE_WORKAROUND 1
#endif

#ifdef CONFIG_NRFX_TWIS
Expand Down Expand Up @@ -1007,10 +1007,7 @@
#endif

#ifdef CONFIG_NRF52_ANOMALY_109_WORKAROUND
#define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
#define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
#define NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED 1
#define NRF52_ERRATA_109_ENABLE_WORKAROUND 1
#define NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE \
CONFIG_NRF52_ANOMALY_109_WORKAROUND_EGU_INSTANCE
#endif
Expand Down
10 changes: 8 additions & 2 deletions samples/boards/nordic/nrfx_prs/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,15 @@ static bool uarte_transfer(const uint8_t *tx_data, size_t tx_data_len,
{
nrfx_err_t err;

err = nrfx_uarte_rx(&uarte, rx_buf, rx_buf_size);
err = nrfx_uarte_rx_buffer_set(&uarte, rx_buf, rx_buf_size);
if (err != NRFX_SUCCESS) {
printk("nrfx_uarte_rx() failed: 0x%08x\n", err);
printk("nrfx_uarte_rx_buffer_set() failed: 0x%08x\n", err);
return false;
}

err = nrfx_uarte_rx_enable(&uarte, NRFX_UARTE_RX_ENABLE_STOP_ON_END);
if (err != NRFX_SUCCESS) {
printk("nrfx_uarte_rx_enable() failed: 0x%08x\n", err);
return false;
}

Expand Down
5 changes: 4 additions & 1 deletion soc/nordic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ if(CONFIG_BUILD_WITH_TFM)
)
endif()

add_subdirectory(${SOC_SERIES})
if(CONFIG_SOC_NORDIC_BSP_NAME STREQUAL "stable")
add_subdirectory(${SOC_SERIES})
endif()

add_subdirectory(common)
add_subdirectory_ifdef(CONFIG_NRF_IRONSIDE ironside)
4 changes: 4 additions & 0 deletions soc/nordic/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ config SOC_FAMILY_NORDIC_NRF

if SOC_FAMILY_NORDIC_NRF

config SOC_NORDIC_BSP_NAME
string
default "stable"

rsource "common/Kconfig.peripherals"
rsource "*/Kconfig"

Expand Down
2 changes: 1 addition & 1 deletion soc/nordic/nrf54h/bicr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if(CONFIG_SOC_NRF54H20_GENERATE_BICR)
set(bicr_json_file ${BOARD_DIR}/bicr.json)
set(bicr_hex_file ${PROJECT_BINARY_DIR}/bicr.hex)
set(svd_file ${ZEPHYR_HAL_NORDIC_MODULE_DIR}/nrfx/mdk/nrf54h20_application.svd)
set(svd_file ${ZEPHYR_BASE}/../nrfx/bsp/stable/mdk/nrf54h20_application.svd)

if(EXISTS ${bicr_json_file})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${bicr_json_file})
Expand Down
Loading