Skip to content
Draft
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
19 changes: 19 additions & 0 deletions drivers/mbox/mbox_nrf_bellboard_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

#include <hal/nrf_bellboard.h>

#if CONFIG_SOC_NRF54H20_CPURAD
#include <zephyr/drivers/gpio.h>
extern const struct gpio_dt_spec led1;
#endif

#define BELLBOARD_NUM_IRQS 4U

BUILD_ASSERT(DT_NUM_IRQS(DT_DRV_INST(0)) <= BELLBOARD_NUM_IRQS, "# interrupt exceeds maximum");
Expand Down Expand Up @@ -43,12 +48,26 @@
uint8_t irq_idx = (uint8_t)(uintptr_t)parameter;
uint32_t int_pend;

#if CONFIG_SOC_NRF54H20_CPURAD
//if(i==0) gpio_pin_toggle_dt(&led1);

Check failure on line 52 in drivers/mbox/mbox_nrf_bellboard_rx.c

View workflow job for this annotation

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

C99_COMMENTS

drivers/mbox/mbox_nrf_bellboard_rx.c:52 do not use C99 // comments
//gpio_pin_toggle_dt(&led1);

Check failure on line 53 in drivers/mbox/mbox_nrf_bellboard_rx.c

View workflow job for this annotation

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

C99_COMMENTS

drivers/mbox/mbox_nrf_bellboard_rx.c:53 do not use C99 // comments
#endif


int_pend = nrf_bellboard_int_pending_get(bellboard, irq_idx);

for (uint8_t i = 0U; i < NRF_BELLBOARD_EVENTS_TRIGGERED_COUNT; i++) {
nrf_bellboard_event_t event = nrf_bellboard_triggered_event_get(i);



if ((int_pend & BIT(i)) != 0U) {

#if CONFIG_SOC_NRF54H20_CPURAD
//if(i==0) gpio_pin_toggle_dt(&led1);

Check failure on line 67 in drivers/mbox/mbox_nrf_bellboard_rx.c

View workflow job for this annotation

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

C99_COMMENTS

drivers/mbox/mbox_nrf_bellboard_rx.c:67 do not use C99 // comments
if(i == 6) gpio_pin_toggle_dt(&led1);

Check failure on line 68 in drivers/mbox/mbox_nrf_bellboard_rx.c

View workflow job for this annotation

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

SPACING

drivers/mbox/mbox_nrf_bellboard_rx.c:68 space required before the open parenthesis '('

Check failure on line 68 in drivers/mbox/mbox_nrf_bellboard_rx.c

View workflow job for this annotation

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

TRAILING_STATEMENTS

drivers/mbox/mbox_nrf_bellboard_rx.c:68 trailing statements should be on next line
#endif

Check notice on line 70 in drivers/mbox/mbox_nrf_bellboard_rx.c

View workflow job for this annotation

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

You may want to run clang-format on this change

drivers/mbox/mbox_nrf_bellboard_rx.c:70 - #if CONFIG_SOC_NRF54H20_CPURAD - //if(i==0) gpio_pin_toggle_dt(&led1); - //gpio_pin_toggle_dt(&led1); - #endif - +#if CONFIG_SOC_NRF54H20_CPURAD +// if(i==0) gpio_pin_toggle_dt(&led1); +// gpio_pin_toggle_dt(&led1); +#endif int_pend = nrf_bellboard_int_pending_get(bellboard, irq_idx); for (uint8_t i = 0U; i < NRF_BELLBOARD_EVENTS_TRIGGERED_COUNT; i++) { nrf_bellboard_event_t event = nrf_bellboard_triggered_event_get(i); - - if ((int_pend & BIT(i)) != 0U) { - #if CONFIG_SOC_NRF54H20_CPURAD - //if(i==0) gpio_pin_toggle_dt(&led1); - if(i == 6) gpio_pin_toggle_dt(&led1); - #endif +#if CONFIG_SOC_NRF54H20_CPURAD + // if(i==0) gpio_pin_toggle_dt(&led1); + if (i == 6) { + gpio_pin_toggle_dt(&led1); + } +#endif
/* Only clear those events that have their corresponding bit set
* in INTPEND at the time we read it. Otherwise, if two (or more)
* events are generated in quick succession, INTPEND may be set for
Expand Down
30 changes: 30 additions & 0 deletions drivers/mbox/mbox_nrf_bellboard_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,26 @@
#include <zephyr/drivers/mbox.h>

#include <haly/nrfy_bellboard.h>
#include <zephyr/kernel.h>

struct mbox_bellboard_tx_conf {
NRF_BELLBOARD_Type *bellboard;
};

#if CONFIG_SOC_NRF54H20_CPUSYS
//volatile uint32_t app_bellboard_tx_count = 0;

Check failure on line 19 in drivers/mbox/mbox_nrf_bellboard_tx.c

View workflow job for this annotation

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

C99_COMMENTS

drivers/mbox/mbox_nrf_bellboard_tx.c:19 do not use C99 // comments
//volatile uint32_t rad_bellboard_tx_count = 0;

Check failure on line 20 in drivers/mbox/mbox_nrf_bellboard_tx.c

View workflow job for this annotation

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

C99_COMMENTS

drivers/mbox/mbox_nrf_bellboard_tx.c:20 do not use C99 // comments
//volatile uint32_t sec_bellboard_tx_count = 0;

Check failure on line 21 in drivers/mbox/mbox_nrf_bellboard_tx.c

View workflow job for this annotation

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

C99_COMMENTS

drivers/mbox/mbox_nrf_bellboard_tx.c:21 do not use C99 // comments
//volatile uint32_t all_bellboard_tx_count = 0;

Check failure on line 22 in drivers/mbox/mbox_nrf_bellboard_tx.c

View workflow job for this annotation

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

C99_COMMENTS

drivers/mbox/mbox_nrf_bellboard_tx.c:22 do not use C99 // comments
#endif

Check notice on line 23 in drivers/mbox/mbox_nrf_bellboard_tx.c

View workflow job for this annotation

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

You may want to run clang-format on this change

drivers/mbox/mbox_nrf_bellboard_tx.c:23 -//volatile uint32_t app_bellboard_tx_count = 0; -//volatile uint32_t rad_bellboard_tx_count = 0; -//volatile uint32_t sec_bellboard_tx_count = 0; -//volatile uint32_t all_bellboard_tx_count = 0; +// volatile uint32_t app_bellboard_tx_count = 0; +// volatile uint32_t rad_bellboard_tx_count = 0; +// volatile uint32_t sec_bellboard_tx_count = 0; +// volatile uint32_t all_bellboard_tx_count = 0;

#if CONFIG_SOC_NRF54H20_CPUSYS
#include <zephyr/drivers/gpio.h>
extern const struct gpio_dt_spec led0;
extern const struct gpio_dt_spec led1;

#endif

static int bellboard_tx_send(const struct device *dev, uint32_t id, const struct mbox_msg *msg)
{
const struct mbox_bellboard_tx_conf *config = dev->config;
Expand All @@ -26,8 +41,23 @@
return -EMSGSIZE;
}



#if CONFIG_SOC_NRF54H20_CPUSYS

//gpio_pin_toggle_dt(&led0);

Check failure on line 48 in drivers/mbox/mbox_nrf_bellboard_tx.c

View workflow job for this annotation

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

C99_COMMENTS

drivers/mbox/mbox_nrf_bellboard_tx.c:48 do not use C99 // comments

//printk("bellboard id 0x%x\n", (uint32_t)config->bellboard);
//if(config->bellboard == 0x5f09a000) app_bellboard_tx_count++;
//if(config->bellboard == 0x5f09b000) rad_bellboard_tx_count++;
//if(config->bellboard == 0x5f099000) sec_bellboard_tx_count++;
//all_bellboard_tx_count++;
//printk("bellboard_tx_count %d\n", bellboard_tx_count);
#endif

nrfy_bellboard_task_trigger(config->bellboard, nrf_bellboard_trigger_task_get(id));
//nrfy_bellboard_task_trigger(config->bellboard, nrf_bellboard_trigger_task_get(id));

Check notice on line 60 in drivers/mbox/mbox_nrf_bellboard_tx.c

View workflow job for this annotation

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

You may want to run clang-format on this change

drivers/mbox/mbox_nrf_bellboard_tx.c:60 +#if CONFIG_SOC_NRF54H20_CPUSYS +// gpio_pin_toggle_dt(&led0); - #if CONFIG_SOC_NRF54H20_CPUSYS - - //gpio_pin_toggle_dt(&led0); - - //printk("bellboard id 0x%x\n", (uint32_t)config->bellboard); - //if(config->bellboard == 0x5f09a000) app_bellboard_tx_count++; - //if(config->bellboard == 0x5f09b000) rad_bellboard_tx_count++; - //if(config->bellboard == 0x5f099000) sec_bellboard_tx_count++; - //all_bellboard_tx_count++; - //printk("bellboard_tx_count %d\n", bellboard_tx_count); - #endif +// printk("bellboard id 0x%x\n", (uint32_t)config->bellboard); +// if(config->bellboard == 0x5f09a000) app_bellboard_tx_count++; +// if(config->bellboard == 0x5f09b000) rad_bellboard_tx_count++; +// if(config->bellboard == 0x5f099000) sec_bellboard_tx_count++; +// all_bellboard_tx_count++; +// printk("bellboard_tx_count %d\n", bellboard_tx_count); +#endif nrfy_bellboard_task_trigger(config->bellboard, nrf_bellboard_trigger_task_get(id)); - //nrfy_bellboard_task_trigger(config->bellboard, nrf_bellboard_trigger_task_get(id)); + // nrfy_bellboard_task_trigger(config->bellboard, nrf_bellboard_trigger_task_get(id));
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/mbox/mbox_nrf_vevif_event_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ static void vevif_event_rx_isr(const void *device)
uint8_t idx = id - EVENTS_IDX_MIN;

if ((cbs->enabled_mask & BIT(id)) && (cbs->cb[idx] != NULL)) {

cbs->cb[idx](dev, id, cbs->user_data[idx], NULL);
}
}
Expand Down
37 changes: 37 additions & 0 deletions drivers/mbox/mbox_nrf_vevif_task_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,48 @@
LISTIFY(DT_NUM_IRQS(DT_DRV_INST(0)), VEVIF_IRQN, (,))
};

#if 0//CONFIG_SOC_NRF54H20_CPUSYS

Check warning on line 40 in drivers/mbox/mbox_nrf_vevif_task_rx.c

View workflow job for this annotation

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

IF_0

drivers/mbox/mbox_nrf_vevif_task_rx.c:40 Consider removing the code enclosed by this #if 0 and its #endif
#define LED0_NODE DT_ALIAS(led0)

Check notice on line 41 in drivers/mbox/mbox_nrf_vevif_task_rx.c

View workflow job for this annotation

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

You may want to run clang-format on this change

drivers/mbox/mbox_nrf_vevif_task_rx.c:41 -#if 0//CONFIG_SOC_NRF54H20_CPUSYS +#if 0 // CONFIG_SOC_NRF54H20_CPUSYS
#define LED1_NODE DT_ALIAS(led1)
#include <zephyr/drivers/gpio.h>
static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
static const struct gpio_dt_spec led1 = GPIO_DT_SPEC_GET(LED1_NODE, gpios);
#endif

//volatile uint32_t rad_count = 0;
//volatile uint32_t app_count = 0;
//volatile uint32_t sec_count = 0;

Check notice on line 51 in drivers/mbox/mbox_nrf_vevif_task_rx.c

View workflow job for this annotation

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

You may want to run clang-format on this change

drivers/mbox/mbox_nrf_vevif_task_rx.c:51 -//volatile uint32_t rad_count = 0; -//volatile uint32_t app_count = 0; -//volatile uint32_t sec_count = 0; +// volatile uint32_t rad_count = 0; +// volatile uint32_t app_count = 0; +// volatile uint32_t sec_count = 0;
#if CONFIG_SOC_NRF54H20_CPUSYS
#include <zephyr/drivers/gpio.h>
extern const struct gpio_dt_spec led0;
extern const struct gpio_dt_spec led1;

#endif


static void vevif_task_rx_isr(const void *parameter)
{
#if CONFIG_SOC_NRF54H20_CPUSYS
//gpio_pin_toggle_dt(&led0);
#endif

uint8_t channel = *(uint8_t *)parameter;
uint8_t idx = channel - TASKS_IDX_MIN;


#if CONFIG_SOC_NRF54H20_CPUSYS
//if(idx == 18) gpio_pin_toggle_dt(&led1);
//gpio_pin_toggle_dt(&led1);
//if(idx == 18) rad_count++;
#endif

#if CONFIG_SOC_NRF54H20_CPUSYS
//if(idx == 12) gpio_pin_toggle_dt(&led1);
//if(idx == 12) app_count++;
//if(idx == 0) sec_count++;
#endif

Check notice on line 81 in drivers/mbox/mbox_nrf_vevif_task_rx.c

View workflow job for this annotation

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

You may want to run clang-format on this change

drivers/mbox/mbox_nrf_vevif_task_rx.c:81 - static void vevif_task_rx_isr(const void *parameter) { - #if CONFIG_SOC_NRF54H20_CPUSYS - //gpio_pin_toggle_dt(&led0); - #endif +#if CONFIG_SOC_NRF54H20_CPUSYS +// gpio_pin_toggle_dt(&led0); +#endif uint8_t channel = *(uint8_t *)parameter; uint8_t idx = channel - TASKS_IDX_MIN; +#if CONFIG_SOC_NRF54H20_CPUSYS +// if(idx == 18) gpio_pin_toggle_dt(&led1); +// gpio_pin_toggle_dt(&led1); +// if(idx == 18) rad_count++; +#endif - #if CONFIG_SOC_NRF54H20_CPUSYS - //if(idx == 18) gpio_pin_toggle_dt(&led1); - //gpio_pin_toggle_dt(&led1); - //if(idx == 18) rad_count++; - #endif - - #if CONFIG_SOC_NRF54H20_CPUSYS - //if(idx == 12) gpio_pin_toggle_dt(&led1); - //if(idx == 12) app_count++; - //if(idx == 0) sec_count++; - #endif +#if CONFIG_SOC_NRF54H20_CPUSYS +// if(idx == 12) gpio_pin_toggle_dt(&led1); +// if(idx == 12) app_count++; +// if(idx == 0) sec_count++; +#endif
nrf_vpr_csr_vevif_tasks_clear(BIT(channel));

if (cbs.cb[idx] != NULL) {
Expand Down
46 changes: 46 additions & 0 deletions drivers/mbox/mbox_nrf_vevif_task_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <zephyr/devicetree.h>
#include <zephyr/drivers/mbox.h>
#include <zephyr/kernel.h>

#include <haly/nrfy_vpr.h>

Expand All @@ -25,6 +26,39 @@
return ((id <= TASKS_IDX_MAX) && ((config->tasks_mask & BIT(id)) != 0U));
}

#if CONFIG_SOC_NRF54H20_CPURAD
#define LED0_NODE DT_ALIAS(led0)
#define LED1_NODE DT_ALIAS(led1)
#define LED2_NODE DT_ALIAS(led2)
#define LED3_NODE DT_ALIAS(led3)
#define LED4_NODE DT_ALIAS(led4)
#define LED5_NODE DT_ALIAS(led5)
#include <zephyr/drivers/gpio.h>
const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
const struct gpio_dt_spec led1 = GPIO_DT_SPEC_GET(LED1_NODE, gpios);
const struct gpio_dt_spec led2 = GPIO_DT_SPEC_GET(LED2_NODE, gpios);
const struct gpio_dt_spec led3 = GPIO_DT_SPEC_GET(LED3_NODE, gpios);
const struct gpio_dt_spec led4 = GPIO_DT_SPEC_GET(LED4_NODE, gpios);
const struct gpio_dt_spec led5 = GPIO_DT_SPEC_GET(LED5_NODE, gpios);

int mbox_led_init(void)
{
gpio_pin_configure_dt(&led0, GPIO_OUTPUT_ACTIVE);
gpio_pin_configure_dt(&led1, GPIO_OUTPUT_ACTIVE);
gpio_pin_configure_dt(&led2, GPIO_OUTPUT_ACTIVE);
gpio_pin_configure_dt(&led3, GPIO_OUTPUT_ACTIVE);
gpio_pin_configure_dt(&led4, GPIO_OUTPUT_ACTIVE);
gpio_pin_configure_dt(&led5, GPIO_OUTPUT_ACTIVE);

return 0;
}

SYS_INIT(mbox_led_init, PRE_KERNEL_2, 53);

#endif

#define VEVIF_RETRIGGER_DELAY 12

static int vevif_task_tx_send(const struct device *dev, uint32_t id, const struct mbox_msg *msg)
{
const struct mbox_vevif_task_tx_conf *config = dev->config;
Expand All @@ -37,6 +71,18 @@
return -EMSGSIZE;
}

#if CONFIG_SOC_NRF54H20_CPURAD
gpio_pin_toggle_dt(&led0);
#endif

nrfy_vpr_task_trigger(config->vpr, nrfy_vpr_trigger_task_get(id));

k_busy_wait(VEVIF_RETRIGGER_DELAY);

#if CONFIG_SOC_NRF54H20_CPURAD
gpio_pin_toggle_dt(&led0);
#endif

Check notice on line 85 in drivers/mbox/mbox_nrf_vevif_task_tx.c

View workflow job for this annotation

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

You may want to run clang-format on this change

drivers/mbox/mbox_nrf_vevif_task_tx.c:85 - #if CONFIG_SOC_NRF54H20_CPURAD +#if CONFIG_SOC_NRF54H20_CPURAD gpio_pin_toggle_dt(&led0); - #endif +#endif nrfy_vpr_task_trigger(config->vpr, nrfy_vpr_trigger_task_get(id)); k_busy_wait(VEVIF_RETRIGGER_DELAY); - #if CONFIG_SOC_NRF54H20_CPURAD +#if CONFIG_SOC_NRF54H20_CPURAD gpio_pin_toggle_dt(&led0); - #endif +#endif
nrfy_vpr_task_trigger(config->vpr, nrfy_vpr_trigger_task_get(id));

return 0;
Expand Down
35 changes: 35 additions & 0 deletions modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
#include <zephyr/logging/log.h>
#include <zephyr/init.h>

#if CONFIG_SOC_NRF54H20_CPURAD
#include <zephyr/drivers/gpio.h>
extern const struct gpio_dt_spec led2;
#endif

#if CONFIG_SOC_NRF54H20_CPURAD
#include <zephyr/drivers/gpio.h>
extern const struct gpio_dt_spec led1;
#endif

LOG_MODULE_REGISTER(NRFS_BACKEND, CONFIG_NRFS_BACKEND_LOG_LEVEL);

#define MAX_PACKET_DATA_SIZE (CONFIG_NRFS_MAX_BACKEND_PACKET_SIZE)
Expand Down Expand Up @@ -54,6 +64,13 @@
.enabled = true
};

#if CONFIG_SOC_NRF54H20_CPURAD
#include <zephyr/drivers/gpio.h>
extern const struct gpio_dt_spec led3;
extern const struct gpio_dt_spec led4;
extern const struct gpio_dt_spec led5;
#endif

/**
* @brief nrfs backend error handler
*
Expand Down Expand Up @@ -93,7 +110,10 @@
static void ipc_sysctrl_ept_bound(void *priv)
{
LOG_DBG("Bound to sysctrl.");
#if CONFIG_SOC_NRF54H20_CPURAD
gpio_pin_toggle_dt(&led2);
#endif
k_event_post(&ipc_connected_event, IPC_INIT_DONE_EVENT);

Check notice on line 116 in modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c

View workflow job for this annotation

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

You may want to run clang-format on this change

modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c:116 - #if CONFIG_SOC_NRF54H20_CPURAD +#if CONFIG_SOC_NRF54H20_CPURAD gpio_pin_toggle_dt(&led2); - #endif +#endif
atomic_set(&ipc_cpusys_channel_config.status, CONNECTED);

if (k_msgq_num_used_get(&ipc_transmit_msgq) > 0) {
Expand All @@ -101,10 +121,17 @@
}
}

//static struct ipc_data_packet rx_data;

static void ipc_sysctrl_ept_recv(const void *data, size_t size, void *priv)
{

struct ipc_data_packet rx_data;

#if CONFIG_SOC_NRF54H20_CPURAD
//gpio_pin_toggle_dt(&led3);
#endif

Check notice on line 134 in modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c

View workflow job for this annotation

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

You may want to run clang-format on this change

modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c:134 -//static struct ipc_data_packet rx_data; +// static struct ipc_data_packet rx_data; static void ipc_sysctrl_ept_recv(const void *data, size_t size, void *priv) { struct ipc_data_packet rx_data; - #if CONFIG_SOC_NRF54H20_CPURAD - //gpio_pin_toggle_dt(&led3); - #endif +#if CONFIG_SOC_NRF54H20_CPURAD +// gpio_pin_toggle_dt(&led3); +#endif
__ASSERT(size <= MAX_PACKET_DATA_SIZE, "Received data is too long. Config error.");
if (size <= MAX_PACKET_DATA_SIZE) {
rx_data.channel_id = IPC_CPUSYS_CHANNEL_ID;
Expand Down Expand Up @@ -169,15 +196,23 @@
return ret;
}



nrfs_err_t nrfs_backend_send(void *message, size_t size)
{
#if CONFIG_SOC_NRF54H20_CPURAD
//gpio_pin_toggle_dt(&led2);
#endif
return nrfs_backend_send_ex(message, size, K_NO_WAIT, false);
}

nrfs_err_t nrfs_backend_send_ex(void *message, size_t size, k_timeout_t timeout, bool high_prio)
{
if (!k_is_in_isr() && nrfs_backend_connected()) {
#if CONFIG_SOC_NRF54H20_CPURAD
//gpio_pin_toggle_dt(&led2);
#endif
return ipc_service_send(&ipc_cpusys_channel_config.ipc_ept, message, size) ?

Check notice on line 215 in modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c

View workflow job for this annotation

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

You may want to run clang-format on this change

modules/hal_nordic/nrfs/backends/nrfs_backend_ipc_service.c:215 - - nrfs_err_t nrfs_backend_send(void *message, size_t size) { - #if CONFIG_SOC_NRF54H20_CPURAD - //gpio_pin_toggle_dt(&led2); - #endif +#if CONFIG_SOC_NRF54H20_CPURAD +// gpio_pin_toggle_dt(&led2); +#endif return nrfs_backend_send_ex(message, size, K_NO_WAIT, false); } nrfs_err_t nrfs_backend_send_ex(void *message, size_t size, k_timeout_t timeout, bool high_prio) { if (!k_is_in_isr() && nrfs_backend_connected()) { - #if CONFIG_SOC_NRF54H20_CPURAD - //gpio_pin_toggle_dt(&led2); - #endif +#if CONFIG_SOC_NRF54H20_CPURAD +// gpio_pin_toggle_dt(&led2); +#endif
NRFS_SUCCESS : NRFS_ERR_IPC;
} else if (size <= MAX_PACKET_DATA_SIZE) {
int err;
Expand Down
11 changes: 11 additions & 0 deletions samples/bluetooth/hci_ipc/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ static struct ipc_ept_cfg hci_ept_cfg = {
},
};

#include <zephyr/devicetree.h>
#include <zephyr/drivers/mbox.h>

#include <haly/nrfy_vpr.h>

int main(void)
{
int err;
Expand Down Expand Up @@ -407,13 +412,19 @@ int main(void)
LOG_ERR("Registering endpoint failed with %d", err);
}

//NRF_VPR_Type * p_vpr = (NRF_VPR_Type *)NRF_VPR120;

//nrfy_vpr_task_trigger(p_vpr, nrfy_vpr_trigger_task_get(18));

k_sem_take(&ipc_bound_sem, K_FOREVER);

while (1) {
struct net_buf *buf;

buf = k_fifo_get(&rx_queue, K_FOREVER);
hci_ipc_send(buf, HCI_REGULAR_MSG);

//nrfy_vpr_task_trigger(p_vpr, nrfy_vpr_trigger_task_get(18));
}
return 0;
}
6 changes: 6 additions & 0 deletions samples/subsys/mgmt/mcumgr/smp_svr/src/bluetooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ static const struct bt_data sd[] = {
BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
};

#include <zephyr/sys/reboot.h>

static void advertise(struct k_work *work)
{
int rc;
Expand All @@ -38,6 +40,10 @@ static void advertise(struct k_work *work)
return;
}

k_msleep(190);
//k_msleep(1000);
sys_reboot(SYS_REBOOT_WARM);

LOG_INF("Advertising successfully started");
}

Expand Down
17 changes: 16 additions & 1 deletion soc/nordic/nrf54h/gpd/gpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ struct gpd_onoff_manager {
static void start(struct onoff_manager *mgr, onoff_notify_fn notify);
static void stop(struct onoff_manager *mgr, onoff_notify_fn notify);

#define GPD_READY_TIMEOUT_MS 1000
#if CONFIG_SOC_NRF54H20_CPURAD
#include <zephyr/drivers/gpio.h>
extern const struct gpio_dt_spec led4;
extern const struct gpio_dt_spec led5;
#endif

#define GPD_READY_TIMEOUT_MS 100

#define GPD_SERVICE_READY BIT(0)
#define GPD_SERVICE_ERROR BIT(1)
Expand Down Expand Up @@ -139,15 +145,24 @@ static int nrf_gpd_sync(struct gpd_onoff_manager *gpd_mgr)
if (atomic_test_bit(&gpd_service_status, GPD_SERVICE_REQ_OK)) {
return 0;
}
//k_yield();
}

LOG_ERR("nRFs GDPWR request timed out");
while(1);

return -ETIMEDOUT;
}

static void evt_handler(nrfs_gdpwr_evt_t const *p_evt, void *context)
{
#if CONFIG_SOC_NRF54H20_CPURAD
//gpio_pin_toggle_dt(&led4);
//k_busy_wait(10);
//_work_schedule_for_queue(workq, &dev_data->notify_work, K_NO_WAIT);
//ret = mbox_send_dt(&conf->mbox_tx, NULL);
#endif

if (atomic_test_bit(&gpd_service_status, GPD_SERVICE_READY)) {
struct gpd_onoff_manager *gpd_mgr = context;

Expand Down
Loading
Loading