Running multiple tasks on KL03Z with uTasker1.4?

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

Running multiple tasks on KL03Z with uTasker1.4?

515 Views
raff5184
Contributor II

Hi,

is it possible to run multiple tasks in parallel on a KL03Z? 

In Kinetis Design Studio, with uTasker1.4, I set one of my tasks to configure and read data from the ADC in the ctTaskTable[ ], like this:

{ "x marks my ADC Config task!!", myADC_configTask, NO_QUE, (DELAY_LIMIT)(1 * SEC), (DELAY_LIMIT)(0.5 * SEC), UTASKER_STOP}

Then I use the OWN_TASK to perform other operations (not on the ADC). 

Both tasks print something to the debug terminal using fnDebugMsg().

Both tasks work only if I schedule one of them at the time. If I schedule both to work in parallel the first taskis only partially executed and then everything stalls

Labels (1)
0 Kudos
1 Reply

305 Views
mjbcswitzerland
Specialist V

Hi

You can run multiple tasks on the KL03 - see http://www.utasker.com/docs/uTasker/uTaskerV1.4_user_guide.PDF for an introduction.
If the second task causes failure it is probably that it is due to an error in the task's code or else due to lack of resources - beware that the KL03 has very limited SRAM so queue sizes (including UART output queue) and general variables/arrays need to be monitored.

I recommend simulating all work before running on the HW since it will allow deficiencies in heap or general errors to be found easier. Once it runs in the KL03 simulator move to HW to verify and use the memory monitoring command (in the command line menu) to monitor RAM use (stack) too. Start with small code and build up, continuously monitoring the RAM consumption and stack safety margin as work develops to know exactly where you stand with resource utilisation.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis KL02/KL03/KL05:
- http://www.utasker.com/kinetis/FRDM-KL02Z.html
- http://www.utasker.com/kinetis/FRDM-KL03Z.html
- http://www.utasker.com/kinetis/FRDM-KL05Z.html


Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M

For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

0 Kudos