[转载]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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
### 回答1: MTK平台是一种广泛使用的芯片平台,主要用于智能手机、平板电脑等移动设备。学习MTK平台的开发需要掌握一定的技能和知识,从入门到精通需要经过几个阶段的学习和实践。 1. 入门阶段:了解MTK平台的基础知识,包括芯片架构、操作系统、编译工具和调试方法等。可以通过学习官方文档、论坛和教程来掌握基础知识,同时还需要掌握一种或多种编程语言。 2. 初级阶段:掌握MTK平台的开发环境,包括开发工具、SDK和API等。需要对开发工具进行配置和使用,熟悉SDK和API的使用,学习基本的应用开发模型及其实现方式。 3. 中级阶段:深入学习MTK平台的架构和技术,掌握更高级别的开发技能。需要学习MTK平台的内部机制、性能优化和安全性等方面。还需要了解常见的开发模式和框架,如MVC、MVVM等。 4. 高级阶段:精通MTK平台开发,能够独立完成复杂的应用和项目。需要在前三个阶段的基础上进一步加强自己的技能和知识,积累更多的实战经验,并不断更新和学习最新的技术和行业趋势。 总之,MTK平台开发入门到精通需要耐心和坚持,同时也需要不断学习和实践。只有在实践中不断探索,才能达到精通的境界,在MTK平台开发领域里扬帆起航。 ### 回答2: Mtk平台,又称为MTK芯片平台,是基于联发科技公司采用ARM架构设计的一款中低端移动设备芯片。对于想要学习Mtk平台的开发的人来说,可以从以下几个方面进行学习: 一、学习Mtk平台的基础知识 首先,要了解Mtk平台的基础知识。包括Mtk平台的体系结构,相关芯片的特性,基础开发工具和开发环境等等。了解这些基础知识可以为后续的开发打下基础。 二、掌握Mtk平台的开发工具和环境 Mtk平台开发的环境包括了编译器、调试器、集成开发环境等等。可以从CM或者其他机构找到相关开发资源和环境,以此来加强对平台的掌握。 三、学习Mtk平台的驱动开发 与其他平台一样,Mtk平台上的驱动开发需要使用C语言进行开发。建议通过阅读Mtk平台上的实例驱动代码,如U盘驱动、USB音频驱动等,通过这些例子来加深对Mtk平台的理解。 四、学习Mtk平台的应用开发 Mtk平台上的应用开发也是通过C语言进行编写。同样需要大量的代码读写和程序调试。为了熟练掌握这方面的开发,可以自己撰写一些简单的程序,如自己编写一个简单的计算机小应用来尝试挑战自己。 需要注意的是,Mtk平台的代码编写和调试往往比较困难,因此要多练习,多动手,不断总结。在此基础上,不断积累经验,才能逐渐成为一名出色的Mtk平台开发者。 ### 回答3: MTK平台是一个基于ARM架构的移动终端芯片平台,广泛应用于智能手机、平板电脑、智能手表等设备中。在MTK平台上进行开发,需要掌握相关的开发技能和工具,下面我来分享一下从入门到精通MTK平台开发的经验。 入门篇:学习基础知识和环境搭建 1. 了解ARM架构和MTK芯片特点 ARM是一种常见的处理器架构,MTK芯片使用的是ARM处理器。因此,要想进行MTK平台开发,首先需要了解ARM架构的基本知识,例如CPU的架构、指令集等。同时还需要掌握MTK芯片的特点,如处理器核心、内存、I/O接口等。 2. 学习相关编程语言和工具 MTK平台开发常用的编程语言包括C、C++、Java等。此外,还需要掌握相关的开发工具,如MTK SDK、Eclipse等。学习使用这些工具的基本方法可以从互联网上的相关教程入手,例如学习Eclipse的使用可以在网上找到大量的相关教程和视频。 3. 熟悉MTK平台开发流程 MTK平台开发的基本流程包括环境搭建、工程创建、代码编写、编译调试等。刚开始入门的时候可以先尝试简单的应用开发,熟悉MTK平台的开发流程和常用的API。 进阶篇:深入理解框架和工具链 1. 了解MTK平台的框架 MTK平台开发涉及到多个组件和模块,例如Linux内核、Android框架、MTK HAL等。要想进一步精通MTK平台开发,需要深入理解这些组件和模块之间的关系和交互方式。 2. 熟悉MTK平台的工具链 MTK平台开发需要使用到多种工具,例如编译器、调试器、Trace工具等。除了掌握工具的基本使用方法,还需要深入理解工具的原理和实现机制,以便更好地使用和定位问题。 3. 掌握调试技巧和工具使用 MTK平台开发中难免会遇到各种问题,需要灵活运用各种调试技巧和工具进行问题定位和解决。例如使用GDB进行调试、使用Trace工具进行性能优化等。 精通篇:进一步优化性能和功能 1. 优化代码性能和效率 在MTK平台开发中,优化代码性能和效率是一个非常重要的工作。可以从算法优化、内存管理和I/O优化等方面入手,不断提升代码的执行效率和响应速度。 2. 进一步了解MTK平台架构 MTK平台的开发需要进一步理解其系统架构和内部原理。例如深入了解MTK平台中的编解码器、图像处理器、音频播放器等组件的使用和原理,有助于优化应用的功能和性能。 3. 探索新的应用场景和技术 MTK平台在移动设备市场具有广泛的应用前景,未来也将涉及到更多的场景和技术。进一步探索新的应用场景和技术,例如智能家居、虚拟现实等,能够帮助开发者把握未来市场的趋势和发展方向。 总结 MTK平台开发入门到精通需要不断学习和实践,掌握基础知识和工具的使用,了解平台架构和内部原理,优化代码性能和功能等。通过不断的探索和学习,可以成为一名优秀的MTK平台开发工程师。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值