Question about lightweight message queue:

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Question about lightweight message queue:

855 Views
dcooper
Contributor II

I am trying to use _lwmsgq_init(location, num_messages, msg_size) to setup a message queue.

In this case I only need the queue to hold one message at a time and the messages may be a 100+ bytes.

I am using the following to setup the queue:

#define UARTQ_NUM_MESSAGES      1

#define UARTQ_MSG_SIZE                50        //In uint32s, allow for 200 byte messages

#define UARTQ_SIZE                          ((sizeof(LWMSGQ_STRUCT)/sizeof(_mqx_max_type)) + (UARTQ_NUM_MESSAGES * UARTQ_MSG_SIZE))

uint32_t g_uart_tx_msgq[UARTQ_SIZE];

result = _lwmsgq_init((void*)g_uart_tx_msgq, UARTQ_NUM_MESSAGES, UARTQ_MSG_SIZE);

I seem to have some confusion around the msg_size parameter.

If I use the code above code, it does not work.  After receiving a message from the queue the code ends up in the __boot_exception() while(1).

If I set UARTQ_MSG_SIZE to some smaller number (<= 25) and simply allocate the message queue as uint32_t g_uart_tx_msgq[1000], the code runs as expected for messages much larger than 8 bytes.

Is there a limit on the message size for lightweight message queues, or does anyone have other insight into what I am seeing.

Thanks

David

0 Kudos
3 Replies

502 Views
soledad
NXP Employee
NXP Employee

Hello David,

Which MQX version are you using?

Regards

Soledad

0 Kudos

502 Views
dcooper
Contributor II

Soledad

Can you provide any insight on this issue?

Thanks

David

0 Kudos

502 Views
dcooper
Contributor II

The Release Notes in the MQX/doc folder indicate 4.1.0.

Thanks

0 Kudos