Giter VIP home page Giter VIP logo

Comments (3)

ShawnHymel avatar ShawnHymel commented on July 30, 2024 1

Awesome! Thank you for this helpful info. I have not played with the Uno port of FreeRTOS, so I'm glad to hear it works. From what I've found, the setup() and loop() functions both run in a task in the ESP-ISF RTOS, which is why vTaskDelay() and vTaskDelete() work.

I'm not sure how the Uno port of FreeRTOS works, so I'm not surprised to hear that setup() is not inside a task. Perhaps loop() is in a task? Could you try running Serial.println(uxTaskPriorityGet(NULL)); in loop() to see if it prints out a priority? If that works, it means loop() is inside a task. If it fails, it means loop exists outside the scheduler (and you probably don't want to use loop() if that's the case).

from introduction-to-rtos.

itopaloglu83 avatar itopaloglu83 commented on July 30, 2024

That was a great tip Shawn, thank you.

Calling uxTaskPriorityGet(NULL) in loop function returned 0 and I also tried Serial.println(pcTaskGetName(NULL)); which also return the name IDLE. On a side note, FreeRTOS documentation states that there should always be at least one task ready to be run and functions like vTaskDelay() should not be called from it.

Strangely calling uxTaskPriorityGet(NULL) in the setup function return a decimal 10 even though configMAX_PRIORITIES is defined as 4 in FreeRTOSConfig.h file.

As I was discovering around, I also found about vTaskList (reference) which returns an ASCII based task list table of all tasks. The returned table (example) shows all the tasks running, their states, priorities, and stack high water mark.

from introduction-to-rtos.

itopaloglu83 avatar itopaloglu83 commented on July 30, 2024

Just a follow-up for future reference.

Calling uxTaskGetNumberOfTasks() in the setup function returns 0. Which means there are no tasks present while the setup function is running.

Reminder. This is only true for the Arduino Uno port of FreeRTOS.

from introduction-to-rtos.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.