Skip to content

Commit e0ee32c

Browse files
committed
fix build with west zephyr
1 parent 84f0cda commit e0ee32c

File tree

9 files changed

+95
-27
lines changed

9 files changed

+95
-27
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ jobs:
161161

162162
- name: Build
163163
run: |
164-
west build -b pca10056 -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
165-
west build -b pca10056 -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr
164+
west build -b nrf52840dk -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
165+
west build -b nrf52840dk -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr
166166
167167
# ---------------------------------------
168168
# Hardware in the loop (HIL)

.idea/debugServers/lpc1769.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/debugServers/lpc55s69.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/debugServers/nrf52833.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/debugServers/nrf5340.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/debugServers/stm32f411.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hw/bsp/nrf/family.c

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,6 @@
6666
#error "Example requires nrfx v3.0.0 or later"
6767
#endif
6868

69-
//--------------------------------------------------------------------+
70-
// Forward USB interrupt events to TinyUSB IRQ Handler
71-
//--------------------------------------------------------------------+
72-
#if defined(NRF54H20_XXAA)
73-
#define USBD_IRQn USBHS_IRQn
74-
void USBHS_IRQHandler(void) {
75-
tusb_int_handler(0, true);
76-
}
77-
78-
#else
79-
void USBD_IRQHandler(void) {
80-
tud_int_handler(0);
81-
}
82-
#endif
8369

8470
/*------------------------------------------------------------------*/
8571
/* MACRO TYPEDEF CONSTANT ENUM
@@ -92,18 +78,37 @@ enum {
9278
USB_EVT_READY = 2
9379
};
9480

81+
// Forward USB interrupt events to TinyUSB IRQ Handler
82+
#if defined(NRF54H20_XXAA)
83+
#define USBD_IRQn USBHS_IRQn
84+
void USBHS_IRQHandler(void) {
85+
tusb_int_handler(0, true);
86+
}
87+
88+
static nrfx_uarte_t _uart_id = NRFX_UARTE_INSTANCE(120);
89+
90+
#else
91+
9592
#ifdef NRF5340_XXAA
96-
#define LFCLK_SRC_RC CLOCK_LFCLKSRC_SRC_LFRC
97-
#define VBUSDETECT_Msk USBREG_USBREGSTATUS_VBUSDETECT_Msk
98-
#define OUTPUTRDY_Msk USBREG_USBREGSTATUS_OUTPUTRDY_Msk
99-
#define GPIOTE_IRQn GPIOTE1_IRQn
93+
#define LFCLK_SRC_RC CLOCK_LFCLKSRC_SRC_LFRC
94+
#define VBUSDETECT_Msk USBREG_USBREGSTATUS_VBUSDETECT_Msk
95+
#define OUTPUTRDY_Msk USBREG_USBREGSTATUS_OUTPUTRDY_Msk
96+
#define GPIOTE_IRQn GPIOTE1_IRQn
10097
#else
101-
#define LFCLK_SRC_RC CLOCK_LFCLKSRC_SRC_RC
102-
#define VBUSDETECT_Msk POWER_USBREGSTATUS_VBUSDETECT_Msk
103-
#define OUTPUTRDY_Msk POWER_USBREGSTATUS_OUTPUTRDY_Msk
98+
#define LFCLK_SRC_RC CLOCK_LFCLKSRC_SRC_RC
99+
#define VBUSDETECT_Msk POWER_USBREGSTATUS_VBUSDETECT_Msk
100+
#define OUTPUTRDY_Msk POWER_USBREGSTATUS_OUTPUTRDY_Msk
104101
#endif
105102

106-
static nrfx_uarte_t _uart_id = NRFX_UARTE_INSTANCE(CFG_NRFX_UARTE_INSTANCE_ID);
103+
static nrfx_uarte_t _uart_id = NRFX_UARTE_INSTANCE(0);
104+
105+
void USBD_IRQHandler(void) {
106+
tud_int_handler(0);
107+
}
108+
#endif
109+
110+
111+
107112

108113
// tinyusb function that handles power event (detected, ready, removed)
109114
// We must call it within SD's SOC event handler, or set it as power event handler if SD is not enabled.

hw/bsp/nrf/nrfx_config/nrfx_config_common.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@
6161

6262
#if defined(NRF54H20_XXAA)
6363
#define NRFX_UARTE120_ENABLED 1
64-
#define CFG_NRFX_UARTE_INSTANCE_ID 120
6564

6665
#else
6766

6867
#define NRFX_POWER_ENABLED 1
6968
#define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7
7069

7170
#define NRFX_UARTE0_ENABLED 1
72-
#define CFG_NRFX_UARTE_INSTANCE_ID 0
7371

7472
#define NRFX_GPIOTE_ENABLED 1
7573
#define NRFX_GPIOTE0_ENABLED 1

hw/bsp/zephyr_board_aliases.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
set(pca10056_BOARD_ALIAS nrf52840dk/nrf52840)
1+
set(nrf52840dk_BOARD_ALIAS nrf52840dk/nrf52840)
22
set(stm32n657nucleo_BOARD_ALIAS nucleo_n657x0_q)

0 commit comments

Comments
 (0)