你好,我正在测试PSOC6中的FrReTOS(在PSoC 6 BLE先锋套件中)。我已经从零创建了一个新的项目,我在Buffic设置选项中添加了FrRetos内存管理选项。在那一刻,我可以看到其中的FrrestToFig .h文件。
我遇到的第一个问题是,当我试图添加一个使闪烁到MauniMCM4.C文件的任务时,直到在文件的开头添加了这行时,它才起作用:
其中包括“自由人H”
包括“任务h”
如果我没有添加这些行,编译器在使用FrReTOS函数时会出现一些错误。在Web上的示例中,添加这些行是没有必要的。
在线路上,LED闪烁的速度恰到好处。
这是CM4内核中的代码:
包括“项目H”
其中包括“自由人H”
包括“任务h”
空缺任务(空缺)
{
(;)
{
Cyl GPIOX编写(DeLyRoJojPoT,LedioRojojnNUM,1);
VTASK延迟(50);
Cyl GPIOX编写(DeLyRoJojPoT,LedioRojojnNUM,0);
VTASK延迟(50);
}
}
主(空)
{
*使EnabeLyIrq();/*启用全局中断。*/
XTaskCube(LeDyTask,Lead任务,400,NULL,1,0);
vtaskS
tistApple();
*将初始化/启动代码放在此处(例如MyStimSistAd())*/
(;)
{
*将您的应用程序代码放在这里。*/
}
}
当这个工作时,我想测试另一个核心中的FrRetos,所以我把这个代码添加到MIN
包括“项目H”
其中包括“自由人H”
包括“任务h”
空缺的任务(空缺)
{
(1)
{
CygGoooLi写作(Lead NalangjaPalt,Lead NalajnnUm,1);
VTASK延迟(100);
CygGoooLi写作(Lead NalangjaPalt,Lead NalajnnUm,0);
VTASK延迟(100);
}
}
主(空)
{
*使EnabeLyIrq();/*启用全局中断。*/
XTaskCube(Ledi-NalaJaWork),“Ledi-NalaJaWork”,400,NULL,1,0;
vtaskStistApple();
CythySyababelM4(CythCordxM4AppAdRADDR);
(;)
{
}
}
然后,我在MiNEYCM0P.C文件中得到这些错误:
生成错误:未定义的“VTaskLead”引用
生成错误:未定义的引用“vtaskStistPraceRever”
生成错误:未定义的“xtaskCube”引用
在MIN IXCM4文件中没有错误。
可能是什么问题?有可能在两个核心上使用FrRetos吗?
提前通知你。
以上来自于百度翻译
以下为原文
Hello I´m testing the FreeRTOS in a Psoc6 (In a Psoc 6 BLE Pioneer Kit). I have created from zero a new proyect and I have added in the build settings option the FreeRTOS-Memory Management option to my proyect. In that moment I can see the FreeRTOSConfig.h file in it.
The first problem that I had was when I tried to add a task for making blink a led to the main_cm4.c file, it didn´t work until I added this lines at the start of the file:
#include "FreeRTOS.h"#include "task.h"
If I didn´t add these lines the compiler got some errors when I was using the freeRTOS functions. In the example on the web It was no neccesary to add those lines.
With the lines the LED blinks at the right rate.All woks as expected.
This is the code in cm4 core:
#include "project.h"#include "FreeRTOS.h"#include "task.h"void LED_TASK(void){ for(;;) { Cy_GPIO_Write(LED_ROJO_PORT,LED_ROJO_NUM,1); vTaskDelay(50); Cy_GPIO_Write(LED_ROJO_PORT,LED_ROJO_NUM,0); vTaskDelay(50); }}int main(void){ __enable_irq(); /* Enable global interrupts. */ xTaskCreate(LED_TASK,"LED_TASK",400,NULL,1,0); vTaskStartScheduler(); /* Place your initialization/startup code here (e.g. MyInst_Start()) */ for(;;) { /* Place your application code here. */ }}
When this was working I wanted to test the freeRTOS in the other core so I added to the main_cm0p.c file this code:
#include "project.h"#include "FreeRTOS.h"#include "task.h"void LED_NARANJA_TASK(void){ while(1) { Cy_GPIO_Write(LED_NARANJA_PORT,LED_NARANJA_NUM,1); vTaskDelay(100); Cy_GPIO_Write(LED_NARANJA_PORT,LED_NARANJA_NUM,0); vTaskDelay(100); }}int main(void){ __enable_irq(); /* Enable global interrupts. */ xTaskCreate(LED_NARANJA_TASK,"LED_NARANJA_TASK",400,NULL,1,0); vTaskStartScheduler(); Cy_SysEnableCM4(CY_CORTEX_M4_APPL_ADDR);
for(;;) { }}
Then I get these errors in main_cm0p.c file:
Build error: undefined reference to `vTaskDelay'
Build error: undefined reference to `vTaskStartScheduler'
Build error: undefined reference to `xTaskCreate'
In the main_cm4 file there are no errors.
What could be the problem? Is it possible to use the freeRTOS on both cores?
Thak you in advance.