summaryrefslogtreecommitdiff
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
parent84f0cda013c83e8fa61c9d85f061f5f88cf30b9d (diff)
fix build with west zephyr
-rw-r--r--.github/workflows/build.yml4
-rw-r--r--.idea/debugServers/lpc1769.xml13
-rw-r--r--.idea/debugServers/lpc55s69.xml13
-rw-r--r--.idea/debugServers/nrf52833.xml13
-rw-r--r--.idea/debugServers/nrf5340.xml13
-rw-r--r--.idea/debugServers/stm32f411.xml13
-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
9 files changed, 95 insertions, 27 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 16f906632..becbc5069 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -161,8 +161,8 @@ jobs:
- name: Build
run: |
- west build -b pca10056 -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
- west build -b pca10056 -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr
+ west build -b nrf52840dk -d examples/device/cdc_msc/build examples/device/cdc_msc -- -DRTOS=zephyr
+ west build -b nrf52840dk -d examples/device/msc_dual_lun/build examples/device/msc_dual_lun -- -DRTOS=zephyr
# ---------------------------------------
# Hardware in the loop (HIL)
diff --git a/.idea/debugServers/lpc1769.xml b/.idea/debugServers/lpc1769.xml
new file mode 100644
index 000000000..4acfe6afe
--- /dev/null
+++ b/.idea/debugServers/lpc1769.xml
@@ -0,0 +1,13 @@
+<component name="DebugServers">
+ <jlink-debug-target name="lpc1769" uniqueID="8f746157-a0c3-435f-b417-10f26c3b2699">
+ <debugger version="1">
+ <debugger kind="GDB" isBundled="true" />
+ <env />
+ </debugger>
+ <gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
+ <console port="19021" />
+ <target device="LPC1769" reset-before="false" frequency="12000" />
+ <connection extended-remote="false" port="4444" warmup-ms="500" />
+ <swo />
+ </jlink-debug-target>
+</component> \ No newline at end of file
diff --git a/.idea/debugServers/lpc55s69.xml b/.idea/debugServers/lpc55s69.xml
new file mode 100644
index 000000000..ceedab0af
--- /dev/null
+++ b/.idea/debugServers/lpc55s69.xml
@@ -0,0 +1,13 @@
+<component name="DebugServers">
+ <jlink-debug-target name="lpc55s69" uniqueID="7de47452-94f1-4f1d-b03c-0f4ad3556d01">
+ <debugger version="1">
+ <debugger kind="GDB" isBundled="true" />
+ <env />
+ </debugger>
+ <gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
+ <console port="19021" />
+ <target device="LPC55S69_M33_0" reset-before="false" frequency="12000" />
+ <connection extended-remote="false" port="4444" warmup-ms="500" />
+ <swo />
+ </jlink-debug-target>
+</component> \ No newline at end of file
diff --git a/.idea/debugServers/nrf52833.xml b/.idea/debugServers/nrf52833.xml
new file mode 100644
index 000000000..09d2ae3d3
--- /dev/null
+++ b/.idea/debugServers/nrf52833.xml
@@ -0,0 +1,13 @@
+<component name="DebugServers">
+ <jlink-debug-target name="nrf52833" uniqueID="19eede9f-2096-4b30-9390-14d415964264">
+ <debugger version="1">
+ <debugger kind="GDB" isBundled="true" />
+ <env />
+ </debugger>
+ <gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
+ <console port="19021" />
+ <target device="nRF52833_xxAA" reset-before="false" frequency="12000" />
+ <connection extended-remote="false" port="4444" warmup-ms="500" />
+ <swo />
+ </jlink-debug-target>
+</component> \ No newline at end of file
diff --git a/.idea/debugServers/nrf5340.xml b/.idea/debugServers/nrf5340.xml
new file mode 100644
index 000000000..ac3bd59fa
--- /dev/null
+++ b/.idea/debugServers/nrf5340.xml
@@ -0,0 +1,13 @@
+<component name="DebugServers">
+ <jlink-debug-target name="nrf5340" uniqueID="d82e668b-1307-4266-8a5c-3752be6795c9" selected="true">
+ <debugger version="1">
+ <debugger kind="GDB" isBundled="true" />
+ <env />
+ </debugger>
+ <gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
+ <console port="19021" />
+ <target device="nRF5340_xxAA_APP" reset-before="false" frequency="12000" />
+ <connection extended-remote="false" port="4444" warmup-ms="500" />
+ <swo />
+ </jlink-debug-target>
+</component> \ No newline at end of file
diff --git a/.idea/debugServers/stm32f411.xml b/.idea/debugServers/stm32f411.xml
new file mode 100644
index 000000000..2bcdf3829
--- /dev/null
+++ b/.idea/debugServers/stm32f411.xml
@@ -0,0 +1,13 @@
+<component name="DebugServers">
+ <jlink-debug-target name="stm32f411" uniqueID="c48950a7-634c-49b6-b136-204ed0b71718">
+ <debugger version="1">
+ <debugger kind="GDB" isBundled="true" />
+ <env />
+ </debugger>
+ <gdbserver exe="/usr/bin/JLinkGDBServerCLExe" />
+ <console port="19021" />
+ <target device="STM32F411VE" reset-before="false" frequency="12000" />
+ <connection extended-remote="false" port="4444" warmup-ms="500" />
+ <swo />
+ </jlink-debug-target>
+</component> \ No newline at end of file
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)