In MQX are all the threads in privileged mode ? or do we need to enable them in privilege mode

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

In MQX are all the threads in privileged mode ? or do we need to enable them in privilege mode

Jump to solution
537 Views
josephxavier
Contributor III

In MQX  are all the threads in privileged  mode ? or do we need to enable them in privileged mode using the following steps

#define THREAD_PRIVILEGED                (0ul << 0)

#define THREAD_UNPRIVILEGED              (1ul << 0)

#define TSTACK_MAIN                     (0ul << 1)

#define TSTACK_PROCESS                  (1ul << 1)

__set_PSP(__get_MSP());

     
__set_CONTROL(THREAD_PRIVILEGED| TSTACK_PROCESS);

Before " _mqx( (MQX_INITIALIZATION_STRUCT_PTR)&MQX_init_struct );"

0 Kudos
1 Solution
367 Views
DavidS
NXP Employee
NXP Employee

Hi Joseph,

MQX defaults to privileged mode for all threads.

Please review: C:\Freescale\Freescale_MQX_4_1_1\doc\mqx\MQX_User_Guide.pdf  Section 3.12 User Mode Tasks and Memory Protection should you want to change this default setting.

Regards,

David

View solution in original post

0 Kudos
1 Reply
368 Views
DavidS
NXP Employee
NXP Employee

Hi Joseph,

MQX defaults to privileged mode for all threads.

Please review: C:\Freescale\Freescale_MQX_4_1_1\doc\mqx\MQX_User_Guide.pdf  Section 3.12 User Mode Tasks and Memory Protection should you want to change this default setting.

Regards,

David

0 Kudos