how to use mutex on mqxlite?

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

how to use mutex on mqxlite?

Jump to solution
868 Views
yarannan
Contributor III

Hi,

I am building a project that is based on platform KDS3.0 +KSDK1.2+PEx.

I am using MQXLite OS. It is not allow me to enable mutex. It said it doesnt

support. I have to run multi threads with some shared variables. Is there

any way that I can get around this issue?

Thanks,

Yaran

0 Kudos
1 Solution
631 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Yaran:

Here is a document to enable MQX Lite in KSDK1.1 , you can choose "mutexes"   component to enable mutex, and rebuild all. 

How To: Create an MQX RTOS for KSDK project with Processor Expert in Kinetis Design Studio IDE

I tried it with KSDK1.3 , it seems mutex is hidden in this version, it only suuport lightweight events and lightweight message queues in this version

pastedImage_4.png

Regards

Daniel

View solution in original post

0 Kudos
3 Replies
631 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Yaran:

MQX Lite supports lightweight subset of the MQX componets: LW semaphore, LW evet, Mutex, LW message.

There is an example using mutex

C:\Freescale\CW MCU v10.6\MCU\CodeWarrior_Examples\Processor_Expert\MQXLite\Kinetis\FRDM_KL25Z\MUTEX_KL25Z

Mutex is an optional component, the default state is disable.

I think if you add the below line into user_config.h, and recompile all. it should able to support mutex.

#define MQX_USE_MUTEXES           1

I am attaching the mqxlite user manual here.

Regards

0 Kudos
631 Views
yarannan
Contributor III

I did that and it threw me error when I run the program. It said

DescriptionResourcePathLocationType
#error MUTEX component is currently disabled in MQX kernel. Please set MQX_USE_MUTEXES to 1 in mqx_sdk_config.h and recompile kernel.mutex.h/shiny_v3/SDK/rtos/mqx/mqx/source/includeline 36C/C++ Problem

So how would i be able to recompile the kernel from KDS?

Thanks,

0 Kudos
632 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Yaran:

Here is a document to enable MQX Lite in KSDK1.1 , you can choose "mutexes"   component to enable mutex, and rebuild all. 

How To: Create an MQX RTOS for KSDK project with Processor Expert in Kinetis Design Studio IDE

I tried it with KSDK1.3 , it seems mutex is hidden in this version, it only suuport lightweight events and lightweight message queues in this version

pastedImage_4.png

Regards

Daniel

0 Kudos