You are here

PSoC FreeRTOS Task Notify | Cypress Semiconductor

PSoC FreeRTOS Task Notify

[re-printed from https://iotexpert.com]

I have been writing a bunch of articles about implementing PSoC FreeRTOS so, this morning I was reading the FreeRTOS manual (yes I am one of those…) and I noticed a section in the API guide that I hadn’t see before… Task Notifications.  Every task in the FreeRTOS has a built in 32-bit integer notification value.  This value is super light weight and can be used like a task specific counting semaphore, or a signaling bit mask, or binary semaphore.  The API includes:

It seems like this API is good for the situations when your Semaphore has a specific task target in mind.  I thought that this would be a perfect scheme to have a PSoC FreeRTOS UART ISR signal the UART Handling task that there is data available to do something with.

Setup the PSoC FreeRTOS Project

I start this process by making a copy of “1-BlinkingLED” (which already has all of the FreeRTOS stuff in it) and naming it “9-TaskNotify”.  Then I add a UART to the schematic and name it “UART”

CY3295 Kit Image

I attach the UART to the right pins on the CY8CKIT-044 kit.

CY3295 Kit Image

 

Next I turn on the interrupt which will be called when there is data in the receive FIFO.

CY3295 Kit Image

 

PSoC FreeRTOS UART Code

Now that the schematic is all configured I update my firmware.  The function “uartHandler” is called when there is data in the UART RX FIFO.  It turns of the interrupts for the UART (which I will turn back on after I have cleared the data in the input buffer), clears the interrupt  (so that it will stop pending) and then sends the notification to the UART_Task.

The UART Task just registers the handler… then while(1)’s until the end of time.  It waits for a notification, then reads data out of the RX fifo and puts out,  then re-enables the interrupts.

CY_ISR(uartHandler)
{
    BaseType_t xHigherPriorityTaskWoken;
 
    // disable the interrupt
    UART_SetRxInterruptMode(0);
    vTaskNotifyGiveFromISR(uartTaskHandle,&xHigherPriorityTaskWoken);
    portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
 
void UART_Task( void *arg)
{
    (void)arg;
    char c;
    UART_Start();
    UART_SetCustomInterruptHandler(uartHandler);
    while(1)
    {
        ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
        while(UART_SpiUartGetRxBufferSize())
        {
            c = UART_UartGetChar();
            UART_UartPutChar(c);
        }
        // clear & re-enable the interrupt
        UART_ClearRxInterruptSource(UART_INTR_RX_NOT_EMPTY);
        UART_SetRxInterruptMode(UART_INTR_RX_NOT_EMPTY);
    }
}

 

Blog: 

Comments

marlinhwright665_2756346's picture

Your Article about the implementation of PSoC FreeRTOS is really helpful in API with the solution queries of task notifications and it really works because it is a unique and Essays Writing Services perfect guideline especially about semaphore and binary semaphore.

jam.martinn1987_2774596's picture

Your Article about the implementation of PSoC FreeRTOS is clearly helpful in API with the solution queries of assignment notifications and it truly works. I got it to my colossal statistics from right here. Appreciative to you this sort of beautiful mixture for sharing this publish.

Source by Cheap Coursework Writers

saracanaday225_2842211's picture

An software programming interface (API) is a set of programming commands and standards for having access to a Web primarily based software application or Web device. A software program enterprise releases its API to the public so that different software program developers can layout products which might be powered with the aid of its provider. Do My Essay

abdul.azim5712_2851661's picture

This article is clear my all confusion about the PSoC FreeRTOS. Usually, I do not understand this hardware and software functions and working but after reading this post I get unique knowledge and learn many things. Thanks for sharing the nice information and If sometimes you need assistance about writing so you can take help with us. We are working for the UAE students and providing the online assignment writing service and best academic assistance.

Victoria Julia's picture

Your Article about the execution of PSoC FreeRTOS is truly useful in API with the arrangement questions of undertaking notices and it truly works since it is a unique.I got it to my giant measurements from appropriate here. Grateful to you this kind of delightful blend for sharing this distribute. 

A product programming interface (API) is an arrangement of programming summons and guidelines for approaching a Web principally based programming application or Web gadget. A product program undertaking discharges its API to the general population so extraordinary programming program engineers would layout be able to items which may be fueled with the guide of its supplier

Web Source: Write my Essay Cheap

onlineessayhelp_2874341's picture

Hello! Thanks for the write-up. It was very useful for me to read this. The screenshots which are given here are useful to read it and implement it as a solution.  Hoping to read more posts from you! Urgently get coursework written from life saver essays. 

monica.09anderson_2921931's picture

Well this source is something very important the module have made things quite literally bit easy for me now, I think I can work things out properly out as the source which was provided by Custom Paper Writing Company have helped me a lot.

kakbrus_2889656's picture

Nice blog, the article you have shared is good.This article is very useful. My friend suggest me to use this blog. thank so much! five nights at freddy's

naomiholloway12_2995926's picture

Great and useful information! Thanks a lot. But to be honest, I'm not so good at programming and dealing with software or any other kinds of problems. But you posted a pretty detailed guide so I hope I'll do everything successfully. I'm working for coursework writing service so you can understand that I'm pretty great at writing and absolutely incompetent in programming. Anyway, your piece of advice is helpful.

jiyakj123_2889706's picture

What are the steps to be followed in order to implement the PSoC FreeRTOS? It is the first time I am hearing about this term. What is it used for? Is it something related to the hardware of the computer? cable providers

anu.varghese660_2921096's picture

I used to read your articles regarding the implementation of PSoC FreeRTOS and found that it is very interesting as well as informative. Since it is explained with the help of some pictorial representations, the concept is very clear. Thank you. at&t cell phone packages

rolandswan160_3069931's picture

Thanks for giving this  information in a nice manner  especially  image are very helpful to understand the topic $1 web Hosting   this solve my many problems related to my project.

Cathy anna's picture

Here in this article it specifies about the implementation of PSoC free RTOS. I think from the manual specified here you have got all the necessary information regarding it. Thank you for sharing the details with all the screen shots. paris private tours
 

ennaelson98_3111891's picture

Pay to Do Research Paper is where scholastic essayists offer on your task, and it's you who chooses which author suits your necessities and desire best. You pick an author, get in touch with him straightforwardly and talk about all points of interest and due dates of your work. It encourages you comprehend whether this individual is sufficiently proficient to compose your exposition; such a plan gives a client a chance to maintain a strategic distance from all stresses over completing their work on time.

emmagranger3050_3116631's picture

Article advertising articles are utilized on Pay Someone to Do my Essay sites and online journals, so take after the tenets for composing great web articles. Put the most critical data at the best, keep sentences and sections short and make great utilization of subheadings. Furthermore, in the event that you guarantee five hints, ensue that is the thing that you convey.

johnchristeena3_3073046's picture

I'm a follower of your site and all your articles are really informative.The execution of PSoC FreeRTOS is truly useful in API.it is good for the situations when your Semaphore has a specific task target.thanks for sharing this article.network printer troubleshooting

bieap_3281496's picture

Here we are giving you the details about the AP Inter Results 2018 {1st & 2nd Year}, and recently the students completed their intermediate board examination
bieap.cgg.gov.in

 

animh_3304386's picture

For those who are not familiar with the term anime series here is a small explanation for you. Anime is a special Japanese animation art form from all genres found in movies.

Anime Haven

본 사이트의 모든 컨텐츠와 자료는 "있는 그대로" 제공됩니다. CYPRESS SEMICONDUCTOR와 해당 공급자는 그 목적에 관계 없이 이러한 자료의 적합성에 대한 표현을 하지 않으며 상업성, 특정 목적에의 적합성, 권리 및 제3자 지적 재산권의 비침해에 대한 모든 묵시적 보증과 조건을 포함하여(이에 제한되지 않음) 이러한 자료와 관련한 모든 보증과 조건을 부인합니다. CYPRESS SEMICONDUCTOR에서는 명시적 또는 묵시적으로 금반언이나 여타의 다른 방법으로 라이센스를 부여하지 않습니다. 이 사이트의 정보를 사용하려면 제3자의 라이센스 또는 CYPRESS SEMICONDUCTOR에서 제공하는 라이센스가 필요할 수 있습니다.

이 사이트의 컨텐츠에는 특정 사용 지침이나 제한이 포함되거나 그러한 제한이 적용될 수 있습니다. 모든 게시물과 이 사이트 컨텐츠 사용에는 사이트 약관이 적용됩니다. 이 컨텐츠를 사용하는 제3자는 제한 또는 지침을 따르고 이 사이트의 약관을 준수할 것이라는 데 동의합니다. Cypress Semiconductor와 그 공급자는 컨텐츠와 자료, 그 제품, 프로그램 및 서비스를 언제든 수정, 삭제, 개조, 개선, 향상 및 기타 변경하거나 예고 없이 컨텐츠, 제품, 프로그램 또는 서비스를 이동 또는 중단할 수 있는 권리를 보유합니다.