Comments (6)
https://github.com/kendryte/kendryte-freertos-sdk
from maixduino.
kendryte removed FreeRTOS from master branch, and you can use freertos branch: https://github.com/kendryte/kendryte-standalone-sdk/tree/freertos
from maixduino.
kendryte removed FreeRTOS from master branch, and you can use freertos branch: https://github.com/kendryte/kendryte-standalone-sdk/tree/freertos
I clone branch this to /cores/arduino/kendryte-standalone-sdk
and i upload this code to Sipeed Maix One Dock but not work. new task not do.
#include <FreeRTOS.h>
#include <task.h>
void vTaskCode( void * pvParameters ) {
for ( ;; ) {
Serial.println("Run in task !");
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
TaskHandle_t xHandle = NULL;
void setup() {
Serial.begin(115200);
Serial.println("Task create");
xTaskCreate(
vTaskCode, /* Function that implements the task. */
"vTaskCode", /* Text name for the task. */
1024, /* Stack size in words, not bytes. */
NULL, /* Parameter passed into the task. */
4, /* Priority at which the task is created. */
&xHandle ); /* Used to pass out the created task's handle. */
}
void loop() {
Serial.println("Main loop");
vTaskDelay(500 / portTICK_PERIOD_MS);
}
What i do wrong ?
from maixduino.
Only one task was created, and scheduler not run yet in your code.
You should add some code to loop function:
vTaskStartScheduler();
while(1){}
the maixduino not run FreeRTOS scheduler by default, so you should run scheduler in your loop
You will understand all once you saw the source code as follow:
Maixduino/cores/arduino/main.cpp
Lines 24 to 28 in b10b99a
from maixduino.
Only one task was created, and scheduler not run yet in your code.
You should add some code to loop function:
vTaskStartScheduler(); while(1){}
the maixduino not run FreeRTOS scheduler by default, so you should run scheduler in your loop
You will understand all once you saw the source code as follow:
Maixduino/cores/arduino/main.cpp
Lines 24 to 28 in b10b99a
It work ! Thank so much. freertos branch i don't see example to use FreeRTOS so i have not a way to understand use FreeRTOS (I'm not professional about FreeRTOS. i'm user)
And this full code of work.
#include <FreeRTOS.h>
#include <task.h>
void vTaskCode( void * pvParameters ) {
for ( ;; ) {
Serial.println("Run in task !");
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
void vTaskCode2( void * pvParameters ) {
for ( ;; ) {
Serial.println("Run in task 2 !");
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
TaskHandle_t xHandle = NULL, xHandle2 = NULL;
void setup() {
Serial.begin(115200);
Serial.println("Task create");
xTaskCreate(
vTaskCode, /* Function that implements the task. */
"vTaskCode", /* Text name for the task. */
1024, /* Stack size in words, not bytes. */
NULL, /* Parameter passed into the task. */
4, /* Priority at which the task is created. */
&xHandle ); /* Used to pass out the created task's handle. */
xTaskCreate(
vTaskCode2, /* Function that implements the task. */
"vTaskCode2", /* Text name for the task. */
1024, /* Stack size in words, not bytes. */
NULL, /* Parameter passed into the task. */
4, /* Priority at which the task is created. */
&xHandle2 ); /* Used to pass out the created task's handle. */
}
void loop() {
vTaskStartScheduler();
while(1){}
}
from maixduino.
I test code on Maixduino v0.3.10 the FreeRTOS work without clone freertos branch replace to /cores/arduino/kendryte-standalone-sdk
so you can use FreeRTOS right now.
from maixduino.
Related Issues (20)
- _thread & speech_recognizer
- Need assistance adding support for the stickV
- Need help running OpenCV and Dlib
- Maixduino no longer connecting to Maixpy IDE HOT 2
- RE: Trying the Given Selfie Source/Maixduino Selfie Source! HOT 1
- Maix Amigo basic display red and blue swapped HOT 1
- Cannot install board definitions - wrong link and wrong SHA256 HOT 3
- no serial connection HOT 7
- [TCP/İP Socket] live stream using maixduino as client HOT 3
- Maixduino Operating system HOT 3
- [UART] Maixduino Reading Serial port HOT 2
- How to display rtsp stream in maiduino board
- Is there any way to send images from a computer to maixduino board using micropython
- board missing
- How to use C/C++ PlatformIO/Arduino Framework (Not MaixPy) to use wifi HOT 3
- Are There Plans for Maix M1s Support? HOT 1
- Is This Project Dead? HOT 1
- using "SD.h" library for SD card on maixduino HOT 1
- arg "channel_mask" in "i2s_init" function HOT 1
- use external I2S mems mic for Maix_Speech_Recognition HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maixduino.