zoukankan      html  css  js  c++  java
  • NIOS II With uCOSII

    1、如果使用uCOS,那么Qsys中Nios II核就不能使用外部中断控制器(EIC)。
    2、遇到很迷惑的问题,运行uCOSII的实例代码,总是在第二个OSTimeDlyHMSM(0, 0, 3, 0);出错。
    单步调试后,发现代码在执行到NIOS2_WRITE_STATUS (status);汇编代码为ldw r2,-8(fp)时出错,暂停程序运行后,程序指向00000000:Call 0x0处。

    void task1(void* pdata)
    {
      while (1)
      { 
        printf("Hello from task1
    ");
        OSTimeDlyHMSM(0, 0, 3, 0);
      }
    }
    /* Prints "Hello World" and sleeps for three seconds */
    void task2(void* pdata)
    {
      while (1)
      { 
        printf("Hello from task2
    ");
        OSTimeDlyHMSM(0, 0, 3, 0);
      }
    }
    /* The main function creates two task and starts multi-tasking */
    int main(void)
    {
      
      OSTaskCreateExt(task1,
                      NULL,
                      (void *)&task1_stk[TASK_STACKSIZE-1],
                      TASK1_PRIORITY,
                      TASK1_PRIORITY,
                      task1_stk,
                      TASK_STACKSIZE,
                      NULL,
                      0);
                  
                   
      OSTaskCreateExt(task2,
                      NULL,
                      (void *)&task2_stk[TASK_STACKSIZE-1],
                      TASK2_PRIORITY,
                      TASK2_PRIORITY,
                      task2_stk,
                      TASK_STACKSIZE,
                      NULL,
                      0);
      OSStart();
      return 0;
    }
    

  • 相关阅读:
    【算法】动态规划
    【设计模式】单例模式
    Python 多元线性回归
    Python 线性回归
    惩罚项
    局部常数拟合方法 例
    微分方程是用来做什么的?
    线性回归与梯度下降法
    k近邻法
    逻辑回归与梯度下降法
  • 原文地址:https://www.cnblogs.com/liqi120150/p/6820859.html
Copyright © 2011-2022 走看看