Hello Nordic team,
I'm looking for some help about Thread creation ... I try to start a Thread when my nrf52840 receive a particular message. This message is sent with BLE mesh and when it's the same node that sends and receives the message the thread is created but when it's two different nodes which send and receive the message, the thread creation failed and my node reset (Cf picture)

Here my code for the Thread creation :
/* size of stack area used by each thread */
#define STACKSIZE 1024
/* scheduling priority used by each thread */
#define PRIORITY -7
void thread(struct bt_mesh_model *model, uint16_t address, struct bt_mesh_datas_state *datas_state_srv);
K_KERNEL_STACK_DEFINE(my_thread_stack, STACKSIZE);
static int bt_mesh_handle_message_request(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf){
printk("SERVER : receive request message \n");
uint32_t receive_offset = net_buf_simple_pull_le32(buf);
size_t receive_size = net_buf_simple_pull_le32(buf);
printk("SERVER : receive offset = %d and size = %zu \n", receive_offset, receive_size);
struct bt_mesh_datas_state datas_state_srv = {
.address = SHARED_RAM_ADDRESS + receive_offset,
.datas = (uint32_t *) datas_state_srv.address,
.remaining_datas = receive_size
};
struct k_thread my_thread_data;
uint16_t addr = ctx->addr;
k_thread_create(&my_thread_data, &my_thread_stack, STACKSIZE, thread_function, model, addr, &datas_state_srv, PRIORITY, 0, K_NO_WAIT);
return 0;
}
What can cause this type of error ?
I'm using nrf connect sdk version 1.9.1 with 2 nrf52840 development kit.
Thank you
Maureen