{"id":5922,"date":"2021-03-26T05:52:08","date_gmt":"2021-03-26T05:52:08","guid":{"rendered":"http:\/\/fastbitlab.com\/?p=5922"},"modified":"2023-09-02T15:21:20","modified_gmt":"2023-09-02T09:51:20","slug":"task-create-api","status":"publish","type":"post","link":"https:\/\/fastbitlab.com\/blog\/task-create-api\/","title":{"rendered":"FreeRTOS Lecture 22 &#8211; Task Create API"},"content":{"rendered":"<div class=\"boldgrid-section\" style=\"background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"container\">\n<div class=\"row\" style=\"padding-top: 15px; padding-bottom: 0px; background-image: linear-gradient(to left, #eeeeee, #eeeeee);\" data-bg-color-1=\"#EEEEEE\" data-bg-color-2=\"#EEEEEE\" data-bg-direction=\"to left\">\n<div class=\"col-md-1 col-sm-12 col-xs-12 col-lg-1\">\n<p>&nbsp;<\/p>\n<\/div>\n<div class=\"col-md-10 col-sm-12 col-xs-12 col-lg-10\">\n<h1 class=\"\" style=\"text-align: center; font-size: 31px; border-width: 0px; line-height: 50px;\"><span style=\"color: #000080;\">Task Create API<\/span><\/h1>\n<div class=\"row bg-editor-hr-wrap\" style=\"border-width: 0px; margin-top: -25px;\">\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\n<div>\n<p>&nbsp;<\/p>\n<div class=\"bg-hr bg-hr-10 color2-color\" style=\"border-style: solid; border-width: 0px 0px 3px;\"><\/div>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">In the previous article, we learn about the <span style=\"color: #0000ff;\"><a style=\"color: #0000ff;\" href=\"http:\/\/fastbitlab.com\/what-is-the-tasks\/\" target=\"_blank\" rel=\"noopener\">task<\/a><\/span>. In this article, let\u2019s understand FreeRTOS APIs to schedule a task.<\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The API xTaskCreate (Figure 1) is used to create a task. <\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The xTaskCreate is a FreeRTOS API, which dynamically creates a task in the memory. Before using any task, you first create it in the memory. <\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">The API xTaskCreate will give rise to a task control block in the memory and associated stack space for the task. That\u2019s why before using any task, you have to create it.<\/span><\/p>\n<figure id=\"attachment_5924\" aria-describedby=\"caption-attachment-5924\" style=\"width: 744px\" class=\"wp-caption aligncenter\"><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-5924\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2021\/03\/Figure-1-31.png\" alt=\"Syntax of xTaskCreate API\" width=\"744\" height=\"307\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31.png 1899w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-300x124.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-768x317.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-1024x422.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-600x247.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-120x49.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-500x206.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-200x82.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-400x165.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-800x330.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-1-31-1200x495.png 1200w\" sizes=\"(max-width: 744px) 100vw, 744px\" \/><figcaption id=\"caption-attachment-5924\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 1. Syntax of xTaskCreate API.<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Now let\u2019s explore various parameters of xTaskCreate API:<\/span><\/p>\n<p class=\"\" style=\"margin-left: 15px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">1. The first parameter is pvTaskCode, which is of the type TaskFunction_t. In the place of pvTaskCode, you have to mention the name of the task function, which we discussed in the previous article. Here you have to mention the task name of the function name that is going to handle the task.<\/span><\/p>\n<p class=\"\" style=\"margin-left: 15px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">2. And the second parameter is a constant string (constpcName). Here you can mention the descriptive name for the task.&nbsp;<\/span><\/p>\n<p class=\"\" style=\"margin-left: 15px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">3. Next parameter is stack size (usStackDepth). Always remember that a task will have its own function and stack space. When the task is scheduled to run, the task function corresponding to that task will be executed, and the task function uses the stack space of the task to save the local variables and the context of the task during context switching.<\/span><\/p>\n<p class=\"\" style=\"margin-left: 15px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">Let\u2019s say you have created Task1. When you create a Task1, it should have its own task handler or task function, which is a place where you write code and implement your task, and also, a task must have its own stack memory. While creating a task, you have to mention the size of the stack. All the local variables you create inside the task function of this task will be created in the associated stack. Whenever the task wants to save its context during preemption or something, all the status information, context, and registers will be stored in its corresponding stack. We will explore more about context switching later, where you will learn how the stack is used and how it is switched from one task to another task.<\/span><\/p>\n<p class=\"\" style=\"margin-left: 15px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\">4.&nbsp;<span style=\"font-weight: 400;\">The fourth parameter is just a pointer (pvParameters), which you can pass to the task function. For example, the task function takes a void pointer as an input parameter (Figure 2). To send data to the task handler, you can use pvParameters parameter. Whatever data pointer you mention for pvParameters parameter will be passed to the task function handler.<\/span><\/span><\/p>\n<figure id=\"attachment_5925\" aria-describedby=\"caption-attachment-5925\" style=\"width: 744px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-5925\" src=\"http:\/\/fastbitlab.com\/wp-content\/uploads\/2021\/03\/Figure-2-31.png\" alt=\"Task Create API\" width=\"744\" height=\"302\" srcset=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31.png 1821w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-300x122.png 300w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-768x312.png 768w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-1024x416.png 1024w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-600x243.png 600w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-120x49.png 120w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-500x203.png 500w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-669x272.png 669w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-200x81.png 200w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-400x162.png 400w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-800x325.png 800w, https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31-1200x487.png 1200w\" sizes=\"(max-width: 744px) 100vw, 744px\" \/><figcaption id=\"caption-attachment-5925\" class=\"wp-caption-text\"><span style=\"color: #000000;\">Figure 2. Task handler.<\/span><\/figcaption><\/figure>\n<p class=\"\">&nbsp;<\/p>\n<p class=\"\" style=\"margin-left: 15px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\">5.&nbsp;<span style=\"font-weight: 400;\">The next parameter is the priority of the task (uxPriority). Using this parameter, you can mention the priority for a task.<\/span><\/span><\/p>\n<p class=\"\" style=\"margin-left: 15px; border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"color: #000000;\">6.&nbsp;<span style=\"font-weight: 400;\">After that, pxCreatedTask is the 6th parameter of the task create API, which is actually a handle to the created task control block. pxCreatedTask parameter is a pointer to the created task in the memory. That pointer we call it as a handle of a task. If you want to get that pointer, all you need to do is just pass the pointer of TaskHandle_t data type in the task create API, and then the task create function will fill up that variable with the task pointer, which will call as a task handle.<\/span><\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">All the above-discussed parameters are not mandatory to provide, but you must mention the name of the task function, and constpcName can be mentioned as a NULL if you don\u2019t want to mention any descriptive name. Stack depth must be mentioned. If you don\u2019t have any data to send to a task function, then you can mention pvParameters as NULL. You should mention priority. <\/span><\/p>\n<p class=\"\" style=\"border-width: 0px; font-family: 'Roboto Slab'; font-weight: 400; font-size: 17px; line-height: 30px;\" data-font-family=\"Roboto Slab\" data-font-weight=\"400\" data-font-style=\"\"><span style=\"font-weight: 400; color: #000000;\">A handler is optional, and you can mention it as NULL.<\/span><\/p>\n<p class=\"\">&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Task Create API &nbsp; &nbsp; In the previous article, we learn about the task. In this article, let\u2019s understand FreeRTOS APIs to schedule a task. The API xTaskCreate (Figure 1) is used to create a task. The xTaskCreate is a FreeRTOS API, which dynamically creates a task in the memory. Before using any task, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5925,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"0","ocean_custom_header_template":"0","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"off","ocean_gallery_id":[],"footnotes":""},"categories":[8],"tags":[19],"class_list":["post-5922","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-freertos-lectures","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>FreeRTOS Task Create API for Task Scheduling<\/title>\n<meta name=\"description\" content=\"Task Create API. Let\u2019s understand FreeRTOS APIs to schedule a task. The API xTaskCreate is used to create a task. The xTaskCreate\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fastbitlab.com\/blog\/task-create-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FreeRTOS Task Create API for Task Scheduling\" \/>\n<meta property=\"og:description\" content=\"Task Create API. Let\u2019s understand FreeRTOS APIs to schedule a task. The API xTaskCreate is used to create a task. The xTaskCreate\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fastbitlab.com\/blog\/task-create-api\/\" \/>\n<meta property=\"og:site_name\" content=\"FastBit EBA\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/fastbiteba\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-26T05:52:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-09-02T09:51:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1821\" \/>\n\t<meta property=\"og:image:height\" content=\"739\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"FastBitLab\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:site\" content=\"@fastbiteba\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"FastBitLab\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/\"},\"author\":{\"name\":\"FastBitLab\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\"},\"headline\":\"FreeRTOS Lecture 22 &#8211; Task Create API\",\"datePublished\":\"2021-03-26T05:52:08+00:00\",\"dateModified\":\"2023-09-02T09:51:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/\"},\"wordCount\":654,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Figure-2-31.png\",\"keywords\":[\"FreeRTOS Lectures\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/\",\"name\":\"FreeRTOS Task Create API for Task Scheduling\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Figure-2-31.png\",\"datePublished\":\"2021-03-26T05:52:08+00:00\",\"dateModified\":\"2023-09-02T09:51:20+00:00\",\"description\":\"Task Create API. Let\u2019s understand FreeRTOS APIs to schedule a task. The API xTaskCreate is used to create a task. The xTaskCreate\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/#primaryimage\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Figure-2-31.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Figure-2-31.png\",\"width\":1821,\"height\":739,\"caption\":\"Figure 2. Task handler.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/task-create-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FreeRTOS Lecture 22 &#8211; Task Create API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"name\":\"FastBit EBA\",\"description\":\"Your Online Academy of Embedded Systems\",\"publisher\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#organization\",\"name\":\"FastBit EBA\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"contentUrl\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/logo-EzNrEnyr.png\",\"width\":640,\"height\":640,\"caption\":\"FastBit EBA\"},\"image\":{\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/fastbiteba\\\/\",\"https:\\\/\\\/x.com\\\/fastbiteba\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/fastbit-embedded-brain-academy-b3167b124\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCa1REBV9hyrzGp2mjJCagBg\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/fastbitlab.com\\\/blog\\\/#\\\/schema\\\/person\\\/e32b38e733a0d76ffa7e6bc998652e5d\",\"name\":\"FastBitLab\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g\",\"caption\":\"FastBitLab\"},\"description\":\"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FreeRTOS Task Create API for Task Scheduling","description":"Task Create API. Let\u2019s understand FreeRTOS APIs to schedule a task. The API xTaskCreate is used to create a task. The xTaskCreate","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fastbitlab.com\/blog\/task-create-api\/","og_locale":"en_US","og_type":"article","og_title":"FreeRTOS Task Create API for Task Scheduling","og_description":"Task Create API. Let\u2019s understand FreeRTOS APIs to schedule a task. The API xTaskCreate is used to create a task. The xTaskCreate","og_url":"https:\/\/fastbitlab.com\/blog\/task-create-api\/","og_site_name":"FastBit EBA","article_publisher":"https:\/\/www.facebook.com\/fastbiteba\/","article_published_time":"2021-03-26T05:52:08+00:00","article_modified_time":"2023-09-02T09:51:20+00:00","og_image":[{"width":1821,"height":739,"url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31.png","type":"image\/png"}],"author":"FastBitLab","twitter_card":"summary_large_image","twitter_creator":"@fastbiteba","twitter_site":"@fastbiteba","twitter_misc":{"Written by":"FastBitLab","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/#article","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/"},"author":{"name":"FastBitLab","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d"},"headline":"FreeRTOS Lecture 22 &#8211; Task Create API","datePublished":"2021-03-26T05:52:08+00:00","dateModified":"2023-09-02T09:51:20+00:00","mainEntityOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/"},"wordCount":654,"commentCount":0,"publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31.png","keywords":["FreeRTOS Lectures"],"articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fastbitlab.com\/blog\/task-create-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/","url":"https:\/\/fastbitlab.com\/blog\/task-create-api\/","name":"FreeRTOS Task Create API for Task Scheduling","isPartOf":{"@id":"https:\/\/fastbitlab.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/#primaryimage"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/#primaryimage"},"thumbnailUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31.png","datePublished":"2021-03-26T05:52:08+00:00","dateModified":"2023-09-02T09:51:20+00:00","description":"Task Create API. Let\u2019s understand FreeRTOS APIs to schedule a task. The API xTaskCreate is used to create a task. The xTaskCreate","breadcrumb":{"@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fastbitlab.com\/blog\/task-create-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/#primaryimage","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2021\/03\/Figure-2-31.png","width":1821,"height":739,"caption":"Figure 2. Task handler."},{"@type":"BreadcrumbList","@id":"https:\/\/fastbitlab.com\/blog\/task-create-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fastbitlab.com\/blog\/"},{"@type":"ListItem","position":2,"name":"FreeRTOS Lecture 22 &#8211; Task Create API"}]},{"@type":"WebSite","@id":"https:\/\/fastbitlab.com\/blog\/#website","url":"https:\/\/fastbitlab.com\/blog\/","name":"FastBit EBA","description":"Your Online Academy of Embedded Systems","publisher":{"@id":"https:\/\/fastbitlab.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fastbitlab.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fastbitlab.com\/blog\/#organization","name":"FastBit EBA","url":"https:\/\/fastbitlab.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","contentUrl":"https:\/\/fastbitlab.com\/blog\/wp-content\/uploads\/2026\/04\/logo-EzNrEnyr.png","width":640,"height":640,"caption":"FastBit EBA"},"image":{"@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/fastbiteba\/","https:\/\/x.com\/fastbiteba","https:\/\/www.linkedin.com\/in\/fastbit-embedded-brain-academy-b3167b124\/","https:\/\/www.youtube.com\/channel\/UCa1REBV9hyrzGp2mjJCagBg"]},{"@type":"Person","@id":"https:\/\/fastbitlab.com\/blog\/#\/schema\/person\/e32b38e733a0d76ffa7e6bc998652e5d","name":"FastBitLab","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9230d0f9bdef28b63a01e7ca274ee7b2e8ed9abe932ee564af8809caaf52a0c8?s=96&d=mm&r=g","caption":"FastBitLab"},"description":"The FastBit Embedded Brain Academy uses the power of internet to bring the online courses related to the field of embedded system programming, Real time operating system, Embedded Linux systems, etc at your finger tip with very low cost. Backed with strong experience of industry, we have produced lots of courses with the customer enrolment over 3000+ across 100+ countries."}]}},"_links":{"self":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/5922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/comments?post=5922"}],"version-history":[{"count":4,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/5922\/revisions"}],"predecessor-version":[{"id":12706,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/posts\/5922\/revisions\/12706"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media\/5925"}],"wp:attachment":[{"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/media?parent=5922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/categories?post=5922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fastbitlab.com\/blog\/wp-json\/wp\/v2\/tags?post=5922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}