-
Hello,I am writing a code that has 2 threads. One puts data in a queue and the other gets the data from the queue. The problem is after I get the data from the queue and it's printed, the device gives an error and reboots. I think the problem might be in my definition of the queue, since I have a different queue that works normally. Here is how I define it:in queues.h
struct data_time{uint64_t time1;uint64_t time2;uint64_t time3;uint64_t time4;};K_MSGQ_DEFINE(data_timeq, sizeof(struct data_time), 4, 1);In main:
struct sensor_q_adrrs{struct k_msgq* msgq_data_pointer;struct k_msgq* msgq_time_pointer;};struct sensor_q_adrrs sensor_q = {.msgq_data_pointer = &data_senq,.msgq_time_pointer = &data_timeq,} ;In the other files that I use so it's connected to the main:struct k_msgq* time_q1;void register_msgq_addres2(struct k_msgq* ptr_from_main_data, struct k_msgq* ptr_from_main_time){printk("\n gets to register_msgq_addres1");data_q1 = ptr_from_main_data; time_q1 = ptr_from_main_time;}I would really appreciate it if any tips can be given on what I do wrong with the definition.The error I get when the code reboots is:Faulting instruction address (r15/pc): 0x00000000