Skip to content
Merged
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
2 changes: 2 additions & 0 deletions boards/native/nrf_bsim/doc/nrf5340bsim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ These boards include models of some of the nRF5340 SOC peripherals:
* DPPI (Distributed Programmable Peripheral Interconnect)
* EGU (Event Generator Unit)
* FICR (Factory Information Configuration Registers)
* GPIO & GPIOTE
* IPC (Interprocessor communication)
* MUTEX (Mutual exclusive peripheral)
* NVMC (Non-Volatile Memory Controller / Flash)
Expand All @@ -42,6 +43,7 @@ These boards include models of some of the nRF5340 SOC peripherals:
* RTC (Real Time Counter)
* TEMP (Temperature sensor)
* TIMER
* UARTE (UART with Easy DMA)
* UICR (User Information Configuration Registers)

and will use the same drivers as the nrf5340dk targets for these.
Expand Down
1 change: 1 addition & 0 deletions boards/native/nrf_bsim/doc/nrf54l15bsim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ This boards include models of some of the nRF54L15 SOC peripherals:
* ECB (AES electronic codebook mode encryption)
* EGU (Event Generator Unit)
* FICR (Factory Information Configuration Registers)
* GPIO & GPIOTE
* GRTC (Global Real-time Counter)
* PPIB (PPI Bridge)
* RADIO
Expand Down
28 changes: 22 additions & 6 deletions boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <mem.h>
#include <arm/nordic/nrf5340_cpuapp.dtsi>
#include <../boards/nordic/nrf5340dk/nrf5340_cpuapp_common-pinctrl.dtsi>

/ {
model = "Nordic NRF5340 BSIM NRF5340 Application";
Expand Down Expand Up @@ -35,9 +36,6 @@
/delete-property/ i2s-0;
/delete-property/ qdec-0;
/delete-property/ qdec-1;
/delete-property/ gpio-0;
/delete-property/ gpio-1;
/delete-property/ gpiote-0;
};

chosen {
Expand Down Expand Up @@ -82,11 +80,8 @@
/delete-node/ regulator@37000;
/delete-node/ kmu@39000;
/delete-node/ vmc@81000;
/delete-node/ gpio@842500;
/delete-node/ gpio@842800;
};
/delete-node/ spu@50003000;
/delete-node/ gpiote@5000d000;
/delete-node/ crypto@50844000;
};

Expand All @@ -112,6 +107,27 @@
};
};


&gpiote {
status = "okay";
};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};

/* We re-use the IPC shared buffer definition from the real HW. But note the start address of the
* buffer won't be used.
*/
Expand Down
4 changes: 2 additions & 2 deletions boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpuapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ toolchain:
- zephyr
testing:
ignore_tags:
- gpio
- modem
- uart
- bsim_skip_CI
supported:
- gpio
28 changes: 22 additions & 6 deletions boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <mem.h>
#include <arm/nordic/nrf5340_cpunet.dtsi>
#include <../boards/nordic/nrf5340dk/nrf5340dk_nrf5340_cpunet-pinctrl.dtsi>

/ {
model = "Nordic NRF5340 BSIM NRF5340 Network";
Expand All @@ -17,15 +18,13 @@
aliases {
/delete-property/ sram-0;
/delete-property/ sram-1;
/delete-property/ gpiote-0;
/delete-property/ wdt-0;
/delete-property/ i2c-0;
/delete-property/ spi-0;
/delete-property/ gpio-0;
/delete-property/ gpio-1;
};

chosen {
zephyr,console = &uart0;
zephyr,bt-hci-ipc = &ipc0;
nordic,802154-spinel-ipc = &ipc0;
zephyr,ieee802154 = &ieee802154;
Expand All @@ -36,14 +35,11 @@
soc {
/delete-node/ memory@20000000;
/delete-node/ memory@21000000;
/delete-node/ gpiote@4100a000;
/delete-node/ watchdog@4100b000;
/delete-node/ i2c@41013000;
/delete-node/ spi@41013000;
/delete-node/ acl@41080000;
/delete-node/ vmc@41081000;
/delete-node/ gpio@418c0500;
/delete-node/ gpio@418c0800;
};

/delete-node/ cpus;
Expand Down Expand Up @@ -73,6 +69,26 @@
};
};

&gpiote {
status = "okay";
};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};

/* We re-use the IPC shared buffer definition from the real HW. But note the start address of the
* buffer won't be used.
*/
Expand Down
4 changes: 2 additions & 2 deletions boards/native/nrf_bsim/nrf5340bsim_nrf5340_cpunet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ toolchain:
- zephyr
testing:
ignore_tags:
- gpio
- modem
- uart
- bsim_skip_CI
supported:
- gpio
26 changes: 21 additions & 5 deletions boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
/delete-node/ vpr@4c000;
/delete-node/ mailbox@0;
/delete-node/ interrupt-controller@f0000000;
/delete-node/ gpio@50400;
/delete-node/ i2c@c6000;
/delete-node/ spi@c6000;
/delete-node/ uart@c6000;
Expand All @@ -47,8 +46,6 @@
/delete-node/ pwm@d4000;
/delete-node/ adc@d5000;
/delete-node/ nfct@d6000;
/delete-node/ gpio@d8200;
/delete-node/ gpiote@da000;
/delete-node/ i2s@dd000;
/delete-node/ qdec@e0000;
/delete-node/ qdec@e1000;
Expand All @@ -57,8 +54,6 @@
/delete-node/ uart@104000;
/delete-node/ watchdog@108000;
/delete-node/ watchdog@109000;
/delete-node/ gpio@10a000;
/delete-node/ gpiote@10c000;
};
};

Expand Down Expand Up @@ -91,6 +86,27 @@
};
};


&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&gpio2 {
status = "okay";
};

&gpiote20 {
status = "okay";
};

&gpiote30 {
status = "okay";
};

&temp {
status = "okay";
};
Expand Down
2 changes: 1 addition & 1 deletion boards/native/nrf_bsim/nrf54l15bsim_nrf54l15_cpuapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ toolchain:
- zephyr
supported:
- counter
- gpio
testing:
ignore_tags:
- gpio
- modem
- uart
- bsim_skip_CI
3 changes: 2 additions & 1 deletion tests/bsim/ci.uart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ set -uex

echo "UART: Single device tests"
${ZEPHYR_BASE}/scripts/twister -T tests/drivers/uart/ --force-color --inline-logs -v -M \
-p nrf52_bsim --fixture gpio_loopback -- -uart0_loopback
-p nrf52_bsim -p nrf5340bsim/nrf5340/cpuapp --fixture gpio_loopback \
-- -uart0_loopback -uart1_loopback

echo "UART: Multi device tests"
WORK_DIR=${ZEPHYR_BASE}/bsim_uart nice tests/bsim/drivers/uart/compile.sh
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SKIP_PULL_TEST=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf52_bsim.overlay"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SKIP_PULL_TEST=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf52_bsim.overlay"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_SKIP_PULL_TEST=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf52_bsim.overlay"
7 changes: 6 additions & 1 deletion tests/drivers/gpio/gpio_basic_api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ tests:
filter: dt_compat_enabled("test-gpio-basic-api") and not dt_compat_enabled("arduino-header-r3")

drivers.gpio.nrf_sense_edge:
platform_allow: nrf52840dk/nrf52840 nrf52_bsim
platform_allow:
- nrf52840dk/nrf52840
- nrf52_bsim
- nrf5340bsim/nrf5340/cpuapp
- nrf5340bsim/nrf5340/cpunet
- nrf54l15bsim/nrf54l15/cpuapp
extra_args: "DTC_OVERLAY_FILE=boards/nrf52840dk_nrf52840.overlay;\
boards/nrf52840dk_nrf52840_sense_edge.overlay"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf52_bsim.overlay"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf52_bsim.overlay"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf52_bsim.overlay"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was not aware that overlays could include other overlays like this :)

Question is of course if it should. Looks a bit strange to me that the nrf54l15 cpuapp uses/includes the same overlay as the nrf52_bsim, especially when the nrf52840dk_nrf52840.overlay file doesn't

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this saves a lot of duplicate code. It can feel a bit funny to reuse overlays between SOCs, but lukily this is only configuring the GPIOs and what we change is common between them.
(Wrt. this particular test there is no overlay today for the nrf52840dk.)

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2023 Vestas Wind Systems A/S
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf52_bsim.overlay"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2023 Vestas Wind Systems A/S
*
* SPDX-License-Identifier: Apache-2.0
*/

#include "nrf52_bsim.overlay"
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2023 Vestas Wind Systems A/S
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/gpio/gpio.h>

/ {
zephyr,user {
output-high-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
output-low-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
input-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
};
};

&gpio0 {
hog1 {
gpio-hog;
gpios = <3 GPIO_ACTIVE_LOW>;
output-high;
};

hog2 {
gpio-hog;
gpios = <4 GPIO_ACTIVE_HIGH>;
output-low;
};

hog3 {
gpio-hog;
gpios = <1 GPIO_ACTIVE_LOW>;
input;
};
};
3 changes: 3 additions & 0 deletions tests/drivers/gpio/gpio_hogs/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ tests:
- nrf52840dk/nrf52840
- nucleo_g474re
- nrf52_bsim
- nrf5340bsim/nrf5340/cpuapp
- nrf5340bsim/nrf5340/cpunet
- nrf54l15bsim/nrf54l15/cpuapp
- mr_canhubk3
- s32z2xxdc2/s32z270/rtu0
- s32z2xxdc2/s32z270/rtu1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1
CONFIG_UART_NRFX_UARTE_ENHANCED_RX=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include "nrf5340dk_nrf5340_cpuapp.overlay"
5 changes: 4 additions & 1 deletion tests/drivers/uart/uart_async_api/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ tests:
integration_platforms:
- nucleo_h743zi
drivers.uart.async_api.nrf_uarte_new:
platform_allow: nrf52840dk/nrf52840 nrf52_bsim
platform_allow:
- nrf52840dk/nrf52840
- nrf52_bsim
- nrf5340bsim/nrf5340/cpuapp
filter: CONFIG_SERIAL_SUPPORT_ASYNC
harness: ztest
harness_config:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* SPDX-License-Identifier: Apache-2.0 */

#include "nrf5340dk_nrf5340_cpuapp.overlay"
Loading
Loading