其中nor_writer_input.txt文件的内容为
file_name = app.bin
start_addr = 0x80000000
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
SPI NOR boot
【6678/6670 SPI Nor flash 多核boot原理总结和demo 请参考12L 13L帖子的附件】
示例包括:
----------------------------------------------------------------------------------------------------------------------------------------------------
I2C-SPI IBL 二级 BOOT
1. 将IBL烧入EEPROM中(如果事先已经烧写过,可以不用做)
1、将i2crom_0x51_c6678_le.bin文件从"mcsdk_2_00_05_17\tools\boot_loader\ibl\src\make\bin"拷贝到"mcsdk_2_00_04_16\tools\writer\eeprom\evmc6678l\bin"
2、使用mcsdk_2_00_04_16\tools\writer\eeprom\evmc6678l\bin\eepromwriter_evm6678l.out进行烧写
其中eepromwriter_input.txt的内容为:
file_name = i2crom_0x51_c6678_le.bin
bus_addr = 0x51
start_addr = 0
swap_data = 0
2. 应用程序生成ELF 的 app.out,直接更名为app.bin.
使用mcsdk_2_00_05_17\tools\writer\nor\evmc6678l\bin\norwriter_evm6678l.out 对app.bin进行烧写
其中nor_writer_input.txt文件的内容为
file_name = app.bin
start_addr = 0x80000000
烧写步骤工程readme.txt有介绍
3. 配置IBL
1、运行程序mcsdk_2_00_05_17\tools\boot_loader\ibl\src\make\bin\i2cparam_0x51_c6678_le_0x500.out
2、加载文件 i2cConfig.gel然后在CCS的DEBUG界面上点击,Srcipts->EVM c6678 IBL -> setConfig_c6678_main
3、几秒钟以后,在console界面上敲击回车键.
1 2 3步骤时候的启动模式
(pin1, pin2, pin3, pin4)
SW3(off, on, on, on),
SW4(on, on, on, on),
SW5(on, on, on, off),
SW6(on, on, on, on)
步骤3完成之后断电重启的启动模式
(pin1, pin2, pin3, pin4)
SW3(off, off, on, off),
SW4(on, on, on, on),
SW5(on, on, on, off),
SW6(on, on, on, on)
此时实现核0的加载。
striker:你好!
一段时间没上来了,这帖子变这么长了,最近想整理一下这方面的东西,还有三个问题想请教的:
1.不知有不有工具:hex6x和mergebtbl的源码?网上没找到;
2.还是多核代码的搬运问题,有点不太明白咋从FLASH中搞到各核L2中的(core0较清楚)前面提到要看RBL的源码
,看了一下不太有思路,不知道你研究过没?希望略提一二;
3.在工程文件中有这样一段:
pBootMagicAddCore0 = (int*)0x1087FFFC;
(*pBootMagicAddCore0)+= 0x10000000;// translate to global address
for(i = 1;i < CORE_NUM_6678; i++)//write the other cores' boot magic address
{
*(pBootMagicAddCore0+ (0x01000000*i)/4 ) = (*pBootMagicAddCore0) + 0x01000000 * i;
}
而在map文件和dat文件中的"_c_int00" 和 BootMagicAd都为0x10800000、0x11800000等,代码中赋值却为
0x10000000、0x11000000,有点不太明白?
非常感谢!
striker striker,你好!
我有两个问题想请教你。
1.请问你压缩包里提供的将.out文件转化为.dat的批处理文件支持sys/BIOS工程吗?
2.为了实现四个LED灯同时亮和灭,我将你的多核LED灯程序里面core1,core2,core3时间延迟"coreId * 5”改成"coreId = 15",或者改成“coreId *1”均不能实现四个灯同时亮灭。请问四个核开始工作必须要延迟时间逐级递增吗?
谢谢你!
SUyang,
1.支持,请爬楼看相关讨论。
2.这只是示例工程,LED功能型问题核boot没有任何关系。
striker
hl,
hex6x 只是一种二进制格式的转换工具,mergebtbl 是将多核的boottable 连在一起。我认为这些工具的研究价值不时很大。源码我也没有寻找过。。RBL会根据地址(各数据代码段的起始地址和长度在.dat文件里非常清楚)将代码数据拷贝到每个核,然后启动核0并跳转到入口地址,.RBL到此结束。core0会执行你写的应用代码kick off 其他核。所以我觉得RBL所做的就是判断boot方式,搬移代码以及启动核0的工作。其他核的启动与其没有关系。
_c_int00 是入口地址,一般不定但是可以通过cmd文件固定。 boot magic address 是存放入口地址的地址,固定存在于L2SRAM最后一个字。
0x10000000 和 0x11000000 是相对于 0x008xxxxx local address的偏移量,加上0x008xxxxx 后就分别是核0核1的全局地址。同理核2的全局地址应该为0x12000000+0x008xxxxx
striker
striker striker,你好!
非常非常感谢你的解答!
我在你的非BIOS工程里加了修改GPIO管脚电平的代码,用示波器测试GPIO管脚的方式验证,GPIO管脚电平和预期一致,验证了你BOOT方法的正确性。
striker striker ,你好!
非常感谢你的解答。
我在你的工程里将.cmd文件里面的
.myboot
{
*.*<boot.obj>(.text)
} > BOOT_CORE0
注释掉之后boot也成功了,多核boot也用同样方法试了没问题。请问,这个myboot的作用是什么,可以不要吗?
另外想请教你,我现在想实现BIOS工程的boot,原先的boot方法貌似不是可以直接用,可以给我点建议和注意修改的地方吗?
非常感谢,期待你的答复!
OK,
麻烦你看看之前帖子别的朋友跟我的交流,也许可以解决您的疑问,如果还有问题我们再交流!
striker
请问如何修改呢?那个rar里面只有一个AddDdrTable6670的exe文件啊
Chill Wang,
本帖第一页12楼左右有附件,内涵小工具源码。谢谢!
striker
striker您好,我按照您的思路修改了add_ddr小工具的源代码,现在没有报错了,但是我自己的多核程序还是无法启动:我是把led的程序嵌在了我们的大程序里面,正常连接6670大程序运行时LED灯也会同时闪,但是按照12L的方法boot之后LED灯没有闪。是不是就说明没有boot成功呢?
我按照1L和12L的方法实验了小程序,是没有问题的。但是大程序无论单核还是多核都没有boot成功(led灯没有闪),请问是不是方案的问题呢?
striker striker 你好!
有几个关于BOOT时初始化的问题想请教你:
1.boot过程中硬件会自己完成类似于.gel的初始化工作吗(比如DDR3,L2)?
2.能不能把.gel文件也实现boot?如果能,操作步骤和一般的.out有什么区别?
Michael Fassbender 你好!
首先恭喜你成功BOOT!
我最近在搞6670的SPI bootloader的事儿,非BIOS工程用striker striker大神的方法也成功了,但是sys/bios工程一直不对,估计是.cmd和.cfg的问题,但是按照论坛里的方法试了各种方法就是不行,好崩溃。你可以把你成功boot的工程发到论坛里让大家参考学习吗,不胜感激!!
Hi Sunyang
1. 当然不会,gel文件是jtag 暂停 cpu运行时的调试手段,像瑞士军刀一样临时插入一段代码调测。boot 只会做一些基本的上电初始化,不包括gel文件所做的任何操作--详细见boot文档。主时钟pll,PA pll 以及其他任何外设初始化工作应该由用户代码负责。特殊的是DDR,当然也可以由用户负责初始化。但是大多时候我们的代码段或者数据段都会放在DDR上,这就要求DDR必须先于主程序初始化。所以才会在制作镜像的时候有个add DDR table的东西,让boot ROM的代码去解析它然后在搬移镜像到DSP前初始化DDR。
2.初始化代码TI mcsdk里有示例,可以参照示例工程,当然如果你愿意当然也可以把gel改造成.c文件,本身它就是c写的。但是gel文件非常底层,可读性很差,不建议这么做。
striker
Hi Chill,
由小程序到大程序的转变要注意很多细节,不然很容易出现boot不起来的问题,可以从以下几个角度来检查:
1. 是否真的没boot起来,灯没闪可能是主时钟初始化没做好,也有可能是别的原因。灯亮了一定是boot起来了,但是灯没亮不见得没boot起来。检查boot起来的方法是spi boot 后 用jtag连上板子(不要自动加载任何.out),看PC指针是否指向代码段合理区域。如果想看的更清楚可以再以load symbol的模式load一个带symbol的.out文件。具体操作如果不清楚可以搜索下论坛。
2.单核检查cmd文件或者cfg文件配置是否正确,是否使用全局地址,多核检查是否将boot段设置到了各自L2的同一块区域
3. DDR boot table 有没有问题,如果DDR没有初始化成功,肯定boot 不起来(在1 成功的基础上可以看看DDR的状态)
striker
Hi,striker striker
非常感激你不厌其烦的解答我的问题!
我的BIOS 工程的.OUT文件的大小大概为4000KB,工具链转换后的.dat文件大小只有15KB,压缩比也太大了。请问是工具链不支持BIOS工程还是工具链需要作修改,或者是我的BIOS工程有问题呢?
我的sys/BIOS工程一直未能BOOT成功,看论坛估计是.cmd和.cfg配置问题,参考了论坛里Michael和你的聊天记录尝试修改,仍然不行。请问你有什么指导意见,或者你上传一份可以BOOT成功的bios工程示例,让论坛网友和后来者参考学习,相信大家都会十分感激!
striker striker 你好!
由于我的工程必须在大端模式下运行,于是我在你上传的示LED灯程序进行了如下操作:导入build0工程——配置工程属性为大端,6670拨码开关为大端模式(sw3 : on on on on)——编译——debug——灯闪,工程调试正确——复制build0生成的.out到工具链multicore_boot_1cores(里面有个.rmd文件中-order L应该表示小端,但是不知道大端怎么修改,于是没修改)——重命名.out为simple0.out后双击批处理文件生成.dat——复制到mcsdk带的烧写工具norwriter_evm6670l,修改工程为大端属性,拨码开关为SW3-SW6:0000 0000 0000 1100——烧写成功——断电,拨码开关SW3-SW6:0011 0000 0010 1000——上电,灯不闪,通过查看内存确认boot失败
我猜测是工具链中.rmd文件需要修改,不知道对否?应该如何修改呢,谢谢!
Hi striker
我用了您上传的压缩包,小端的工程生成的.out可以boot成功。
我的工程工作在大端模式,生成了.out。如果要实现bootloader,需要修改工具链哪些地方呢,烧写工具norwriter工程属性是否也要改成大端呢?
自己尝试了好久,仍然搞不定,所以最后还是来论坛请教您,望您不吝赐教!
非常感谢,期待你的回复!
我现在也需要在大端模式下Boot,请问您现在成功了吗?能否分享一些经验呢?
我的大端BOOT还没有成功,都愁死我了。加我QQ:863930026,我们可以交流讨论。
要是哪儿位大神知道怎么做的(小端已经成功,只要知道大端和小端操作的区别就好了),麻烦不吝赐教!在这先谢谢了!
你好 striker
最近做BOOT时,加入了一些keystone的代码,比如keystone_common.c keystone_pcie_init_drv.c keystone_pcie_init_drv.h 等,加入这些代码之后,程序就boot不起来了,但是如果调用别的函数,自己编写的那种函数,就可以实现boot,这个跟keystone的库函数有关系吗?因为程序内容的不同,会导致boot出错?我查看了一下PC指针的值,程序gangboot之后,PC指针在boot rom空间20B00000----20B1FFFF?不是我真正需要跑代码的地方?
你说的原因和结果没有关系, 建议仔细检查:
PC指针指向的0x20B00000 是 bot ROM,说明boot 失败,镜像地址有问题,或者格式制作有问题。
加上keystone代码不会出现PC停留boot rom的问题,即使有问题也应该是程序跑飞。除非代码量增大导致工具链出错(几率很小),建议仔细检查,逐个增加keystone代码
striker
Hi Dan Jia,
UDP 给 PC 发包 TI 有非常充足的案例,请问mcsdk里的helloworld_evmc667x 和 client_evmc667x 案例可曾成功过?
至于跑峰值,我有以下经验供你参考:
1.与pc机通信(尤其是pc机做server的时候)需要关闭防火墙。
2.TCP 传输效率 优于 UDP 。修改TCP(UDP) Transmit(Receive) buffer size (可以扩大10倍 81920)可以非常有效的提升网口传输速率
3.使用gel文件对DDR进行初始化,干掉evm_init()
striker
hi striker 今天我尝试着把代码量减少,依然也调用了keystone代码,逐个增加,当代码增加到生成的out工程到700KB左右时,程序boot不起来了,请问工具链出错,应该如何修改啊?像hex6x mergebtbl等 工具,怎样修改大小范围呢?
zhonghong ,
工具链支持大小范围远不止700K, 请确认是否是工具链的问题
hex6x 支持大小在rmd文件里指定,其他工具如果有源码在源码里由宏确定
striker
hello striker。谢谢您的回复。
我是要将收发分开来做,DSP发数据不需要触发,所以改写了程序。目前实现DSP向PC发,包与包之间的延时设置为tasksleep。参考链接http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/365786.aspx。
第二步实现PC向DSP发送数据。(还未实现。)
striker:
请问下,你写的操作步骤中的第二步:
其中nor_writer_input.txt文件的内容为
file_name = app.bin
start_addr = 0x80000000
如果把start_addr 配置成0x80000000,会导致norwrite代码中判断地址超出范围而退出。
如果写成start_addr = 0x800000,norwrite可以正常完成。但是在Flash verify时,会失败退出,但是通过打印来看,写入和读出数据是一样的。很是奇怪。
不知道你当初调试时是否遇到过类似情况?这个start_addr 应该怎么配置比较合理呢?
以及向IDE的memory里面导入数据时的地址,应该填写多少呢?
thx~~~
Hi,w ww
nor writer 无非就是跟你约定一个地址,然后从这个地址里读取数据往flash里烧写。通常这个地址不能被任何程序代码数据段使用。Nor writer的所有程序数据段都放到了RAM里,所以0x80000000的DDR地址是安全的,这也就要求在烧写前一定需要用gel文件初始化好DDR,然后在nor writer 运行前将spirom_le.dat 加载进DDR 0x80000000里.
Nor writer的程序很奇怪,需要你把镜像load进DDR让它读之外 又想让你把镜像file_name 告诉他,好让程序读取该镜像文件知道镜像的长度(镜像一般都有个header包含长度信息),我很好奇为什么不索性读写整个文件。
以上不谈,请你确保start_addr 是 0x8000 0000 然后查一下为什么nor writer 会判断地址超出,通常这是不可能的。。
striker
hello striker,谢谢您的回复。
不加tasksleep,包与包之间没有延时,PC抓不到数据包。
我现在的峰值速率1 mbps,想达到20M的速率。请问您那有合适的代码可以参考吗?谢谢您。邮箱~jiandanfeixiang@126.com
您好, 我最近也在做NAND FLASH的自加载,电路设计跟开发板一样。
我直接使用MCSDK中的IBL烧写进EEPROM之后,DSP从I2C启动,串口没有输出,但是在CCS下调试的时候串口工作正常。
请问您用的IBL是直接使用MCSDK中提供的IBL吗?有没有对相关参数做修改
Hi,striker:
使用你提供的方式,还是无法成功。依然是在NorWriter里面无法成功烧写。
对比过差异,发现MCSDK版本不一致。我使用是最新版本,mcsdk_2_01_02_06。不知道里面对应的代码是否完全一致,现在已经下载不到那个老的MCSDK版本了。
想请问下你是否用最新版本的MCSDK试过SPI BOOT么?
thx~
striker striker:
好久不见~现在又有一些问题需要请教您,我现在在使用同事做的一个板子,板子上电时IC2中的程序会初始化Boot参数表和DDR,但地址0x10800000被占用了,普通单核任务的L2配置为0x00820000后,只需要将编译生成的.out文件改为.bin然后烧录就可以正常运行。
我现在想将您的多核工程移植到这块板子上,我将core0的BOOT_CORE由0x10800000改为了0x00820000,L2改为0x008200c0,工具链中省去了加入DDR参数表的步骤,但这样生成的.dat文件无法正常引导,板子上电后不停的打印IBL:Boot from NOR。
请问我做的修改存在什么样的问题?这样更改后还能否启动多核?谢谢!!!
Michael,
请首先尝试用工具链测试单核引导,L2 地址应该使用全局地址 0x00820000->0x10820000
看起来你们的板子使用的是I2C IBL二次引导,这个与spi 直接boot 不是一回事,在EVM板卡上对应的是拨码开关不同。如果想多核boot,就不能和I2C 的IBL的boot 模式相混淆
striker
striker:
根据您的提示我将L2地址修改为0x10820000并进行了单核Boot,现象依旧;
如果如您所说该板子是I2C IBL二次引导(这块板子没有拨码开关,无法选择别的Boot方式),是不是无法完全使用您所提供的工程和工具链?还是我可以通过修改boot参数表的配置就可以解决呢?如果完全无法使用,您能否指点一下我应该如何进行多核Boot?谢谢~
Fassbender
你们的板子在设计的时候一定不会把启动模式写死,虽然没有拨码开关但是一定是通过单片机或者FPGA控制管脚。咨询你们的硬件团队。
striker
striker :
您说的没错, 确实是通过FPGA选择的Boot模式,并初始化了PLL和DDR,能否在不改变Boot模式的情况下修改现有工具链和内存配置实现多核启动呢?谢谢。
striker :
您好,我现在用的这块板子确定必须使用IBL二次Boot,无法使用SPI NOR Flash直接Boot。请问如果我想实现IBL二次Boot应该参考哪些文档和例子??求指点,谢谢!!!