Problem with Array of Queues in FreeRTOS?

At first glance I cannot see anything obviously wrong. The problem might be outside of the code you have shown, like how is can_rx0_queue declared, how is the interrupt entered, which port are you using, etc There is a FreeRTOS support forum, linked to from the FreeRTOS home page FreeRTOS.org Regards.

At first glance I cannot see anything obviously wrong. The problem might be outside of the code you have shown, like how is can_rx0_queue declared, how is the interrupt entered, which port are you using, etc. There is a FreeRTOS support forum, linked to from the FreeRTOS home page FreeRTOS.org Regards.

I think Richard is right. The problem could be issues that are not within your code that you have posted here. Are you calling any form of suspension on the receiving Task that is waiting on the Queue?

When you invoke a vTaskSuspend() on a Task that is blocked waiting on a Queue, the Task that is suspended will be moved to the pxSuspendedTaskList and it will "forget" that it is waiting on an Event Queue because the pvContainer of xEventListItem in that Task will be set to NULL. You might want to check if your receiving Task is ever suspended while waiting on a Queue. Hope that helped.

Cheers!

Your shared memory should at least be declared volatile: volatile xQueueRegistryItem rxQueueStoreMAX_NUMBER_OF_RX_QUEUES ; volatile int numberOfQueuesRegistered ; otherwise the compiler may optimise out read or writes to these because it has no concept of different threads of execution (between the ISR and the main thread). Also I recall that some PIC C runtime start-up options do not apply zero-initialisation of static data in order to minimise start-up time, if you are using such a start-up, you should explicitly initialise numberOfQueuesRegistered. I would suggest that to do so would be a good idea in any case.It is not clear from your code that RxMessage in the ISR is not the same as RxMessage in the 'remote module'; they should not be shared, since that would allow the ISR to potentially modify the data while the receiving thread was processing it.

If they could be shared, there would ne no reason to have a queue in the first place, since shared memory and a semaphore would suffice. As a side-note, there is never any need to cast a pointer to void*, and you should generally avoid doing so, since it will prevent the compiler from issuing an error if you were to pass something other than a pointer. The whole point of a void* is rather that it can accept any pointer type.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions