Application Level Task creation

Learn MoreFAQsTutorials

11 posts / 0 new
Last post
balaji
Offline
Last seen:6 days 13 hours ago
加入:2019-12-06 06:48
Application Level Task creation

Hi Dialog,

基于我的申请,我需要创建多个threads ,to run each thread independently. For example I have two task

1. LED has to blink for every 500 ms

2. Get one Pin Status whether its high or Low

I have used app_easy_timer() from ble but it needs BLE to be active.

How do i initialise a task , can you post a simple led blinking task.

Ragards,

BALAJI

PM_Dialog
Offline
Last seen:30分钟34秒前
工作人员
加入:2018-02-08 11:03

Hi Balaji,

The app_easy_timer()is using the BLE Timer, so that’s why you can use that API in a BLE project. You could also use it to wakeup periodically. The SDK includes a blinky example without a BLE activity. It is under 6.0.14.1114\projects\target_apps\peripheral_examples\blinky SDk path.

Thanks, PM_Dialog

balaji
Offline
Last seen:6 days 13 hours ago
加入:2019-12-06 06:48
Hi Dialog,

Hi Dialog,

It looks like i haven't asked my query correctly,

what I need is to create a Tasks ot threads with individual Id , call back function , timer value. and every task should be independent , its called multi-threading. I refered following links

http://lpccs-docs.dialog-semiconductor.com/Tutorial_SDK6/digital_in.html

http://lpccs-docs.dialog-semiconductor.com/Tutorial_SDK6/timer.html

They have made LED on if bluetooth connection is made or led off while dis-connection. It worked so i thought of using it in my user defined function.

Consider any ble project, when the code reaches user_app_init() function , i need to create two timers with a timer value , callback function. I tried it with above links , it works only when app_easy_timer() is called after ble connection, when i call it inside a user defined function then it don't works.

Attaching code which i made it has function called user_led_thread() , which has 10 seconds timeout and has to initiate a call back of LED toggle function mapped to it.

But it's not working , correct my code if I'm wrong.

附件:
balaji
Offline
Last seen:6 days 13 hours ago
加入:2019-12-06 06:48
Hi Dialog,

Hi Dialog,

I have the above issue still not resolved. what is use of ke_task files , is it possible to create task using following API's

ke_task_init()

ke_task_create()

I need to create a application level task which is periodic without configuring hardware timers.

Thanks in advance !

Br,

Balaji

PM_Dialog
Offline
Last seen:30分钟34秒前
工作人员
加入:2018-02-08 11:03
Hi Balaji,

Hi Balaji,

I checked you attached code but to honest I am little bit confused. Could you please help me to understand what is your requirement? You mentioned “multi-threading” but in the DA145xx product family does not include a OS to support multi-threading.

Can you please run it in debug mode, add a breakpoint into led_blink_timer_cb(0 and check if the breakpoint hits?

If you could describe better what you would to accomplish it would be very helpful to understand your requirement and provide support.

Thanks, PM_Dialog

balaji
Offline
Last seen:6 days 13 hours ago
加入:2019-12-06 06:48
Hi Dialog,

Hi Dialog,

Our Product is hand held BLE product, which usees three sensors characteristics inside a custom profile. The Sensor data is notified periodically. To process sensor data I'm configuring a hardware timer 0. How to execute these two things without masking ,it in a multi-thread environment.

PM_Dialog
Offline
Last seen:30分钟34秒前
工作人员
加入:2018-02-08 11:03
Hi Balaji

Hi Balaji

Apologies for the delay. Could you please let us know if the last comment is related to your new forum ticket?

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/ultrasonic-interface-using-timer

Thanks, PM_Dialog

balaji
Offline
Last seen:6 days 13 hours ago
加入:2019-12-06 06:48
Hi Dialog,

Hi Dialog,

Yes Both queries are inter-linked.

Regards,

BALAJI

PM_Dialog
Offline
Last seen:30分钟34秒前
工作人员
加入:2018-02-08 11:03
Hi Balaji,

Hi Balaji,

Thanks for the update. Let’s continue the discussion in your new entered ticket ( I am working into that).

Thanks, PM_Dialog

balaji
Offline
Last seen:6 days 13 hours ago
加入:2019-12-06 06:48
Hi Dialog,

Hi Dialog,

I have some clarifications with above thread

I refered following links

http://lpccs-docs.dialog-semiconductor.com/UM-B-119_DA14585-DA14531_SW_P...

http://lpccs-docs.dialog-semiconductor.com/UM-B-119_DA14585-DA14531_SW_P...

I need to know how to use Real time kernel available in BLE stack to create user application tasks.

Br,

BALAJI

PM_Dialog
Offline
Last seen:30分钟34秒前
工作人员
加入:2018-02-08 11:03
Hi Balaji,

Hi Balaji,

Could you please indicate what you are trying to implement? The DA145xx product family is not running an OS, like the DA146xx, so multitasking is not possible.

The SDK includes event driven kernel making application development easy. The kernel offers the following features:

● Task creation and state transition.

● Message exchange between tasks.

● Timer management.

● Dynamic memory allocation.

● BLE events scheduling and handling.

The core of the kernel is a scheduler running in the main loop of the application. The scheduler checks if an event is set and services the pending events by calling the corresponding handler. The event may be a BLE or timer event, a message between two tasks.

The SDK provides the “app_easy_” APIs that should be used for the application development.

Thanks, PM_Dialog