This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

关于AM335x上移植uCOS的问题

Other Parts Discussed in Thread: SYSBIOS

您好,

    请问一下你们有关于AM335x平台上移植uCOS方面的参考吗,或者有什么经验吗?

  • TI官方不支持UCOS

    可以到其他网站搜搜

  • 不知道您要在AM335x平台上移植uCOS是出于什么考虑呢?简单操作还是实时性要求呢?

  • 是对于实时性的处理,我看过ti官方的sysbios系统,但是关于这方面的demo比较少,我也试着去使用了一下,不知道为何仿真就出错,这是我的代码:

    Int main()
    {
        Task_Handle task;
        Error_Block eb;
        Task_Params taskParams;

        /* Enabling functional clocks for GPIO1 instance. */
        GPIO1ModuleClkConfig();

       /* Selecting GPIO1[23] pin for use. */
       GPIO1Pin23PinMuxSetup();
       UARTSetup();
       /* Enabling the GPIO module. */
       GPIOModuleEnable(GPIO_INSTANCE_ADDRESS);

       /* Resetting the GPIO module. */
       GPIOModuleReset(GPIO_INSTANCE_ADDRESS);

       /* Setting the GPIO pin as an output pin. */
       GPIODirModeSet(GPIO_INSTANCE_ADDRESS,
       GPIO_INSTANCE_PIN_NUMBER,
       GPIO_DIR_OUTPUT);
        UARTPuts("Enter StarterWare Application...\r\n\n", -1);


       System_printf("enter main()\n");

     Task_Params_init(&taskParams);
     taskParams.stackSize = 20480;
     taskParams.priority = 1;

     Error_init(&eb);
     task = Task_create(taskFxn, &taskParams, &eb);
     taskParams.priority = 2;
     task = Task_create(taskFx1, &taskParams, &eb);
     taskParams.priority = 3;
      task = Task_create(taskFx2, &taskParams, &eb);
     if (task == NULL) {
      System_printf("Task_create() failed!\n");
      BIOS_exit(0);
     }

     BIOS_start();    /* does not return */
     return(0);

    }

    仿真后的结果:

    [CortxA8]  0x44e000ac  R8  = 0x4030d028
    R1 = 0x00000000  R9  = 0x4030d008
    R2 = 0x00000064  R10 = 0x4030d484
    R3 = 0xfffffffd  R11 = 0x00029940
    R4 = 0x00000000  R12 = 0xffffffff
    R5 = 0x00000200  SP(R13) = 0x800095e0
    R6 = 0x48060000  LR(R14) = 0x800111dc
    R7 = 0x00000020  PC(R15) = 0x800095e0
    PSR = 0x48060000
    DFSR = 0x00000005  IFSR = 0x00000000
    DFAR = 0x44e000ac  IFAR = 0x00000000
    ti.sysbios.family.arm.exc.Exception: line 205: E_dataAbort: pc = 0x800095e0, lr = 0x800111dc.
    xdc.runtime.Error.raise: terminating execution

     

    然后就跳入

    static void loader_exit(void)
    {
    #if defined(EMBED_CIO_BP)
       __asm("         .global C$$EXITE");
    #if defined(__32bis__)
       __asm("C$$EXITE:.word 0xDEFED0FE");
    #else
       __asm("  .align  4");
    #if defined(__big_endian__)
       __asm("C$$EXITE:.half 0xDEFE");
    #else
       __asm("C$$EXITE:.half 0xD0FE");
    #endif /* __big_endian__ */
    #endif /* __32bis__      */

    #else  /* !EMBED_CIO_BP */
       __asm("        .global C$$EXIT");
       __asm("C$$EXIT: nop");
    #endif
    }

    请教一下这是什么原因呢?

  • 我知道了,是因为没有加内存映射MMU初始化!