Cypress技术论坛
直播中

王幼萍

7年用户 201经验值
私信 关注
[问答]

Psoc6:编译器在使用FrReTOS函数时会出现一些错误

你好,我正在测试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);
vtaskStistApple();
*将初始化/启动代码放在此处(例如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.

回帖(2)

王幼萍

2018-10-15 15:54:52
引用: superwh0103 发表于 2018-10-15 16:08
你好,
目前在PSoC 6中,只有CORTEX-M4支持自由基。
1。一旦启用了FreeRTOS PDL,构建项目就将必要的RTOS文件添加到项目中。您可以从FrReToSCOFIG.h文件自定义FrReTOS内核。

嗨,Ajya,
你知道未来的CordX-M0+核心是否也会支持FreeRTOS?我们正在测试PSoC6的新设计,这对于我们了解器件的所有潜力是很重要的。

以上来自于百度翻译


     以下为原文
  Hi Ajya,
Do you know if in the future the cortex-M0+ core is going to support FreeRTOS too?, we are testing Psoc6 for a new design and is important for us to know all the potential of the device.
举报

欧建杭

2018-10-15 16:06:08
引用: hongliwei 发表于 2018-10-15 16:22
嗨,Ajya,
你知道未来的CordX-M0+核心是否也会支持FreeRTOS?我们正在测试PSoC6的新设计,这对于我们了解器件的所有潜力是很重要的。

你好!
可以在M0+内核上运行FRIERTOS。有几个地方你可以去网站上,并在FreeRTOS文档,了解你可能需要做这工作。例如,ARM Cortex-M,中断和FreeRTOS的:第一部分|单片机对日食。埃里希,因为他是公司的重点主要是NXP平台,但有丰富的关于如何工作的信息。记住,几乎所有你能在网上找到的是一个单一的核心系统。
的PSoC 6的主要区别是,它是一个双核心架构。为了优化系统的性能,最好的办法是为CM4构建应用程序,这是更强大的。在CM0+上运行CyPress或合作伙伴提供的固件。例如,如果你想建立一个安全的应用,可信执行环境是由CM0 +管理。如果你的设计使用了加密数据,加密引擎在CM0 +。如果你有一个使用的传感器系统,可以设计这样的M0 +管理传感器,但是CM4做所有的工作数据。
在这种情况下,想使用,或任何操作系统,作为你的主要应用的延伸,一个图书馆(如果你愿意),你的链接到您的代码提供您需要的服务,如任务调度,和所有的好东西。您的主应用程序应该运行在M4上。
我希望这有助于理解“设备的全部潜力”。可以在M0+上运行FRIERTOS。在M4上运行它更有意义。
吉姆

以上来自于百度翻译


     以下为原文
  Hi!
 
It is possible to run FreeRTOS on the M0+ core. There are several places you can go on the web, and in the FreeRTOS documentation, to learn what you may need to do for that to work. For example, ARM Cortex-M, Interrupts and FreeRTOS: Part 1 | MCU on Eclipse. Erich, since he works for NXP, focuses mostly on NXP platforms, but there is a wealth of information on how it all works. Keep in mind, almost everything you will find on the web is for a single core system.
 
The key difference with the PSoC 6 is, it is a dual core architecture. The best way to optimize the performance of a system is to build application firmware for the CM4, which is more powerful. Run Cypress or partner provided firmware on the CM0+. For example, if you want to build a secure application, the trusted execution environment is managed by the CM0+. If your design uses encrypted data, the encryption engine is on the CM0+. If you have a system that uses sensors, you can design it so that the M0+ manages the sensors, but the CM4 does all the work with the data.
 
In this context, think of FreeRTOS, or any RTOS, as an extension of your primary application, a library (if you will) that you link in to your code to provide services you need, like tasks, scheduling, and all that good stuff. Your primary application should run on the M4.
 
I hope this helps understand "the full potential" of the device. You CAN run FreeRTOS on the M0+. It makes more sense to run it on the M4.
 
Jim
举报

更多回帖

发帖
×
20
完善资料,
赚取积分