访问电脑版页面

导航:老古开发网手机版其他

USB Audio 调试心得

导读:
关键字:
在讨论这个话题之前,先建议大家去xmos 官方网站查看设计建议: 
进入My XMOS -- > "Design Advisories" 有很多有用的信息,可以搜索一下你关注的点 。 
手上有一块usb audio 的板子烧进程序之后接电脑没有一点反映。板子上是128pin的芯片。如果用xde 进入调试的话,有时候在电脑里面可以找到设备。烧完程序之后我也重启了,所以我首先怀疑是外面spi flash的问题,spi flash 可能有坏区或者没有清空。首先打开command line tool . 
$后面的是指令。
11.11.0 的command line tool 需要引导应用程序 。先执行如下命令: 
WilsonmatoMacBook-Pro:l1_audio wilsonzhang$ source /Applications/XMOS_11.11.0/SetEnv.sh

然后用如下命令清空spi flash : 
WilsonmatoMacBook-Pro:l1_audio wilsonzhang$ xflash --erase-all --target-file L1_AUDIO.xn
清空flash 之后再把spi flash 的内容读出来。
WilsonmatoMacBook-Pro:l1_audio wilsonzhang$ xflash --read-all --target-file L1_AUDIO.xn -o test.txt
存成txt 文档,打开发现全部为空。
再重新烧一下xe 档到spi flash 。
WilsonmatoMacBook-Pro:l1_audio wilsonzhang$ xflash usb_audio.xe
Warning: F03098 Factory image and boot loader cannot be write-protected on flash device on node "0".
Site 0 has finished.        
xflash succeeded

重新上电。发现还是没有执行。我怀疑是启动模式设置有问题。
因为线路图上也有启动模式的设置: 
MODE[1:0] = 00 ==> PLL_MULT = 30.75 ==> 13MHZ REFCLK 
MODE[3:2] = 11 ==> BOOT FROM SPI 
MODE[3:2] = 00 ==> BOOT FROM JTAG (DON''T BOOT) 
ALL MODE PINS HAVE INTERNAL PULLUPS 
用万用表详细测量了四个信号脚,都没有错。
还是不死心。用xgdb 查看一下吧 。
先运行xgdb usb_audio.xe 

WilsonmatoMacBook-Pro:l1_audio wilsonzhang$ xgdb usb_audio.xe
GNU gdb (XGDB) 11.11.0 (build 2237)
Copyright (C) 2007 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin9.8.0 --target=xcore-elf".
For bug reporting instructions, please see: http://www.xmos.com/support.
..


然后运行attach . 

(gdb) attach
0xffffc300 in ?? ()  //这个是返回值,说明attach 成功。

然后看看芯片运行的情况,究竟有哪几个线程在跑。指令是info threads . 
(gdb) info threads
* 1  stdcore[0] hwthread 0  0xffffc300 in ?? ()
(gdb) info threads
* 1  stdcore[0] hwthread 0  0xffffc300 in ?? ()

从上面的返回值看,芯片还是一直在等待启动。就是没有启动起来。那么有可能是芯片没有焊接好,或者需要换个新的芯片看看。 等我拿到新的芯片,换上去再给大家更新情况。 
如果还是有问题可以用这个命令看看芯片在什么状态: 

xrun --dumpstate <the executable>.xe

退出 指令是: 
(gdb) quit 
来源:liufengzhong   作者:  2014/8/20 16:17:45
栏目: [ ]

相关阅读

安森美推出新的高功率图腾柱PFC控制器,满足具挑战的能效标准

动态功耗低至60μA/MHz!助力设备超长续航,首选国民技术低功耗MCU!