summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2025-10-13 16:46:02 +0700
committerhathach <[email protected]>2025-10-13 16:46:02 +0700
commite0ee32ce6a1655de6dbb86178649c0ec878bd0d0 (patch)
treec052248f832035f9a7b0d5c352abaaf63d647c02 /hw
parent84f0cda013c83e8fa61c9d85f061f5f88cf30b9d (diff)
fix build with west zephyr
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/nrf/family.c49
-rw-r--r--hw/bsp/nrf/nrfx_config/nrfx_config_common.h2
-rw-r--r--hw/bsp/zephyr_board_aliases.cmake2
3 files changed, 28 insertions, 25 deletions
diff --git a/hw/bsp/nrf/family.c b/hw/bsp/nrf/family.c
index 6edeacd87..0221da083 100644
--- a/hw/bsp/nrf/family.c
+++ b/hw/bsp/nrf/family.c
@@ -66,20 +66,6 @@
#error "Example requires nrfx v3.0.0 or later"
#endif
-//--------------------------------------------------------------------+
-// Forward USB interrupt events to TinyUSB IRQ Handler
-//--------------------------------------------------------------------+
-#if defined(NRF54H20_XXAA)
-#define USBD_IRQn USBHS_IRQn
-void USBHS_IRQHandler(void) {
- tusb_int_handler(0, true);
-}
-
-#else
-void USBD_IRQHandler(void) {
- tud_int_handler(0);
-}
-#endif
/*------------------------------------------------------------------*/
/* MACRO TYPEDEF CONSTANT ENUM
@@ -92,18 +78,37 @@ enum {
USB_EVT_READY = 2
};
+// Forward USB interrupt events to TinyUSB IRQ Handler
+#if defined(NRF54H20_XXAA)
+#define USBD_IRQn USBHS_IRQn
+void USBHS_IRQHandler(void) {
+ tusb_int_handler(0, true);
+}
+
+static nrfx_uarte_t _uart_id = NRFX_UARTE_INSTANCE(120);
+
+#else
+
#ifdef NRF5340_XXAA
- #define LFCLK_SRC_RC CLOCK_LFCLKSRC_SRC_LFRC
- #define VBUSDETECT_Msk USBREG_USBREGSTATUS_VBUSDETECT_Msk
- #define OUTPUTRDY_Msk USBREG_USBREGSTATUS_OUTPUTRDY_Msk
- #define GPIOTE_IRQn GPIOTE1_IRQn
+#define LFCLK_SRC_RC CLOCK_LFCLKSRC_SRC_LFRC
+#define VBUSDETECT_Msk USBREG_USBREGSTATUS_VBUSDETECT_Msk
+#define OUTPUTRDY_Msk USBREG_USBREGSTATUS_OUTPUTRDY_Msk
+#define GPIOTE_IRQn GPIOTE1_IRQn
#else
- #define LFCLK_SRC_RC CLOCK_LFCLKSRC_SRC_RC
- #define VBUSDETECT_Msk POWER_USBREGSTATUS_VBUSDETECT_Msk
- #define OUTPUTRDY_Msk POWER_USBREGSTATUS_OUTPUTRDY_Msk
+#define LFCLK_SRC_RC CLOCK_LFCLKSRC_SRC_RC
+#define VBUSDETECT_Msk POWER_USBREGSTATUS_VBUSDETECT_Msk
+#define OUTPUTRDY_Msk POWER_USBREGSTATUS_OUTPUTRDY_Msk
#endif
-static nrfx_uarte_t _uart_id = NRFX_UARTE_INSTANCE(CFG_NRFX_UARTE_INSTANCE_ID);
+static nrfx_uarte_t _uart_id = NRFX_UARTE_INSTANCE(0);
+
+void USBD_IRQHandler(void) {
+ tud_int_handler(0);
+}
+#endif
+
+
+
// tinyusb function that handles power event (detected, ready, removed)
// We must call it within SD's SOC event handler, or set it as power event handler if SD is not enabled.
diff --git a/hw/bsp/nrf/nrfx_config/nrfx_config_common.h b/hw/bsp/nrf/nrfx_config/nrfx_config_common.h
index 1d75e5a66..a5a29bb8e 100644
--- a/hw/bsp/nrf/nrfx_config/nrfx_config_common.h
+++ b/hw/bsp/nrf/nrfx_config/nrfx_config_common.h
@@ -61,7 +61,6 @@
#if defined(NRF54H20_XXAA)
#define NRFX_UARTE120_ENABLED 1
-#define CFG_NRFX_UARTE_INSTANCE_ID 120
#else
@@ -69,7 +68,6 @@
#define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7
#define NRFX_UARTE0_ENABLED 1
-#define CFG_NRFX_UARTE_INSTANCE_ID 0
#define NRFX_GPIOTE_ENABLED 1
#define NRFX_GPIOTE0_ENABLED 1
diff --git a/hw/bsp/zephyr_board_aliases.cmake b/hw/bsp/zephyr_board_aliases.cmake
index b60e97ef4..a60068208 100644
--- a/hw/bsp/zephyr_board_aliases.cmake
+++ b/hw/bsp/zephyr_board_aliases.cmake
@@ -1,2 +1,2 @@
-set(pca10056_BOARD_ALIAS nrf52840dk/nrf52840)
+set(nrf52840dk_BOARD_ALIAS nrf52840dk/nrf52840)
set(stm32n657nucleo_BOARD_ALIAS nucleo_n657x0_q)