
展讯平台软件调试介绍.ppt
58页Date1Proprietary and Confidential InformationSpreadtrum *展讯平台软件调试介绍Date2Proprietary and Confidential Information培训目的Ø能够使用展讯提供的调试工具对 开发中的问题进行调试Ø能够分析几种常见ASSERTDate3Proprietary and Confidential Information主要内容F 展讯调试工具简介F 调试方法Date4Proprietary and Confidential Information展讯调试工具简介ØDownloaderØNVEditorØChannel ServerØLogelØPhone TesterØDSP Log主要的调试工具有:Date5Proprietary and Confidential InformationDownloader (1)功能:下载程序Date6Proprietary and Confidential InformationDownloader (2)设置界面:双击可以选择 下载文件路径选择端口选择项目选择下载速率制作打包文件选择 是否 下载Date7Proprietary and Confidential InformationNand Flash下载配置 :Downloader (3)大小页选择分区策略选择分区策略 Ø 始终分区 Ø 出现不兼容分区 时停止下载 Ø 出现不兼容分区,使 用Flash中原有分区进 行下载 Ø 出现不兼容分区,使 用FDL中的分区方式进 行分区注:此配置项只对NAND FLASH有效Date8Proprietary and Confidential InformationDownloader (4)备份信息配置:将NV保存到本地选择需要保留的信息Date9Proprietary and Confidential InformationDownloader (5)正在下载:下载成功:下载失败:Date10Proprietary and Confidential InformationDownloader (4)打包文件特别说明:展讯升级工具中使用打包文件来 进行升级操作,打包文件中不仅 包含了所有的下载文件,还包含 了下载项目的地址信息,这样可 以降低产线升级工具配置出错的 可能性,同时简化了操作。
打包文件的制作方法:DloadeR 在配置好所有的配置项后,点击 左图中的按钮,然后按照提示即 可完成打包文件的制作点击这个按钮 进行打包操作Date11Proprietary and Confidential InformationØDownloaderØNVEditorØChannel ServerØLogelØPhone TesterØDSP Log展讯调试工具简介Date12Proprietary and Confidential InformationNVEditor (1)功能 : •对fixed NV参数进行读取,编辑,保存,下载•擦除NV•从中读出NV ItemDate13Proprietary and Confidential InformationNVEditor (2)Date14Proprietary and Confidential Information修改某项数据:NVEditor (3)Date15Proprietary and Confidential Information选择菜单[File\save image]保存并生成二进制数据文件:NVEditor (4)Date16Proprietary and Confidential Information选择菜单[File\Save to phone]直接下载到中 —— 需要在下载模式如果需要保留校准参 数需要选择上NVEditor (5)Date17Proprietary and Confidential Information获取NV数据:NVEditor (6)选择菜单[File\LoadFromPhone(boot mode)]来获取数据在下载模式下从保 留区域处获取下载的nvitem数据。
某些nvitem可能会被修改并被存储到数据区,如果需要获取这些最新的数据, 则用LoadFromPhone(normal mode)此时应在正常开机状态,并且没有 进入deep sleepDate18Proprietary and Confidential Information读Flash:该地址为下载模式下flash的地址空间 ,地址一定要是有效地址NVEditor (7)选择菜单[Facility\Read Flash](NAND Flash选择 Read NAND Flash)需要在下载模式Date19Proprietary and Confidential Information擦除某区域的Flash :NVEditor (8)选择菜单[Facility\Erase Flash ](Nand Flash选择 Erase Nand Flash)需要在下载模式Date20Proprietary and Confidential InformationØDownloaderØNVEditorØChannel ServerØLogelØPhone TesterØDSP Log展讯调试工具简介Date21Proprietary and Confidential Information功能 :Channel Server (1)Ø 管理其它工具与通讯。
它通过Socket与其它工具通讯, 通过串口与连接Ø 消息存储转发Ø 消息字节顺序转换Ø 消息记录Date22Proprietary and Confidential Information运行ChannelServer.exe:变绿代表成功 连接串口或虚拟串 口端口号波特率设置由于展讯平台 使用大端,这 里要勾上Channel Server (2)单击右下角托盘中的ChannelServer小图标,在弹出的对话框中的进行配置(成功后, 小图标变绿色)Date23Proprietary and Confidential InformationØDownloaderØNVEditorØChannel ServerØLogelØPhone TesterØDSP Log展讯调试工具简介Date24Proprietary and Confidential InformationLogel (1)功能 : Ø 实时诊断和监控运行状况,解决、分析问题Ø Trace 功能,Layer 3的空中消息,应用窗口的消息流Ø 出错时的信息的收集、记录Ø 回放功能 Date25Proprietary and Confidential Information消息包 的解析线程间的 消息利用 SCI_TRACE_XXX打 印的字符串先将与Channel Sever连接上,打开Logel,连接Channel ServerLogel (2)Date26Proprietary and Confidential InformationØDownloaderØNVEditorØChannel ServerØLogelØPhone TesterØDSP Log展讯调试工具简介Date27Proprietary and Confidential Information注意:使用PhoneTester时,如果进入DeepSleep,操作会失败;有的平台中,使用的是Mobile Tester,功能与使用方法都同Phone Tester类似。
Phone Tester (1)功能 : Ø 读写内存/寄存器值Ø RF校准Ø Audio设置Date28Proprietary and Confidential Information点击使之与channel server相连Phone Tester (2)Date29Proprietary and Confidential Information寄存器/内存地址需读取的大小如果寄存器的读取, mode应设为DWORDPhone Tester (3)Date30Proprietary and Confidential InformationØDownloaderØNVEditorØChannel ServerØLogelØPhone TesterØDSP Log展讯调试工具简介Date31Proprietary and Confidential Information功能:抓取DSP LogDSP Log(1)Date32Proprietary and Confidential Information使用之前,需要在NV中将DSP Log打开:DownloadParam/log_switch_struct设置为0x1DSP Log(2)Date33Proprietary and Confidential Information选择菜单[Action\Setting],设置串口参数,以及LOG文件保存路径DSP Log(3)Date34Proprietary and Confidential Information• 单击工具栏图标 连接• 单击图标 开始抓取LOG• 详细使用方法,请参考相应工具的使用手册DSP Log(4)Date35Proprietary and Confidential Information主要内容F展讯调试工具简介F调试方法Date36Proprietary and Confidential Information调试方法Ø LOGØ 分析断言(ASSERT)信息Ø 通过PhoneTester实时查看寄存器、内存信息Date37Proprietary and Confidential InformationLOG (1)利用平台提供的LOG接口,可以将字符串通 过Logel工具在PC上打印出来,使得开发人员 可以跟踪程序的运行,接口是SCI_TRACE_LOWDate38Proprietary and Confidential InformationLOG (2)使用LOG的注意事项:Ø尽量避免在会频繁调用的函数或者循环中 调用SCI_TRACE_LOW,会影响程序的效 率Ø某些栈空间很小的线程中,调用 SCI_TRACE_LOW会导致堆栈溢出,要特 别注意,一般如果栈空间小于1K Bytes就 不能调用了Ø中断处理中不能调用SCI_TRACE_LOWDate39Proprietary and Confidential InformationLOG (3)需要特别说明的是log工具需要和软件版本配套。
Date40Proprietary and Confidential Information调试方法Ø LOGØ 分析断言(ASSERT)信息Ø 通过PhoneTester实时查看寄存器、内存信息Date41Proprietary and Confidential InformationASSERT (1)在开发的过程中,合理的利用ASSERT检查程序的合法性是非常必要 的例如,我们一般会在函数入口利用ASSERT检查参数合法性Date42Proprietary and Confidential InformationASSERT (2)这是发生assert时 弹出的assert提示 窗口Date43Proprietary and Confidential InformationASSERT (3)Ø Assert产生时连着Logel工具:• Assert时Logel会自动弹出Assert Frame,并显示提示信息, ChannelServer显示红色;• 选择[Logel\A。
