在查看 DSP Bootloader for KeyStone Architecture User's GuideLiterature Number: SPRUGY5C
文档中3.2.2中关于BOOT Table中的介绍:“The image to be loaded into the device is converted to a format recognizable by theRBL. This format is called the boot table. Code and data sections are inserted into theboot table automatically by the hex conversion utility. The hex conversion utility usesinformation embedded by the linker in the application file to determine the destinationaddress and length for each section. Adding these sections to the boot table requires nospecial intervention by the user. The hex conversion utility adds all initialized sectionsin the application to the boot table. The remaining information included in this sectiondescribes the format of the sections in the boot table.
Each section is added to the boot table in the same format. The first entry is a 32-bitcount representing the length of the section in bytes. The next entry is a 32-bitdestination address, where the first byte of the section is copied.
The RBL continues to read and copy these sections until it encounters a section whosebyte count is 0. This indicates the end of the boot table. Then, the bootloader branchesto the entry point address (specified at the beginning of the boottable) and beginsexecuting the application.”
按上面的意思,应该是在进行Hex转换时,添加-boot命令,应该就可以把BOOT TABLE自动生成并转换,并把代码段和数据段插入到BOOT Table中去,但是我在查看 C6678 RBL源码时,看起来似乎在 boot_spi_read_block()函数中,读取boottable时,设置的boottable段最大字节数为1024字节,并且那个函数看起来只调用了一次,不知道理解是不是正确,如果是这样的话,那不意味着用户程序中的代码段和数据段是不可能全部插到boottable中去的吗?
那这样的话,是说需要用户再做一个二级引导程序,然后把这个二级引导程序添加boottable,由C6678RBL引导二级引导程序,然后再由二级引导来完成真正的用户程序执行?
因为一直对于BOOT这部分不熟悉,现在看着一头雾水,烦请各位大侠不要觉得太过白痴,指点一下。谢谢!
Andy Yin1:
参考SPI flash boot 例程
http://www.deyisupport.com/question_answer/dsp_arm/c6000_multicore/f/53/t/46608.aspx