硬件:C6678,自己做的板子,nand flash型号与开发板一致(nand512)
仿真器:seed-560
编译环境:cc5.4.0,只连接core0
测试例程:在论坛下的UART例程。在no boot模式下测试过,运行后会向上位机发送一串字符
主要步骤参考mcsdk下的nand write工具的txt说明
1、将out文件直接改后缀名,得到bin文件。大小与out文件一样,约450KB
2、将板卡设置为no boot模式,打开ccs,将mcsdk下的nand write_6678l.out下载进去
3、打开view memory,在地址0x0c000000,load memory,将bin文件load进去(32bit格式,不勾选swap)
4、按F8运行,开始时会陷入死循环。后来发现是nandwrite.c中对sgmii进行了初始化,并会等待底层phy的建立。自己板子上没有以太网,所以将p_device->phy置0,。修改后,按txt文档说明,重新生成nand write_6678l.out文件,下载运行,提示烧写成功。
5、将子boot模式设置为EMIF模式,断开仿真器,重新上电。此时串口没有打印。
6、将仿真器连上后,无法单步汇编运行,提示0x20b……没有源文件,具体地址晚上补充。我看了一下,这是boot rom的地址。提示地址对应的汇编指令是idle
我看论坛上好多网友提到用idl,以二次加载用。直接加载是不是也可以?板子上也没有做eeprom。不知道哪里出错了,晚上会进一步完善帖子
我看boot rom的大小是128KB,如果bin文件太大,比如我这次就是450KB,这样会不会有问题?
也不太理解txt文档里的srart_addr,我改了一下,没什么变化
Stephen chen:
还是用直接回复的方式吧,编辑帖子的话还要等审核……
硬件平台:自己做的板子,nand flash型号与开发板相同(nand512)
编译环境:CCS5.4.0,只连接core0
仿真器:seed-xds560
测试例程:使用的论坛上提供的UART例程,已经在no boot模式下测试过。运行后会向上位机发送一个字符串
测试步骤:
主要参考mcsdk_2_01_02_06\tools\writer\nand\docs下的README.txt。
1、 确保no boot/EMIF16模式
2、 将.out文件重命名为app.bin文件(与nandwriter_input.txt中的内容保持一致即可),文件大小约450KB。放到writer\nand\evmc6678l\bin目录下
3、 \nand\evmc66xxl\bin\nandwriter_input.txt的内容未做改动
4、 打开ccs,打开一个工程,将debug选项设置为只load symbol,或者直接新建一个空工程。工程使用\ti\ccsv5\ccs_base\emulation\boards\evmc6678l\gel目录下的gel文件。load时的gel详细打印如下所示:
C66xx_0: GEL Output: Setup_Memory_Map…
C66xx_0: GEL Output: Setup_Memory_Map… Done.
C66xx_0: GEL Output:
Connecting Target…
C66xx_0: GEL Output: DSP core #0
C66xx_0: GEL Output: C6678L GEL file Ver is 2.005
C66xx_0: GEL Output: Global Default Setup…
C66xx_0: GEL Output: Setup Cache…
C66xx_0: GEL Output: L1P = 32K
C66xx_0: GEL Output: L1D = 32K
C66xx_0: GEL Output: L2 = ALL SRAM
C66xx_0: GEL Output: Setup Cache… Done.
C66xx_0: GEL Output: Main PLL (PLL1) Setup …
C66xx_0: GEL Output: PLL in Bypass …
C66xx_0: GEL Output: PLL1 Setup for DSP @ 1000.0 MHz.
C66xx_0: GEL Output: SYSCLK2 = 333.3333 MHz, SYSCLK5 = 200.0 MHz.
C66xx_0: GEL Output: SYSCLK8 = 15.625 MHz.
C66xx_0: GEL Output: PLL1 Setup… Done.
C66xx_0: GEL Output: Power on all PSC modules and DSP domains…
C66xx_0: GEL Output: Security Accelerator disabled!
C66xx_0: GEL Output: Power on all PSC modules and DSP domains… Done.
C66xx_0: GEL Output: PA PLL (PLL3) Setup …
C66xx_0: GEL Output: PA PLL Setup… Done.
C66xx_0: GEL Output: DDR3 PLL (PLL2) Setup …
C66xx_0: GEL Output: DDR3 PLL Setup… Done.
C66xx_0: GEL Output: DDR begin (1333 auto)
C66xx_0: GEL Output: XMC Setup … Done
C66xx_0: GEL Output:
DDR3 initialization is complete.
C66xx_0: GEL Output: DDR done
C66xx_0: GEL Output: DDR3 memory test… Started
C66xx_0: GEL Output: DDR3 memory test… Passed
C66xx_0: GEL Output: PLL and DDR Initialization completed(0) …
C66xx_0: GEL Output: configSGMIISerdes Setup… Begin
C66xx_0: GEL Output:
SGMII SERDES has been configured.
C66xx_0: GEL Output: Enabling EDC …
C66xx_0: GEL Output: L1P error detection logic is enabled.
C66xx_0: GEL Output: L2 error detection/correction logic is enabled.
C66xx_0: GEL Output: MSMC error detection/correction logic is enabled.
C66xx_0: GEL Output: Enabling EDC …Done
C66xx_0: GEL Output: Configuring CPSW …
C66xx_0: GEL Output: Configuring CPSW …Done
C66xx_0: GEL Output: Global Default Setup… Done.
5、 将writer\nand\evmc66xxl\bin\nandwriter_evm6678l.outload进去.
6、 打开view->Memory Browser,输入地址0x0c000000,Go(存疑)
7、 在memory窗口中,选择"load memory",将第1步中的app.bin文件load进去,起始地址与上一步相同,格式选择32bit,并且不勾选swap选项(这是因为nandwriter.c中没有使能swap功能)。
8、 Load完毕后,提示Can't find a source file at "R:/writer/nand/src/nandwriter.c",手动locate file,指定c文件,以便单步调试。按F8运行。开始时程序陷入死循环,发现停在SGMII的初始化,里面有等待链路建立的过程,而该板卡上没有以太网,所以会一直等下去。解决办法:修改nandwriter.c文件,
在memset(&init_flags, 1, sizeof(platform_init_flags));后,增加一句init_flags.phy = 0。修改后运行,提示"NAND programming completed successfully"。详细打印如下所示:
[C66xx_0] NAND Writer Utility Version 01.00.00.01
Flashing block 0 (0 bytes of 459840)
Flashing block 1 (16384 bytes of 459840)
Flashing block 2 (32768 bytes of 459840)
Flashing block 3 (49152 bytes of 459840)
Flashing block 4 (65536 bytes of 459840)
Flashing block 5 (81920 bytes of 459840)
Flashing block 6 (98304 bytes of 459840)
Flashing block 7 (114688 bytes of 459840)
Flashing block 8 (131072 bytes of 459840)
Flashing block 9 (147456 bytes of 459840)
Flashing block 10 (163840 bytes of 459840)
Flashing block 11 (180224 bytes of 459840)
Flashing block 12 (196608 bytes of 459840)
Flashing block 13 (212992 bytes of 459840)
Flashing block 14 (229376 bytes of 459840)
Flashing block 15 (245760 bytes of 459840)
Flashing block 16 (262144 bytes of 459840)
Flashing block 17 (278528 bytes of 459840)
Flashing block 18 (294912 bytes of 459840)
Flashing block 19 (311296 bytes of 459840)
Flashing block 20 (327680 bytes of 459840)
Flashing block 21 (344064 bytes of 459840)
Flashing block 22 (360448 bytes of 459840)
Flashing block 23 (376832 bytes of 459840)
Flashing block 24 (393216 bytes of 459840)
Flashing block 25 (409600 bytes of 459840)
Flashing block 26 (425984 bytes of 459840)
Flashing block 27 (442368 bytes of 459840)
Flashing block 28 (458752 bytes of 459840)
Reading and verifying block 0 (0 bytes of 459840)
Reading and verifying block 1 (16384 bytes of 459840)
Reading and verifying block 2 (32768 bytes of 459840)
Reading and verifying block 3 (49152 bytes of 459840)
Reading and verifying block 4 (65536 bytes of 459840)
Reading and verifying block 5 (81920 bytes of 459840)
Reading and verifying block 6 (98304 bytes of 459840)
Reading and verifying block 7 (114688 bytes of 459840)
Reading and verifying block 8 (131072 bytes of 459840)
Reading and verifying block 9 (147456 bytes of 459840)
Reading and verifying block 10 (163840 bytes of 459840)
Reading and verifying block 11 (180224 bytes of 459840)
Reading and verifying block 12 (196608 bytes of 459840)
Reading and verifying block 13 (212992 bytes of 459840)
Reading and verifying block 14 (229376 bytes of 459840)
Reading and verifying block 15 (245760 bytes of 459840)
Reading and verifying block 16 (262144 bytes of 459840)
Reading and verifying block 17 (278528 bytes of 459840)
Reading and verifying block 18 (294912 bytes of 459840)
Reading and verifying block 19 (311296 bytes of 459840)
Reading and verifying block 20 (327680 bytes of 459840)
Reading and verifying block 21 (344064 bytes of 459840)
Reading and verifying block 22 (360448 bytes of 459840)
Reading and verifying block 23 (376832 bytes of 459840)
Reading and verifying block 24 (393216 bytes of 459840)
Reading and verifying block 25 (409600 bytes of 459840)
Reading and verifying block 26 (425984 bytes of 459840)
Reading and verifying block 27 (442368 bytes of 459840)
Reading and verifying block 28 (458752 bytes of 459840)
NAND programming completed successfully
运行完毕其他窗口界面如下图所示。
断电,将boot模式设置为EMIF,断开仿真器,重新上电。上位机串口无打印。
9、 修改UART例程的cmd文件,由
VECTORS: o = 0x00800000 l = 0x00000200
LL2_RW_DATA: o = 0x00800200 l = 0x0003FE00
修改为
VECTORS: o = 0x00820000 l = 0x00000200
LL2_RW_DATA: o = 0x00820200 l = 0x0003FE00
修改完毕后,重新生成.out文件,再次进行上述步骤,仍然无打印。
10、将起始地址由0x0c000000修改为0x80000000,仍然无打印。
11、将仿真器连上,提示No source available for "0x20b01154",该地址对应的汇编指令为“IDLE”。这个地址属于boot rom,应该是没有烧写或者加载进去。
12、DDR3使用的时钟为62.5MHz,与开发板不同.所以将gel文件修改了一下,将ddr时钟调整为812.5MHz。不过测试还是不行。
问题一:IBL的作用是什么?不使用IBL,EMIF直接加载是否可以?
问题二:如何将EMIF的数据导入到内存中,从而在Memory Browser中查看
问题三:EMIF默认应该都是从nand flash的地址0开始写的。那nandwriter_input.txt中的start_addr代表什么意思?测试过程中修改了一下,并未看到有任何效果。
问题四:发现在EMIF的子boot模式下,jtag也能连上。这种现象是正确的吗?如果是的,是不是说明了EMIF里没有程序?
问题五:boot rom只有128KB,加载较大的文件(比如此此用的文件为450KB)。会不会有问题?
问题六:用改后缀名的方法生成.bin文件,文件就比较大。如果使用hex6x.exe生成,文件就会小很多。这个例程的.out文件对应的.bin就只有40KB。将两个bin文件做了下比较,发现用hex6x生成的文件内容包含于另一个bin文件。使用这种小的bin文件是否可以?
Stephen chen:
回复 Stephen chen:
看来板子上没有I2C EEPROM,是无法从NAND引导了。
http://www.deyisupport.com/question_answer/dsp_arm/c6000_multicore/f/53/t/60486.aspx
主要问题算是解决了。不过第二个问题还不会。
gaoyang9992006:
回复 Stephen chen:
EMIF连接nand flash的原理图可以提供一下吗?谢谢
Allen35065:
回复 gaoyang9992006:
http://www2.advantech.com/Support/TI-EVM/6678le_of.aspx