一、新建工程
1.新建一個(gè)ARM Executable Image
2.創(chuàng)建uCOS_II文件夾,創(chuàng)建兩個(gè)子文件夾,分別為ARM、SOURCE
ARM存放和平臺(tái)相關(guān)的文件("OS_CPU.H" "Os_cpu_a.s" "Os_cpu_c.c" )
SOURCE下存入和平臺(tái)無關(guān)的文件("ucos_ii.h" "os_cfg.h" "os_core.c" "os_flag.c" "os_mbox.c" "os_mem.c" "os_mutex.c" "os_q.c" "os_sem.c" "os_task.c" "os_time.c" "os_tmr.c" )
3.創(chuàng)建一個(gè)S3C2440文件夾,創(chuàng)建兩個(gè)子文件夾,分別為INC、SRC
INC存放S3C2440相關(guān)頭文件("2440addr.h" "2440lib.h" "2440slib.h" "config.h" "Def1.h" "lcd.h" "mmu.h" "Option.h" "Target.h" "Timer.h" )
SRC存放S3C2440相關(guān)源文件("Timer.c" "2440init.s" "2440lib.c" "2440slib.s" "Font_Libs.c" "iphone.c" "lcd.c" "mmu.c" "nand.c" "Target.c" )
4.創(chuàng)建一個(gè)app文件夾(app_cfg.h、main.c、Printf.c、Printf.h)
二、工程設(shè)置Edit->DebugRel Settings下
1.Target->Target Settings,Post-linker:ARM fromELF
2.Target->Access Paths選中Always Search User Paths(ucos_ii部分文件采用#include <>包涵,不修改這里找不到文件)
3.Language Settings下ARM Assembler、ARM C Compliler、ARM C++ Complier處理器設(shè)置成ARM920T
4.Language Settings下ARM C Compliler下Errors下去掉Implicit pointer c,ARM C Compliler下Warnings下去掉Unused declaration(-O1 -g+ -cpu ARM920T -Wx -Ec)
5.ARM Linker下,Output下RO Base設(shè)置成0x30000000,Options下Image entry point設(shè)置成0x30000000,Layout下Place at beginning of image下的Object/Symbol設(shè)置成2440init.o,Section設(shè)置成Init,Listings下選勾Image map、List file設(shè)置list.txt,勾上Sizes、Totals、Unused、Veneers
6.ARM fromELF下Output file name下填寫輸出的二進(jìn)制
三、移植文件的修改
對(duì)OS_CPU.H的修改:
view plaincopy to clipboard
/*
*********************************************************************************************************
* ARM
*
* Method #1: NOT IMPLEMENTED
* Disable/Enable interrupts using simple instructions. After critical section, interrupts
* will be enabled even if they were disabled before entering the critical section.
*
* Method #2: NOT IMPLEMENTED
* Disable/Enable interrupts by preserving the state of interrupts. In other words, if
* interrupts were disabled before entering the critical section, they will be disabled when
* leaving the critical section.
* NOT IMPLEMENTED
*
* Method #3: Disable/Enable interrupts by preserving the state of interrupts. Generally speaking you
* would store the state of the interrupt disable flag in the local variable 'cpu_sr' and then
* disable interrupts. 'cpu_sr' is allocated in all of uC/OS-II's functions that need to
* disable interrupts. You would restore the interrupt disable state by copying back 'cpu_sr'
* into the CPU's status register. This is the prefered method to disable interrupts.
*********************************************************************************************************
*/
#define OS_CRITICAL_METHOD 3
#if OS_CRITICAL_METHOD == 3
#define OS_ENTER_CRITICAL() (cpu_sr = OSCPUSaveSR()) /* Disable interrupts */
#define OS_EXIT_CRITICAL() (OSCPURestoreSR(cpu_sr)) /* Restore interrupts */
#endif
/*
*********************************************************************************************************
* ARM Miscellaneous
*********************************************************************************************************
*/
#define OS_STK_GROWTH 1 /* Stack grows from HIGH to LOW memory on ARM */
#define OS_TASK_SW() OSCtxSw()
對(duì)Os_cpu_c.c的修改:
view plaincopy to clipboard
/*
*********************************************************************************************************
* uC/OS-II
* The Real-Time Kernel
*
* (c) Copyright 1992-2003, Micrium, Inc., Weston, FL
* All Rights Reserved
*
* ARM9 Port
*
* File : OS_CPU_C.C
*********************************************************************************************************
*/
//#define OS_CPU_GLOBALS
#include "ucos_ii.h"
/*
*********************************************************************************************************
* INITIALIZE A TASK'S STACK
*
* Description: This function is called by either OSTaskCreate() or OSTaskCreateExt() to initialize the
* stack frame of the task being created. This function is highly processor specific.
*
* Arguments : task is a pointer to the task code
*
* p_arg is a pointer to a user supplied data area that will be passed to the task
* when the task first executes.
*
* ptos is a pointer to the top of stack. It is assumed that 'ptos' points to
* a 'free' entry on the task stack. If OS_STK_GROWTH is set to 1 then
* 'ptos' will contain the HIGHEST valid address of the stack. Similarly, if
* OS_STK_GROWTH is set to 0, the 'ptos' will contains the LOWEST valid address
* of the stack.
*
* opt specifies options that can be used to alter the behavior of OSTaskStkInit().
* (see uCOS_II.H for OS_TASK_OPT_???).
*
* Returns : Always returns the location of the new top-of-stack' once the processor registers have
* been placed on the stack in the proper order.
*
* Note(s) : 1) Interrupts are enabled when your task starts executing.
* 2) All tasks run in SVC mode.
*********************************************************************************************************
*/
OS_STK *OSTaskStkInit (void (*task)(void *pd), void *p_arg, OS_STK *ptos, INT16U opt)
{
OS_STK *stk;
optopt = opt; /* 'opt' is not used, prevent warning */
stk = ptos; /* Load stack pointer */
上一篇:采用JLink+ADS1.2調(diào)試uboot的方法
下一篇:將TQ2440的ADS工程文件移植到KEIL5中
推薦閱讀最新更新時(shí)間:2025-06-28 05:26


設(shè)計(jì)資源 培訓(xùn) 開發(fā)板 精華推薦
- Microchip 升級(jí)數(shù)字信號(hào)控制器(DSC)產(chǎn)品線 推出PWM 分辨率和 ADC 速度業(yè)界領(lǐng)先的新器件
- 意法半導(dǎo)體STM32MP23x:突破成本限制的工業(yè)AI應(yīng)用核心
- 意法半導(dǎo)體推出用于匹配遠(yuǎn)距離無線微控制器STM32WL33的集成的匹配濾波芯片
- ESP32開發(fā)板連接TFT顯示屏ST7789跳坑記
- 如何讓ESP32支持analogWrite函數(shù)
- LGVL配合FreeType為可變字體設(shè)置字重-ESP32篇
- 使用樹莓派進(jìn)行 ESP32 Jtag 調(diào)試
- ESP32怎么在SPIFFS里面存儲(chǔ)html,css,js文件,以及網(wǎng)頁和arduino的通訊
- ESP32 freeRTOS使用測(cè)試
- LTC3809-1 的典型應(yīng)用 - 無檢測(cè)、低輸入電壓、具有輸出跟蹤功能的同步 DC/DC 控制器
- NCV8189CMTW180TAGEVB:NCV8189 WDFNW6 2x2 1V8 評(píng)估板
- LTC3615HFE-1 雙路 3A 同步降壓型 DC/DC 轉(zhuǎn)換器在主機(jī)和從機(jī)中的典型應(yīng)用,用于使用 2MHz 外部時(shí)鐘實(shí)現(xiàn)一致跟蹤輸出
- ADK-8470,HI-8470 16 傳感器陣列評(píng)估板 + ARINC 429 輸出、接地/開路或電源/開路傳感器
- AM1G-1209DH30Z ±9V 1 瓦 DC/DC 轉(zhuǎn)換器的典型應(yīng)用
- L7808A 固定輸出穩(wěn)壓器的典型應(yīng)用
- DC274A-A,用于 LT1576CS8、200kHz 降壓轉(zhuǎn)換器的演示板,具有關(guān)斷、5.5 至 25Vin、3.3V 或 5Vout,1.25A
- TCR5SB24U、200mA、2.4V輸出電壓CMOS低壓降穩(wěn)壓器的典型應(yīng)用
- STEVAL-ISA101V1,使用 L5973D 的演示板,具有 4 V/36 V 輸入電壓范圍的 2 A 直流降壓開關(guān)穩(wěn)壓器
- 使用 Semtech 的 ACS8527 的參考設(shè)計(jì)
- GaN氮化鎵正在進(jìn)入汽車領(lǐng)域
- ST 向大眾市場(chǎng)推出ST4SIM M2M用兼容GSMA的eSIM卡芯片
- Advanced Energy LGA110D 的直流/直流電源轉(zhuǎn)換效率優(yōu)于同級(jí)產(chǎn)品
- 新思科技:部署數(shù)據(jù)安全戰(zhàn)略,加強(qiáng)安全管理和隱私保護(hù)
- 高通孟樸:持續(xù)推動(dòng)5G技術(shù)演進(jìn) 全球化發(fā)展和產(chǎn)業(yè)協(xié)作是大
- 昆山國(guó)顯光電AMOLED技術(shù) 多款手機(jī)屏幕均搭載
- 在操作頻譜儀之前我們需要做哪些準(zhǔn)備工作呢?
- 貿(mào)澤電子與Amphenol推出介紹新型連接解決方案的Plugged In視頻系列
- 關(guān)于印發(fā)《上海市居民小區(qū)電動(dòng)汽車充電設(shè)施建設(shè)管理辦法》的通知
- 影響嵌入式處理技術(shù)未來發(fā)展的三個(gè)趨勢(shì)
- 正向 DCDC 巧改負(fù)壓?GM2406/GM24061反向操作指南!
- 『新品發(fā)布』共模半導(dǎo)體重磅發(fā)布40V、4A/6A低EMI車規(guī)級(jí)同步降壓穩(wěn)壓器 GM2406
- Bourns 推出專為光伏應(yīng)用設(shè)計(jì) POWrFuse? 大功率電力保險(xiǎn)絲系列,具備 1500 VDC 額定值
- 納芯微推出車規(guī)級(jí)自動(dòng)雙向型電平轉(zhuǎn)換器NCAS0104和NCAB0104
- 瑞薩電子推出全新GaN FET,增強(qiáng)高密度功率轉(zhuǎn)換能力, 適用于AI數(shù)據(jù)中心、工業(yè)及電源系統(tǒng)應(yīng)用
- 芯對(duì)話 | 芯佰微CBM8605/CBM8606/CBM8608運(yùn)算放大器 精密信號(hào)鏈的核心解決方案
- 物聯(lián)網(wǎng)技術(shù)促進(jìn)能量收集創(chuàng)新應(yīng)用落地
- Proximus Global旗下公司BICS與Epic Malta合作,為2G/3G網(wǎng)絡(luò)退役后保障旅行者漫游連接
- 大聯(lián)大世平集團(tuán)推出以NXP產(chǎn)品為核心的HVBMS BJB方案
- 適用于高速應(yīng)用的先進(jìn)全局快門圖像傳感器
- 國(guó)內(nèi)廠商如何趟出一條MCU國(guó)產(chǎn)化的新路?
- 任正非談Verizon 10億專利費(fèi):華為要價(jià)公平合理
- 5年297億美元,中企欲和三星扳手腕
- 錫產(chǎn)微芯成為中科君芯新買家
- 日本制裁韓國(guó),這些命脈影響力不小
- 無線充電市場(chǎng)將迎來價(jià)格戰(zhàn),MCU替代SoC或成長(zhǎng)尾效應(yīng)
- 薄膜電容如何適應(yīng)新能源汽車行業(yè)的升級(jí)需求
- TDK PiezoHapt,實(shí)現(xiàn)比偏心馬達(dá)更細(xì)膩的振動(dòng)
- 工業(yè)和汽車,羅姆推出了很多cool新品
- 美團(tuán)王興:無人送餐計(jì)劃在2019年投入運(yùn)營(yíng)