日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[转载]MTK入门教程

發布時間:2023/12/20 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [转载]MTK入门教程 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

【轉載于http://crackerlee.blog.sohu.com/84749764.html】
文檔內容:
-》MTK軟件架構
-》如何編譯
-》開發目錄結構解析
-》開發工具的了解
-》程序入口,程序導讀
-》MMI的制作

1. MTK軟件構架
參考文檔:MT6218_SW_ReleaseNote.pdf
MTK為MediaTek公司提供的GSM軟件方案。它包含5個部分:
-》L1協議
-》設備驅動
-》協議棧
-》MMI
-》WAP應用
MediaTek為用戶提供3個工具:
-》Catcher
-》META
-》MCT
MTK軟件架構圖:


?

下面3個部分組成該軟件方案:
??? 1. MS Executable Software, which is the software running on the MS, includes the following modules
?- OS: Nucleus OS.
?- L1 Protocol Stack: GSM physical layer.
?- Drivers: device driver, like SIM, UART, GPIO, etc.
?- L2/L3 protocol stack: GSM protocol stack layer.
?- MMI: man-machine interface.
?- WAP: Wireless application protocol.
?- JAVA: J2ME Software
??? 2. The Mobile Engineering Testing Architecture, also known as META
??? 3. Catcher
-》OS
??? MediaTek采用Nucleus OS實時操作系統。KAL OS層為MediaTek’s軟件和Nucleus操作系統的接口。它為任務提供許多系統服務函數,比如計時器,隊列,內存管理,事件等等。
-》L1 Protocol Stack
??? The physical layer or Layer 1 supports the transfer of bit streams on the radio medium according to the Technical Specifications of the 05-series. It provides service to upper layers and control the mapping and scheduling between the logical and physical channels. The TDMA framing and radio control parts are also implemented.


?Layer 1 Asynchronous: handles the message request from upper layers and forward the result generated by layer 1 to upper layer.
??? Surrounding Cell Engine: handles the neighbor cell power measurement and neighbor cell synchronization information acquisition.
??? Layer 1 Control: handles the TDMA scheduling on the radio environment, including timing advance and power control command from serving base station.
??? Layer 1 Driver: handles the DSP and Radio control

-》Drivers
??? MCU外圍設備的驅動,如下:
? ?SIM: Subscriber Identity Module
? ?UART: Universal Asynchronous Receiver/Transmitter
? ?SPI: Serial Port Interface
? ?LCD: Liquid Crystal Display
? ?GPIO: General Purpose Input/Output
? ?GPT: General Purpose Timer
? ?RTC: Real Time Clock
? ?WDT: Watch Dog Timer
? ?PWM: Pulse Width Modulation
? ?Alerter
? ?Keypad
? ?PMIC: Power Management IC
? ?BMT: Battery Charging Management task
? ?AUX task: Auxiliary task
? ?ADC Sched.: Analog to Digital Converter Scheduler
? ?USB task: The USB 1.1 protocol and driver
??? IrDA task: The IrDA and driver
??? Camera: Camera driver for integrating with 3rd party camera module
??? MSDC: Memory card driver, supporting SD, MMC cards and Memory Stick
??? JPEG Decoder: Software for controlling hardware JPEG decoder

?

-》L2/L3/L4 Protocol Stack
??? 這部分包含大量的GSM/GPRS需求以及提供一個優秀的GSM/GPRS平臺給應用程序。本地MMI和遠程PC通過AT命令可以方便的使用該軟件平臺。詳細的結構如下:
? ?RMI: 遠程MMI,比如PC端,可以使用AT命令通過串口與協議棧進行通訊。
? ?FMI: Feature rich MMI, described in the above section. This is the production co-worked with Pixtel.
? ?L4: Layer 4. L4 is a task through which FMI and/or RMI communicate with PS. L4 task includes several sub-modules.
? ?ATCI: AT command interpreter. Interprets the AT commands from PC side and commands the L4C to do the relative actions.
? ?L4A: L4 adaptation layer for FMI. The SAP between FMI and L4A is primitive base.
? ?L4C: L4 control entity. Handles all applications request and response.
? ?UEM: User equipments adaptation. Adaptation for drivers, like Keypad, LED, GPIO, Audio…etc.
? ?PHB: Phone book management. Handles the phone books related processing, like: sorting…etc.
? ?SMU: SIM management unit. Handle the security management, and STK.
? ?CSM: Circuit switching protocol stack management.
? ?RAC: Registration access control.
? ?SMSAL: Short message service application layer.
? ?TCM: Terminal context management.
? ?NVRAM: Non-volatile RAM. This is adaptation layer to flash memory.
? ?SIM: Subscriber identity module. Handle SIM behavior as ETSI 11.11 description.
? ?DATA: Circuit switched data service. Data task includes several sub-modules.
? ?FAX: Group 3 Facsimile.
? ?TDT: Transparent circuit switching data.
? ?L2R: Layer 2 relay protocol for non-transparent circuit switching data.
? ?RLP: Radio link protocol for non-transparent circuit switching data.
? ?CC: Circuit-switched call control.
? ?SS: Supplementary service.
? ?SMS: Short message service.
? ?SM: Session management.
? ?MM/GMM: Mobility management/GPRS mobility management.
? ?SNDCP: Subnetwork dependent convergence protocol.
? ?LLC: Logical link control.
? ?RR: Radio resource management. RR task includes several sub-modules.
? ?RRM: Handles cell selection and PLMN selection.
? ?RMPC: Handles the procedures in Idle/Dedicated state including the surrounding cell scheme and measurement reporting.
? ?LAPDM: Handles the procedure defined in GSM layer 2.
? ?RLC: Radio link control protocol.
? ?MAC: Medium access control protocol.
? ?MPAL: Adaptation layer for RR and L1A.

? ?PPP: Point to Point protocol layer. This is client PPP layer.


-》MMI
??? 這部分包括用戶的接口架構,應用以及和協議棧的通訊。

?Framework: This covers that
? ?OSL: OS adaptation layer
? ?Task: communication with L4 task.
? ?File system: communication with storage device.
? ?GUI: This covers that
? ?Theme
? ?UI component
? ?Category screen
? ?Font
? ?Editor
? ?T9 or Ezi input method.
? ?Access LCD driver.
? ?Customization tool.
? ?Application
? ?Phonebook
? ?Messages (SMS, EMS 4.0, CB)
? ?Call history
? ?Setting. (Phone setting, network setting, security setup)
? ?5 kinds of user profiles
? ?Fun and games
? ?Organizers
? ?Services
? ?Shortcuts
? ?In call management.
? ?Interrupt events, like charging , alarm.


-》WAP
??? 如何編譯
??? 參考文檔:wcr-MTK_MakeBuild_Design_Customer_040930.pdf

-》編譯環境
??? 操作系統:Windows 2000, WinXP. 推薦Windows 2000 with SP2 or later.
??? 編譯器:ADS (Arm Developer Suite) v1.2.
??? Perl解析:ActivePerl.推薦使用ActivePerl 5.6.1版本

-》make.bat
??? It will parse command line to determine project name, platform, and action. Meanwhile, checking /make directory exist or not and checking command line argument is legal or not. After checking, to execute build script GSM2.mak build script to perform action.
使用:
Usage: Make [custom=customername] <project> <platform> <action> [module]"
custom = Monza
project = GPRS (GSM only)
action = new (clean, scan, compile, link) (default)
= update (scan, compile, link)
= remake (compile, link)
= clean (clean)
module = component module name (nucleus, l1, ...)

Example:
To make/build new GPRS project, clean all old objects, libraries, and log files etc., the new action also creates necessary directories and removes all temporary files, and flushes log files automatically.
d:>/pvcs/maui/mcu/Make custom=Monza GPRS new
To update project dependency, and compile changed modules, link. Notice that, update and remake action won’t remove temporary files, and flush log file. Build results will be append after last log file.
d:>/pvcs/maui/mcu/Make custom=Monza GPRS update
To recompile changed files, and link
d:>/pvcs/maui/mcu/Make custom=Monza GPRS remake
To clean all objects, temporary files, libraries, and executable binaries. Meanwhile log file will also be flushed.
d:>/pvcs/maui/mcu/Make custom=Monza GPRS clean
To clean dedicated init modules’ objects libraries. Meanwhile log file will also be flushed.
d:>/pvcs/maui/mcu/Make custom=Monza GPRS clean init

-》how to customize your build environment
?!!!To add some modules into or remove some modules from the building procedure.
To complete this kind of configuration, it is necessary to understand the following variables in the make file
Monza_GPRS.mak
?? COMPLIST: list all source code modules can be built to .lib. In initial custom release, COMPLIST
should be the sum of CUS_REL_SRC_COMP and CUS_REL_PAR_SRC_COMP. The following is the initial setting in custom release.
ifeq ($(strip $(CUSTOM_RELEASE)),TRUE)
COMPLIST = $(strip $(CUS_REL_SRC_COMP))
COMPLIST += $(strip $(CUS_REL_PAR_SRC_COMP))
endif
?? CUS_REL_MTK_COMP: list all modules provided with .lib only. These .lib are put in /mcu/mtk_libs.
?? If you want to add a source module
??? 1、add the module "xyz" (in lower case) into COMPLIST.
ifeq ($(strip $(CUSTOM_RELEASE)),TRUE)
COMPLIST = $(strip $(CUS_REL_SRC_COMP))
COMPLIST += $(strip $(CUS_REL_PAR_SRC_COMP))
COMPLIST += xyz
endif
??? 2、add a folder “mcu/make/xyz” for xyz.lis, xyz.inc, xyz.pth, xyz.def.

-》編譯生成的文件以及log
??? 1.編譯的log在目錄C:/code_100/build/a100中的MT6218B.log。目錄C:/code_100/build/a100/log下的log文件為各個模塊編譯時生成的log。
??? 2.編譯生成的bin為C:/code_100/build/a100下的a100_PCB01_gprs_MT6218B_FN.W05_12.bin。
??? 3.編譯生成的目標文件在C:/code_100/build/a100/gprs/MT6218Bo目錄中。

??? 3、開發目錄結構解析
參考文檔:wcr-MTK_MakeBuild_Design_Customer_040930.pdf
目錄結構:


4.開發工具的了解
參考目錄《工具》中的文件。
?? 工具:
-》Catcher
Catcher is a PC-side tool for MTK GSM/GPRS Products. The main purpose of Catcher is for logging primitives and debug information. Engineers can use Catcher to analyze the behavior of mobile phones.

-》META
META (Mobile Engineering Testing Architecture) is designed to provide the functionality of RF testing, NVRAM access testing, speech related testing of advanced feature – melody and voice memo.

-》MCT
UI制作工具,包括菜單制作,圖片制作,字體制作等等。


5.程序入口,程序導讀

-》MMI任務入口:
C:/code_100/plutommi/mmi/Framework/Tasks/TasksSrc
中文件MMITask.c函數MMI_task。

-》MMI任務的建立:
C:/code_100/plutommi/mmi/Framework/Osl/OslSrc
中文件pixtelMMI.c函數WinMain調用InitApplication函數,在該函數中建立MMI任務,建立任務的接口函數為:osl_create_task。

-》MMI任務信息:
?{"MMI TASK"(任務名稱), "MMI Q"(隊列名稱), 127(優先級), 4096(堆棧大小),MAX_PRT_NODES(隊列結點個數), MMI_task(任務入口)}。

-》MMI模塊入口:
目錄C:/code_100/plutommi/mmi中為MMI各個模塊的代碼。比如鬧鐘模塊,源代碼在C:/code_100/plutommi/mmi/Alarm/AlarmSrc中,頭文件在C:/code_100/plutommi/mmi/Alarm/AlarmInc中。首先找到初始化鬧鐘的函數AlmInit,該函數定義在選擇鬧鐘菜單項時調用函數HighlightAlmMenu進入鬧鐘功能。


6.MMI的制作
參考文檔:

文件名
?文件內容描述
?
API For Writing Applications Using Pixtel MMI Platform.pdf
?各類窗口列表
?
Writing Applications Using Pixtel MMI Platform.pdf
?如何寫應用程序
?


MMI 2.0 Design DOC和MMI Design Doc目錄中對MMI中的各個模塊進行描述,因此在研究某一模塊時可以在這兩個文件夾中找到該模塊的介紹,通過這些文檔可以加速對該模塊編碼的理解。
MMI的模塊在路徑C:/code_100/plutommi中。
-》設計一個應用程序的流程如下: -
??? 1. Write an Initialization function to register the various event handlers.
??? 2. Write a populate function to register various string and image elements for the
application.
??? 3. Write highlight handlers for function registered.菜單項的功能,當用戶選擇菜單項后執行的函數。
??? 4. Write the Entry functions。入口函數
??? 5. Write the Exit function。出口函數
??? 6. Write the business logic to call between various entry functions.

?

本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/ttohippo/archive/2008/10/10/3044977.aspx

總結

以上是生活随笔為你收集整理的[转载]MTK入门教程的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。