注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

吉大释然

0101 0100 0010 1011

 
 
 

日志

 
 

Lab6: uC/OS II (Under Linux)  

2013-06-01 11:10:17|  分类: 默认分类 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

    Goal

    Transplant the uC/OS II to raspeberry Pi, using the TA's version of the transplanted. Then, implement two process which will turn on/off the LED on board

    The uC/OS it self has been transplanted by out TA already, so my job is MAKE IT WORK

    Prepare

    • The transplanted uC/OS source
    • Set the cross compile env.

    Compile

    To compile the source code:
    1.change ARMGNU to your own cross compiler, for me ARMGNU ?= arm-bcm2708-linux-gnueabi
    2.change the INCLUDEPATH to the ./h so the header can be found

    Then it should be OK to compile. At first, there should be a lot of bugs telling you some errors while compiling.

    The bugs are:
    1. In .init/startup.s all comment mark // should be change to ;@ , the comment mark for ASM.


    2. In makefile , in the last line$(ARMGNU)-objcopy ucos_bcm2835.elf. -O binary kernel.img, there is an . after .elf which should be removed.
    3. In makefile, an additional option -mfloat-abi=softfp should be added to indicate using soft float point


    4. Linux is CASE sensitive, so all the file name in makefile that reporting unmatch durring compiling should be recheck and change the name either to uppercase or lowercase.

    User app source code

    
    #include "uart.h"
    #include "ucos/includes.h"
    
    #define GPSET0 0x2020001C 
    #define GPCLR0 0x20200028
    
    void userApp2(void * args)
    {
     while(1)
     {
     PUT32(GPSET0,1<<16);
     uart_string("in userApp2");
     OSTimeDly(1000);
     }
    }
    
    void userApp1(void * args)
    {
    
    while(1)
     {
     uart_string("in userApp1");
     OSTimeDly(500);
     PUT32(GPCLR0,1<<16); 
     }
    }

    The user app will let the ACT led blink every 5 seconds

    Load to board

    After successfully compiling, you should get following files

    The `kernel.img` and `ucos_bcm2835.bin' should be copied to your Raspeberry Pi's SD card. Then it works~


      评论这张
     
    阅读(154)| 评论(0)
    推荐 转载

    历史上的今天

    评论

    <#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    页脚

    网易公司版权所有 ©1997-2018