Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -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";
};
6 changes: 3 additions & 3 deletions applications/ipc_radio/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 18 additions & 3 deletions applications/ipc_radio/src/bt_hci_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,13 @@
} 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++) {

Check failure on line 216 in applications/ipc_radio/src/bt_hci_ipc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACING

applications/ipc_radio/src/bt_hci_ipc.c:216 space required before the open parenthesis '('
printk("%x ", ((uint8_t*)buf->data)[idx]);

Check failure on line 217 in applications/ipc_radio/src/bt_hci_ipc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

applications/ipc_radio/src/bt_hci_ipc.c:217 "(foo*)" should be "(foo *)"
}
printk("\n");
#endif
net_buf_unref(buf);
}

Expand All @@ -230,8 +236,14 @@
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++) {

Check failure on line 241 in applications/ipc_radio/src/bt_hci_ipc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SPACING

applications/ipc_radio/src/bt_hci_ipc.c:241 space required before the open parenthesis '('
printk("%x ", ((uint8_t*)data)[idx]);

Check failure on line 242 in applications/ipc_radio/src/bt_hci_ipc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

POINTER_LOCATION

applications/ipc_radio/src/bt_hci_ipc.c:242 "(foo*)" should be "(foo *)"
}
printk("\n");
//LOG_HEXDUMP_DBG(data, len, "HCI data:");

Check failure on line 245 in applications/ipc_radio/src/bt_hci_ipc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

C99_COMMENTS

applications/ipc_radio/src/bt_hci_ipc.c:245 do not use C99 // comments
#endif
type = (enum hci_h4_type)*tmp++;
len -= sizeof(type);

Expand Down Expand Up @@ -376,6 +388,9 @@
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;
Expand Down
9 changes: 9 additions & 0 deletions applications/ipc_radio/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <errno.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>

#include "ipc_bt.h"
Expand All @@ -25,6 +26,9 @@ int main(void)
return err;
}

#if IS_ENABLED(CONFIG_SERIAL)
printk("IPC initialized\n");
#endif
for (;;) {
err = ipc_bt_process();

Expand All @@ -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
}
}
2 changes: 1 addition & 1 deletion samples/bluetooth/peripheral_rscs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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>;
};
5 changes: 3 additions & 2 deletions samples/bluetooth/peripheral_rscs/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading
Loading