Create Tasks in KDS with MQX_KDSK and PE

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

Create Tasks in KDS with MQX_KDSK and PE

1,654 Views
utsavikalpesh
Contributor V

Hi,

 

I created a project in CodeWarrior using MQX4.0 and I am using TWR-K60D100M.In my Project Say I have total 10 tasks.

 

Now I need to move on KDS and wants to create a project based on MQX_KDS and Processor Export.

I am using KDS v3.2 and KSDKv1.2.0.

 

I started with a small demo to Blink the LED with MQX_Lite and Processor Expert mode, which seems to be working fine.

 

I wants to create a task (Actally I want to create total 10 tasks as per my previous project on Codewarrior). For that I followed "How To_ Create an MQX RTOS for KSDK project with PE" But that is showing me an error(without buiding project) like "Error in the inherited component settings (MQX)".

 

Error came when I select Configure Set : MQX Standards(As I want to use RTCS, MFS).

(Note that this erros is not coming when I select OS: MQX_Lite)

 

How to solve this problem?

 

I want to create a task using OSA_TaskCreate() , not by Adding OS_Task in my project. I have one task and that will create my rest of task. And for that os_task.c will be the main task which will create the rest of my task. 

 

In my case, I created one task and by debugging I come to know that task is created successfully , but task is blocked from the following line...

 

176122_176122.pngTask Blocked on Task Creation.png 

If I have not specified the Task Attribute then how task is block? There is nothing like Task Attribute parameter in OSA_TaskCreate()..

 

What is floating register parameter in OSA_TaskCreate()?  

 

Also I am using RTCS and MFS in my project.So is there any documents available to include MFS and RTCS in PE?

 

Also while studying @ PE, I come to know that PE provides graphical user interface. What is the graphical user interface?

 

Regards,
Utsavi Bharuchwala

10 Replies

726 Views
utsavikalpesh
Contributor V

Hello Is there anyone to provide me the answer?

I am waiting and still hang 

0 Kudos

726 Views
danielchen
NXP TechSupport
NXP TechSupport

It is also possible to create a task from with another task. In MQX, the task create function puts the child in the ready state queue for the task's priority. If the child is if higher priority than the creator, the child becomes the active task, because it is the highest-priority ready task. If the creator is of higher or equal priority, it remains the active task.  The child task running time depends on the scheduler.

Regards

Daniel

726 Views
danielchen
NXP TechSupport
NXP TechSupport

for the file rtcs.h, it is located at C:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\lib\frdmk64f.kds\debug\rtcs

I would suggest you check that folder. And check whether this path is added correctly.

  • Go to menu Project > Properties > C/C++ Build > Settings > Cross ARM C Compiler > Includes and add the following paths:
  • C:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\lib\frdmk64f.kds\debug\rtcs

pastedImage_1.png

Regards

Daniel

0 Kudos

726 Views
utsavikalpesh
Contributor V

Hi Daniel,

I solved the problem.

I am working with KDS v3.2 and KSDK v1.2 with TWR-K60D100M. 

As per my study I come to know that project created with KSDK and Processor Expert mode will link the library only which are inside the project itself.

Followings are steps which cleared rtcs.h file not found error.

1. Import->FileSystem-> rtcs from C:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\lib\twrk60d100m.kds\debug\rtcs in my current project.

2. In Cross ARM C Compiler->Include , I added ${ProjDirPath}/rtcs instead of C:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\lib\twrk60d100m.kds\debug\rtcs

3. In Cross ARM C++ Linker->Miscellaneous, I include ${ProjDirPath}/rtcs/lib_rtcs.a instead of C:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\lib\twrk60d100m.kds\debug\rtcs\lib_rtcs.a

4. Remaining setting are same as per https://community.nxp.com/docs/DOC-106170 

And this solved my problem.

I simply import rtcs folder inside my project and give the library path of project(${ProjDirPath}/rtcs and  ${ProjDirPath}/rtcs/lib_rtcs.a are path showing that rtcs.h and lib_rtcs.a is now inside my project ).

The Same setting is working for MFS library. Instead of rtcs folder, I Include mfs folder and done the settings as above in terms of mfs.

Regards

Utsavi Bharuchwala

726 Views
utsavikalpesh
Contributor V

Hi Daniel,

Thanks for reply.

As I said in my previous query that I am using TWR-K60D100M(MK60DN512VMD10). 

I already attached the project with my previous mail.

I write C:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\lib\twrk60d100m.kds\debug\rtcs inside Cross ARM C Compiler->Include.

I can see the folders as per path also.  

I followed the steps ofhttps://community.nxp.com/docs/DOC-106170 perfectly and done the same settings for my twrk60d100m.

But I am unable to resolve rtcs.h file error.:smileysad:

I can see that project in KDS can able to link only those libraries which are lies inside the project itself. rtcs.h is not inside the project. It lies in C:\Freescale\KSDK_1.2.0\middleware\tcpip\rtcs\lib\twrk60d100m.kds\debug\rtcs

But I can open rtcs.h by right click-> open declaration from rtcs_main_task.c file. Though it is showing me rtcs.h file or directory not found..!!

Regards

Utsavi Bharuchwala

0 Kudos

726 Views
utsavikalpesh
Contributor V

Hello,

I am beginner for Processor Expert. 

How to remove "Error in the inherited component settings (MQX)"? Is there any demo available for using MQX Standard instead MQX Lite in osa1: fsl_os_abstraction?

Can anybody tell me how to create task using OSA_TaskCreate() instead of using Processor Expert Components?

Waiting for the guidance. 

Regards,

Utsavi Bharuchwala

0 Kudos

726 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Utsavi Bharuchwala:

For create task using OSA_TaskCreate(), I would suggest you refer to the following code

///////////////////////////////////////////////////////////////////////////////

// Prototypes

///////////////////////////////////////////////////////////////////////////////

void task_one(task_param_t param);

 

 

///////////////////////////////////////////////////////////////////////////////

// Code

///////////////////////////////////////////////////////////////////////////////

int main(void)

{

        osa_status_t result = kStatus_OSA_Error;

 

        hardware_init();

 

        //set up the basic RTOS services

        OSA_Init();

 

        //create task

        result = OSA_TaskCreate(task_one,

                        (uint8_t *)"task_one",

                        TASK_ONE_STACK_SIZE,

                        task_one_stack,

                        TASK_ONE_PRIO,

                        (task_param_t)0,

                        false,

                        &task_one_task_handler);

 

        //validate task creation

        if(result != kStatus_OSA_Success)

        {

                PRINTF("Failed to create task one\n\r");

        }

 

        //start the RTOS scheduler

        OSA_Start();

 

        while(1){}      //Should not reach this point

        return 0;

}

 

Regards

Daniel

726 Views
utsavikalpesh
Contributor V

Thanks Denial,

I was writing OSA_TaskCreate() inside os_task.c file. I was creating tasks inside task.

In my project I created some tasks based on condition. On Condition occurs, the tasks will be created.

So is it compulsory to create task inside main.c file?  

Say I created a task name start_task, Add_task. Now  if subtract function present (say this is checked by add_task) then  I need to create Subtract_task (using OSA_TaskCreate() ). Is it possible to create this task inside Add_task?

Regards

Utsavi Bharuchwala

 

 

0 Kudos

726 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Utsavi Bharuchwala:

Please check the below post to remove "Error in the inherited component settings (MQX)"

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

I also copied here

By the way, if you select MQX Standard in the MQX_KSDK Configuration parameters, the remaining steps will look like this.  This is because the MQX Standard configuration uses the more full featured fsl_uart component for serial communication, while the MQX Lite configuration uses the simpler DbgCs debug console component.

 

Select MQX Standard.

2015-01-27_15-27-15.png

Click on the DbgCs1 component.

2015-01-27_15-28-43.png

Disable it by un-checking the Component Enabled checkbox.

2015-01-27_15-28-11.png

 

Now configure the fsl_uart component (used in place of DbgCs1).

2015-01-27_15-30-03.png

Select the UART to use and the pins.

2015-01-27_15-29-42.png

 

On the Configurations tab, select a baud rate.  Note:  You may have to tweak the clock configurations to work with your selected baud rate or vice versa (see above).

2015-01-27_15-31-21.png

 

Now generate the code as in the steps above and write your tasks!

 

With MQX Standard, you can now access the tcp/ip stack, file system, posix io subsystem, and other advanced features included with MQX RTOS. 

Regards

Daniel

726 Views
utsavikalpesh
Contributor V

Thanks Daniel,

Thanks for guidance. I create project using MQX_Standard.

Now I am able to generate Processor Expert code for MQX_Standard without

any error.

As I said in my query that, I need to add RTCS and MFS in project. For that I go through Adding RTCS to a Processor Expert Project

<https://community.nxp.com/thread/358525> and How to add RTCS to a Processor Expert Project Using KDS and KSDK

<https://community.nxp.com/docs/DOC-106170> . I am using TWR-K60D100M (MK60DN512VMD10).

I follows all the steps but unable to remove errorlike: "fatalerror: rtcs.h: No such file or directory" .(Note that I build rtcs_twrk60d100m library too.)

There are two doubts I have for Adding RTCS to processor expert.

1. Route the ENET pins: (I am using TWR-K60D100M-MK60DN512VMD10 for that

which pins needs to be route?)

2. Add phy8081 or phy8041 for TWR-K60D100M?

Will it create effect on linking rtcs.h file?

I am using KDS v3.2 and KSDk v1.2.

I am attaching project with this.

How to solve this error?

Regards

Utsavi Bharuchwala

On Fri, Feb 17, 2017 at 10:28 AM, danielchen@fsl <admin@community.nxp.com>

0 Kudos