Counting semaphore usage and abrupt halt at ConfigASSERT(pxQueue)


We tried porting freeRTOs 10.4 kernel to RH850 closely following the available ports at

We are able to successfully build and debug using GHS IDE but when we migrate to eclipse based GHS environment we encounter an exception at ConfigASSERT(pxQueue). this doesnot happen in GHS IDE but only in eclipse toolchain and in case both binary and counting semaphores are being used.

We are surprised as to what changes things in a toolchain based system.

we tried out the different options such as introducing a delay after tasks are created and putting all source code into a single file and so on but no difference made .

we checked the freeRTOS configuration and found configASSERT is defined to be just a disable interrupts and a infinite loop to hang around. Thinking to try to replace it with a tracelog using sprintf and va_arg stuff.

Any suggestions please?

Thanks in advance

This assert means that pxQueue is NULL i.e. the FreeRTOS object (semaphore/queue/mutex) is used before creation.

What is the callstack when you hit the assert? That should provide some hint. Also, do you check return values of FreeRTOS APIs?

ok but why it works in the GHS IDE and why not in the eclipse based GHS toolchain?

any anomalies w.r.t toolchain observed before?

I will try to check call stack and get back.


BTW Is the semaphore handle a global/static variable ?

There could be multiple reasons including different code generated by different compilers. We would be able to find why it works in different IDE once we find the reason of the failure.

as you can see in attached file, the semaphore variables are global

ok, anyways one project is IDE based and another eclipse based but of the same compiler.

I attached the code we are trying to test.

we also use heap_4.c as the choice of memory manager.

test.c (2.0 KB)
main.c (6.4 KB)

Did you find the callstack when you hit assert?