Arm FreeRTOS lpc3250端口

Arm FreeRTOS lpc3250端口,arm,freertos,Arm,Freertos,我尝试在LPC3250上移植FreeRTOS,但我的端口工作不稳定。我尝试使用Thomas Kindler提供的端口,它是可用的,我发现我的端口也有相同的行为。我尝试执行以下操作: void task1(void *) { BOOL_8 blink1 = TRUE; TickType_t xLastWakeTime; const TickType_t xFrequency = 500; xLastWakeTime = xTaskGetTickCount(); while(tr

我尝试在LPC3250上移植FreeRTOS,但我的端口工作不稳定。我尝试使用Thomas Kindler提供的端口,它是可用的,我发现我的端口也有相同的行为。我尝试执行以下操作:

void task1(void *) {
  BOOL_8 blink1 = TRUE;
  TickType_t xLastWakeTime;
  const TickType_t xFrequency = 500;
  xLastWakeTime = xTaskGetTickCount();
  while(true) {
      if (blink1)
          cpld_set_bits(ECPLDLeds, CPLD_LED_1);
      else
          cpld_clear_bits(ECPLDLeds, CPLD_LED_1);
      blink1 = (~blink1) & 0x1;
      //      for (volatile int i=0; i < 8000000; ++i);
      //      vTaskDelay(500 / portTICK_PERIOD_MS);
      vTaskDelayUntil( &xLastWakeTime, xFrequency );
   }
}

void task2(void *) {
  BOOL_8 blink2 = FALSE;
  TickType_t xLastWakeTime;
  const TickType_t xFrequency = 500;
  xLastWakeTime = xTaskGetTickCount();
  while(true) {
    if (blink2)
        cpld_set_bits(ECPLDLeds, CPLD_LED_2);
    else
        cpld_clear_bits(ECPLDLeds, CPLD_LED_2);
    blink2 = (~blink2) & 0x1;
    //      for (volatile int i=0; i < 8000000; ++i);
    //      vTaskDelay(500 / portTICK_PERIOD_MS);
    vTaskDelayUntil( &xLastWakeTime, xFrequency );
  }
}

extern "C" int c_entry()
{
  bool blink5 = true;
  isens_board_init();

BaseType_t result = xTaskCreate(
    task1,
    "task1",
    configMINIMAL_STACK_SIZE,
    NULL,
    tskIDLE_PRIORITY + 1,
    &task1Handle
);
(void)result;

BaseType_t result2 = xTaskCreate(
    task2,
    "task2",
    configMINIMAL_STACK_SIZE,
    NULL,
    tskIDLE_PRIORITY + 1,
    &task2Handle
);
(void)result2;

vTaskStartScheduler();

while(true) {
    if (blink5)
        cpld_set_bits(ECPLDLeds, CPLD_LED_0);
    else
        cpld_clear_bits(ECPLDLeds, CPLD_LED_0);
    blink5 = !blink5;
    for (volatile int i=0; i < 16000000; ++i);
}
return 0;
}
void task1(void*){
BOOL_8 blink1=真;
TickType_t xLastWakeTime;
常数类型X频率=500;
xLastWakeTime=xTaskGetTickCount();
while(true){
如果(闪烁1)
cpld_设置_位(ECPLDLDS、cpld_LED_1);
其他的
cpld_清除_位(ECPLDLDS、cpld_LED_1);
blink1=(~blink1)&0x1;
//对于(volatile int i=0;i<8000000;++i);
//vTaskDelay(500/门周期);
vTaskDelayUntil(&xLastWakeTime,xFrequency);
}
}
作废任务2(作废*){
BOOL_8 blink2=错误;
TickType_t xLastWakeTime;
常数类型X频率=500;
xLastWakeTime=xTaskGetTickCount();
while(true){
如果(2)
cpld_设置_位(ECPLDLDS、cpld_LED_2);
其他的
cpld_清除_位(ECPLDLDS、cpld_LED_2);
blink2=(~blink2)&0x1;
//对于(volatile int i=0;i<8000000;++i);
//vTaskDelay(500/门周期);
vTaskDelayUntil(&xLastWakeTime,xFrequency);
}
}
外部“C”内部C_条目()
{
bool blink5=真;
isens_board_init();
BaseType\u t result=xTaskCreate(
任务1,
“任务1”,
配置最小\u堆栈\u大小,
无效的
茨基德勒大学优先权+1,
&task1Handle
);
(无效)结果;
BaseType\u t result2=xTaskCreate(
任务2,
“任务2”,
配置最小\u堆栈\u大小,
无效的
茨基德勒大学优先权+1,
&task2Handle
);
(无效)结果2;
vTaskStartScheduler();
while(true){
如果(闪烁5)
cpld_设置_位(ECPLDLDS、cpld_LED_0);
其他的
cpld_清除_位(ECPLDLDS、cpld_LED_0);
blink5=!blink5;
对于(volatile int i=0;i<16000000;++i);
}
返回0;
}
如果我运行的任务延迟了for()周期,它将正常工作。如果我运行由vTaskDelay或vTaskDelayUntil函数延迟的任务,则效果很差。我看到以下行为:两次切换良好,但task1的led停止。几秒钟(5-10)后,灯再次亮起,然后在随机周期后再次熄灭。Task2的led稳定闪烁500毫秒

也许这是不正确创业的影响?或者mmu使用不当(我使用mmu是因为使用现金)?我必须使用支持mmu的FreeRTOS吗

多谢各位