diff --git a/applications/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad_backup.overlay b/applications/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad_backup.overlay new file mode 100644 index 000000000000..0effc6c5d29d --- /dev/null +++ b/applications/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad_backup.overlay @@ -0,0 +1,147 @@ +/* Use dummy GPIO pins entries to allocate the pins to Radio domain. + * + * Note: this allocation has to mach to DBPX_PIN macros. + */ + / { + gpio_toggle_pin_0: gpio-toggle-pin-0 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_1: gpio-toggle-pin-1 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_2: gpio-toggle-pin-2 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_3: gpio-toggle-pin-3 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_4: gpio-toggle-pin-4 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_5: gpio-toggle-pin-5 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_6: gpio-toggle-pin-6 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_7: gpio-toggle-pin-7 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + // gpio_toggle_pin_8: gpio-toggle-pin-8 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_9: gpio-toggle-pin-9 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_10: gpio-toggle-pin-10 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_11: gpio-toggle-pin-11 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_12: gpio-toggle-pin-12 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_13: gpio-toggle-pin-13 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_14: gpio-toggle-pin-14 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_15: gpio-toggle-pin-15 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; +}; + +&dppic130 { + owned-channels = <0 1 2 3>; + owned-channel-groups = <0 1>; + status = "okay"; +}; + +/* IPCT130 in Global domain and IPCT in Radio domain are used to create IPCTMAP entry. + * That means channels: source and sink create pairs that are applied by Secure Domain FW on boot. + * These entries has to be provided to pin_transport_debug by calls: debug_allow_ipct_channel + * and debug_allow_global_channel. + * + * Note: Channel 0 in IPCT in Radio domai is used by GRTC to deliver the GRTC events to Radio + * domain. It is setup as sink-channel-link in common NCS DTS file. + */ +&cpurad_ipct { + source-channel-links = <1 13 1 + 2 13 2 + 3 13 3>; +}; + +/* Note: IPCT130 in Global domain channel 0 is used by GRTC to deliver the GRTC events to Radio + * domain. It is setup as source-channel-link in common NCS DTS file. + */ +&ipct130 { + status = "okay"; + owned-channels = <0 1 2 3>; + sink-channel-links = <1 3 1 + 2 3 2 + 3 3 3>; +}; + +/* Example of GPIOTE channels allocation for Radio core. + * + * Note: By default all GPIOTE130 channels are allocated to APP Core. + * To use some of them in Radio domain you have to change the allocation + * in APP core DTS file. + */ +&gpiote130 { + status = "okay"; + owned-channels = <0 1 2 3>; +}; + +&uart135 { + status = "disabled"; +}; \ No newline at end of file diff --git a/applications/ipc_radio/prj.conf b/applications/ipc_radio/prj.conf index 77b0c3e69f2a..fbe4bf8ad5e3 100644 --- a/applications/ipc_radio/prj.conf +++ b/applications/ipc_radio/prj.conf @@ -4,6 +4,6 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_SERIAL=n -CONFIG_UART_CONSOLE=n -CONFIG_LOG=n +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_LOG=y diff --git a/applications/ipc_radio/src/bt_hci_ipc.c b/applications/ipc_radio/src/bt_hci_ipc.c index 161cdeef9851..b3d91a2cbc42 100644 --- a/applications/ipc_radio/src/bt_hci_ipc.c +++ b/applications/ipc_radio/src/bt_hci_ipc.c @@ -211,7 +211,13 @@ static void send(struct net_buf *buf, bool is_fatal_err) } while (ret < 0); LOG_INF("Sent message of %d bytes.", ret); - +#if IS_ENABLED(CONFIG_SERIAL) + printk("HCI TX DATA:"); + for(int idx = 0; idx < buf->len; idx++) { + printk("%x ", ((uint8_t*)buf->data)[idx]); + } + printk("\n"); +#endif net_buf_unref(buf); } @@ -230,8 +236,14 @@ static void recv(const void *data, size_t len, void *priv) enum hci_h4_type type; LOG_INF("Received hci message of %u bytes.", len); - LOG_HEXDUMP_DBG(data, len, "HCI data:"); - +#if IS_ENABLED(CONFIG_SERIAL) + printk("HCI RX DATA:"); + for(int idx = 0; idx < len; idx++) { + printk("%x ", ((uint8_t*)data)[idx]); + } + printk("\n"); + //LOG_HEXDUMP_DBG(data, len, "HCI data:"); +#endif type = (enum hci_h4_type)*tmp++; len -= sizeof(type); @@ -376,6 +388,9 @@ int ipc_bt_process(void) while (1) { buf = net_buf_get(&rx_queue, K_FOREVER); send(buf, HCI_REGULAR_MSG); +#if IS_ENABLED(CONFIG_SERIAL) + printk("IPC_BT loop\n"); +#endif } return 0; diff --git a/applications/ipc_radio/src/main.c b/applications/ipc_radio/src/main.c index fb058ca57367..a85c3bd0b9bc 100644 --- a/applications/ipc_radio/src/main.c +++ b/applications/ipc_radio/src/main.c @@ -5,6 +5,7 @@ */ #include +#include #include #include "ipc_bt.h" @@ -25,6 +26,9 @@ int main(void) return err; } +#if IS_ENABLED(CONFIG_SERIAL) + printk("IPC initialized\n"); +#endif for (;;) { err = ipc_bt_process(); @@ -33,7 +37,12 @@ int main(void) return 0; } else if (err) { LOG_ERR("Error processing ipc radio %d", err); + return err; } + +#if IS_ENABLED(CONFIG_SERIAL) + printk("IPC loop\n"); +#endif } } diff --git a/samples/bluetooth/peripheral_rscs/Kconfig b/samples/bluetooth/peripheral_rscs/Kconfig index 76214afcc6fc..cdc63b6cb289 100644 --- a/samples/bluetooth/peripheral_rscs/Kconfig +++ b/samples/bluetooth/peripheral_rscs/Kconfig @@ -10,7 +10,7 @@ menu "Nordic Running Speed and Cadence Service sample" config BT_RSCS_SECURITY_ENABLED bool "Enable security" - default y + default n select BT_SMP select BT_SETTINGS select FLASH diff --git a/samples/bluetooth/peripheral_rscs/boards/nrf54h20dk_nrf54h20_cpuapp.conf b/samples/bluetooth/peripheral_rscs/boards/nrf54h20dk_nrf54h20_cpuapp.conf new file mode 100644 index 000000000000..f2905b087be2 --- /dev/null +++ b/samples/bluetooth/peripheral_rscs/boards/nrf54h20dk_nrf54h20_cpuapp.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_PM=y +CONFIG_PM_S2RAM=y +CONFIG_POWEROFF=y +CONFIG_PM_S2RAM_CUSTOM_MARKING=y + +#CONFIG_CONSOLE=n +#CONFIG_UART_CONSOLE=n +#CONFIG_SERIAL=n + +CONFIG_GPIO=n + +CONFIG_BOOT_BANNER=n +CONFIG_NRFS_MRAM_SERVICE_ENABLED=n + +# What for? +#CONFIG_CLOCK_CONTROL=n \ No newline at end of file diff --git a/samples/bluetooth/peripheral_rscs/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/samples/bluetooth/peripheral_rscs/boards/nrf54h20dk_nrf54h20_cpuapp.overlay new file mode 100644 index 000000000000..6bbeeb2c3230 --- /dev/null +++ b/samples/bluetooth/peripheral_rscs/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + + / { + power-states { + idle: idle { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-idle"; + min-residency-us = <100000>; + }; + + s2ram: s2ram { + compatible = "zephyr,power-state"; + power-state-name = "suspend-to-ram"; + min-residency-us = <800000>; + }; + }; + }; + + &cpu { + cpu-power-states = <&idle &s2ram>; + }; diff --git a/samples/bluetooth/peripheral_rscs/prj.conf b/samples/bluetooth/peripheral_rscs/prj.conf index 62e6200cea29..c0d80a80341b 100644 --- a/samples/bluetooth/peripheral_rscs/prj.conf +++ b/samples/bluetooth/peripheral_rscs/prj.conf @@ -4,16 +4,17 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -CONFIG_NCS_SAMPLES_DEFAULTS=y +CONFIG_NCS_SAMPLES_DEFAULTS=n CONFIG_BT=y CONFIG_BT_PERIPHERAL=y CONFIG_BT_DEVICE_NAME="Nordic_RSCS" CONFIG_BT_RSCS=y -CONFIG_DK_LIBRARY=y +CONFIG_DK_LIBRARY=n # To simulate sensor measurements. # This is not used for cryptographic purposes. CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_TIMER_RANDOM_GENERATOR=y +CONFIG_BT_GATT_SERVICE_CHANGED=y diff --git a/samples/bluetooth/peripheral_rscs/src/main.c b/samples/bluetooth/peripheral_rscs/src/main.c index ca4bd26f5bbd..214093881f50 100644 --- a/samples/bluetooth/peripheral_rscs/src/main.c +++ b/samples/bluetooth/peripheral_rscs/src/main.c @@ -80,32 +80,42 @@ static void rsc_simulation(struct bt_rscs_measurement *measurement) int set_cumulative(uint32_t total_distance) { +#if IS_ENABLED(CONFIG_SERIAL) printk("Set total distance: %d\n", total_distance); +#endif /* CONFIG_SERIAL */ measurement.total_distance = total_distance; return 0; } int calibration(void) { +#if IS_ENABLED(CONFIG_SERIAL) printk("Start the calibration procedure\n"); +#endif /* CONFIG_SERIAL */ + return 0; } void update_loc(uint8_t location) { __ASSERT_NO_MSG(location < ARRAY_SIZE(sensor_location)); - +#if IS_ENABLED(CONFIG_SERIAL) printk("Update sensor location: %u - %s\n", location, sensor_location[location]); +#endif /* CONFIG_SERIAL */ } void evt_handler(enum bt_rscs_evt evt) { switch (evt) { case RSCS_EVT_MEAS_NOTIFY_ENABLE: +#if IS_ENABLED(CONFIG_SERIAL) printk("Measurement notify enable\n"); +#endif /* CONFIG_SERIAL */ break; case RSCS_EVT_MEAS_NOTIFY_DISABLE: +#if IS_ENABLED(CONFIG_SERIAL) printk("Measurement notify disable\n"); +#endif /* CONFIG_SERIAL */ default: break; } @@ -120,26 +130,32 @@ static const struct bt_rscs_cp_cb control_point_cb = { static void connected(struct bt_conn *conn, uint8_t err) { if (err) { +#if IS_ENABLED(CONFIG_SERIAL) printk("Connection failed, err 0x%02x %s\n", err, bt_hci_err_to_str(err)); +#endif /* CONFIG_SERIAL */ } else { +#if IS_ENABLED(CONFIG_SERIAL) printk("Connected\n"); +#endif /* CONFIG_SERIAL */ } current_conn = bt_conn_ref(conn); - dk_set_led_on(CON_STATUS_LED); + //dk_set_led_on(CON_STATUS_LED); } static void disconnected(struct bt_conn *conn, uint8_t reason) { +#if IS_ENABLED(CONFIG_SERIAL) printk("Disconnected, reason 0x%02x %s\n", reason, bt_hci_err_to_str(reason)); +#endif /* CONFIG_SERIAL */ if (current_conn) { bt_conn_unref(current_conn); current_conn = NULL; } - dk_set_led_off(CON_STATUS_LED); + //dk_set_led_off(CON_STATUS_LED); } #ifdef CONFIG_BT_RSCS_SECURITY_ENABLED @@ -150,10 +166,14 @@ static void security_changed(struct bt_conn *conn, bt_security_t level, enum bt_ bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); if (!err) { +#if IS_ENABLED(CONFIG_SERIAL) printk("Security changed: %s level %u\n", addr, level); +#endif /* CONFIG_SERIAL */ } else { +#if IS_ENABLED(CONFIG_SERIAL) printk("Security failed: %s level %u err %d %s\n", addr, level, err, bt_security_err_to_str(err)); +#endif /* CONFIG_SERIAL */ } } #endif @@ -173,7 +193,9 @@ static void auth_passkey_display(struct bt_conn *conn, unsigned int passkey) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); +#if IS_ENABLED(CONFIG_SERIAL) printk("Passkey for %s: %06u\n", addr, passkey); +#endif /* CONFIG_SERIAL */ } static void auth_cancel(struct bt_conn *conn) @@ -182,7 +204,9 @@ static void auth_cancel(struct bt_conn *conn) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); +#if IS_ENABLED(CONFIG_SERIAL) printk("Pairing cancelled: %s\n", addr); +#endif /* CONFIG_SERIAL */ } static void pairing_complete(struct bt_conn *conn, bool bonded) @@ -191,7 +215,9 @@ static void pairing_complete(struct bt_conn *conn, bool bonded) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); +#if IS_ENABLED(CONFIG_SERIAL) printk("Pairing completed: %s, bonded: %d\n", addr, bonded); +#endif /* CONFIG_SERIAL */ } static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) @@ -200,8 +226,10 @@ static void pairing_failed(struct bt_conn *conn, enum bt_security_err reason) bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr)); +#if IS_ENABLED(CONFIG_SERIAL) printk("Pairing failed conn: %s, reason %d %s\n", addr, reason, bt_security_err_to_str(reason)); +#endif /* CONFIG_SERIAL */ } static struct bt_conn_auth_cb conn_auth_callbacks = { @@ -225,82 +253,120 @@ static const struct bt_data ad[] = { BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1) }; +#define BT_LE_ADV_CONN BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, \ + BT_GAP_PER_ADV_SLOW_INT_MIN*2, \ + BT_GAP_PER_ADV_SLOW_INT_MAX*2, NULL) + +#pragma GCC push_options +#pragma GCC optimize("-O0") +//bool wait = false; + int main(void) { int err; uint32_t blink_status = 0; +#if IS_ENABLED(CONFIG_SERIAL) printk("Starting Running Speed and Cadence peripheral example\n"); - - err = dk_leds_init(); - if (err) { - printk("LEDs init failed (err %d)\n", err); - return 0; - } - - if (IS_ENABLED(CONFIG_BT_RSCS_SECURITY_ENABLED)) { - err = bt_conn_auth_cb_register(&conn_auth_callbacks); - if (err) { - printk("Failed to register authorization callbacks.\n"); - return 0; - } - - err = bt_conn_auth_info_cb_register(&conn_auth_info_callbacks); - if (err) { - printk("Failed to register authorization info callbacks.\n"); - return 0; - } - } +#endif /* CONFIG_SERIAL */ + + //err = dk_leds_init(); +// if (err) { +// #if IS_ENABLED(CONFIG_SERIAL) +// printk("LEDs init failed (err %d)\n", err); +// #endif /* CONFIG_SERIAL */ +// return 0; +// } + +// if (IS_ENABLED(CONFIG_BT_RSCS_SECURITY_ENABLED)) { +// err = bt_conn_auth_cb_register(&conn_auth_callbacks); +// if (err) { +// #if IS_ENABLED(CONFIG_SERIAL) +// printk("Failed to register authorization callbacks.\n"); +// #endif /* CONFIG_SERIAL */ +// return 0; +// } + +// err = bt_conn_auth_info_cb_register(&conn_auth_info_callbacks); +// if (err) { +// #if IS_ENABLED(CONFIG_SERIAL) +// printk("Failed to register authorization info callbacks.\n"); +// #endif /* CONFIG_SERIAL */ +// return 0; +// } +// } + + //while(wait); + //k_sleep(K_FOREVER); + //k_msleep(10000); + printk("back\n"); err = bt_enable(NULL); if (err) { +#if IS_ENABLED(CONFIG_SERIAL) printk("Bluetooth init failed (err %d)\n", err); +#endif /* CONFIG_SERIAL */ return 0; } - printk("Bluetooth initialized\n"); +// #if IS_ENABLED(CONFIG_SERIAL) +// printk("Bluetooth initialized\n"); +// #endif /* CONFIG_SERIAL */ - if (IS_ENABLED(CONFIG_SETTINGS)) { - settings_load(); - } +// if (IS_ENABLED(CONFIG_SETTINGS)) { +// settings_load(); +// } - struct bt_rscs_init_params rscs_init = {0}; +// struct bt_rscs_init_params rscs_init = {0}; - rscs_init.features.inst_stride_len = 1; - rscs_init.features.multi_sensor_loc = 1; - rscs_init.features.sensor_calib_proc = 1; - rscs_init.features.total_distance = 1; - rscs_init.features.walking_or_running = 1; +// rscs_init.features.inst_stride_len = 1; +// rscs_init.features.multi_sensor_loc = 1; +// rscs_init.features.sensor_calib_proc = 1; +// rscs_init.features.total_distance = 1; +// rscs_init.features.walking_or_running = 1; - rscs_init.supported_locations.other = 1; - rscs_init.supported_locations.top_of_shoe = 1; - rscs_init.supported_locations.in_shoe = 1; - rscs_init.supported_locations.hip = 1; +// rscs_init.supported_locations.other = 1; +// rscs_init.supported_locations.top_of_shoe = 1; +// rscs_init.supported_locations.in_shoe = 1; +// rscs_init.supported_locations.hip = 1; - rscs_init.location = RSC_LOC_HIP; +// rscs_init.location = RSC_LOC_HIP; - rscs_init.cp_cb = &control_point_cb; - rscs_init.evt_handler = evt_handler; +// rscs_init.cp_cb = &control_point_cb; +// rscs_init.evt_handler = evt_handler; - err = bt_rscs_init(&rscs_init); - if (err) { - printk("Failed to init RSCS (err %d)\n", err); - return 0; - } +// err = bt_rscs_init(&rscs_init); +// if (err) { +// #if IS_ENABLED(CONFIG_SERIAL) +// printk("Failed to init RSCS (err %d)\n", err); +// #endif /* CONFIG_SERIAL */ +// return 0; +// } + printk("start adv\n"); err = bt_le_adv_start(BT_LE_ADV_CONN, ad, ARRAY_SIZE(ad), NULL, 0); if (err) { + printk("start adv failed\n"); + +#if IS_ENABLED(CONFIG_SERIAL) printk("Advertising failed to start (err %d)\n", err); +#endif /* CONFIG_SERIAL */ return 0; } +#if IS_ENABLED(CONFIG_SERIAL) printk("Advertising successfully started\n"); +#endif /* CONFIG_SERIAL */ for (;;) { - dk_set_led(RUN_STATUS_LED, (++blink_status) % 2); - k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL)); + printk("Loop\n"); + k_msleep(2000); + + // //dk_set_led(RUN_STATUS_LED, (++blink_status) % 2); + // k_sleep(K_MSEC(RUN_LED_BLINK_INTERVAL)); - rsc_simulation(&measurement); - bt_rscs_measurement_send(current_conn, &measurement); + // rsc_simulation(&measurement); + // bt_rscs_measurement_send(current_conn, &measurement); } } +#pragma GCC pop_options \ No newline at end of file diff --git a/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad__.conf b/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad__.conf new file mode 100644 index 000000000000..735e73bf3b52 --- /dev/null +++ b/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad__.conf @@ -0,0 +1,22 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_PM=y +CONFIG_PM_S2RAM=y +CONFIG_POWEROFF=y +CONFIG_PM_S2RAM_CUSTOM_MARKING=y + +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y +CONFIG_SERIAL=y + +CONFIG_GPIO=n + +CONFIG_BOOT_BANNER=n +CONFIG_NRFS_MRAM_SERVICE_ENABLED=n + +# What for? +#CONFIG_CLOCK_CONTROL=n \ No newline at end of file diff --git a/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad__.overlay b/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad__.overlay new file mode 100644 index 000000000000..60825f64537d --- /dev/null +++ b/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/boards/nrf54h20dk_nrf54h20_cpurad__.overlay @@ -0,0 +1,147 @@ +/* Use dummy GPIO pins entries to allocate the pins to Radio domain. + * + * Note: this allocation has to mach to DBPX_PIN macros. + */ + / { + gpio_toggle_pin_0: gpio-toggle-pin-0 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_1: gpio-toggle-pin-1 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_2: gpio-toggle-pin-2 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_3: gpio-toggle-pin-3 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_4: gpio-toggle-pin-4 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_5: gpio-toggle-pin-5 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_6: gpio-toggle-pin-6 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + gpio_toggle_pin_7: gpio-toggle-pin-7 { + compatible = "nordic,gpio-pins"; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + // gpio_toggle_pin_8: gpio-toggle-pin-8 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_9: gpio-toggle-pin-9 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_10: gpio-toggle-pin-10 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_11: gpio-toggle-pin-11 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_12: gpio-toggle-pin-12 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_13: gpio-toggle-pin-13 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_14: gpio-toggle-pin-14 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; + + // gpio_toggle_pin_15: gpio-toggle-pin-15 { + // compatible = "nordic,gpio-pins"; + // gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; + // status = "okay"; + // }; +}; + +&dppic130 { + owned-channels = <0 1 2 3>; + owned-channel-groups = <0 1>; + status = "okay"; +}; + +/* IPCT130 in Global domain and IPCT in Radio domain are used to create IPCTMAP entry. + * That means channels: source and sink create pairs that are applied by Secure Domain FW on boot. + * These entries has to be provided to pin_transport_debug by calls: debug_allow_ipct_channel + * and debug_allow_global_channel. + * + * Note: Channel 0 in IPCT in Radio domai is used by GRTC to deliver the GRTC events to Radio + * domain. It is setup as sink-channel-link in common NCS DTS file. + */ +&cpurad_ipct { + source-channel-links = <1 13 1 + 2 13 2 + 3 13 3>; +}; + +/* Note: IPCT130 in Global domain channel 0 is used by GRTC to deliver the GRTC events to Radio + * domain. It is setup as source-channel-link in common NCS DTS file. + */ +&ipct130 { + status = "okay"; + owned-channels = <0 1 2 3>; + sink-channel-links = <1 3 1 + 2 3 2 + 3 3 3>; +}; + +/* Example of GPIOTE channels allocation for Radio core. + * + * Note: By default all GPIOTE130 channels are allocated to APP Core. + * To use some of them in Radio domain you have to change the allocation + * in APP core DTS file. + */ +&gpiote130 { + status = "okay"; + owned-channels = <0 1 2 3>; +}; + +/*&uart135 { + status = "disabled"; + };*/ diff --git a/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/prj.conf b/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/prj.conf new file mode 100644 index 000000000000..de3a5d1d149b --- /dev/null +++ b/samples/bluetooth/peripheral_rscs/sysbuild/ipc_radio/prj.conf @@ -0,0 +1,9 @@ +# +# Copyright (c) 2024 Nordic Semiconductor +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +CONFIG_SERIAL=y +CONFIG_UART_CONSOLE=y +CONFIG_LOG=n diff --git a/west.yml b/west.yml index b030eb1aaec3..d2c36057aca0 100644 --- a/west.yml +++ b/west.yml @@ -72,7 +72,7 @@ manifest: # https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html - name: zephyr repo-path: sdk-zephyr - revision: 96aa87c2aae419a2d04f4ee86ef12b359789a817 + revision: pull/2032/head import: # In addition to the zephyr repository itself, NCS also # imports the contents of zephyr/west.yml at the above