Here it is a tips for someone who wants to boot c66x from nor flash connected through emif16:
1. I’ve made my .out file with such strings in command file:
-stack 0x400
-heap 0x400
MEMORY
{
BOOT (R): o = 0x70000000 l = 0x00000100
INTVEC (R): o = 0x70000100 l = 0x00001000 /* 512kB LOCAL L2/SRAM */
LOCAL_L2_SRAM: o = 0x00800000 l = 0x00080000 /* 512kB LOCAL L2/SRAM */
LOCAL_L1P_SRAM: o = 0x00E00000 l = 0x00008000 /* 32kB LOCAL L1P/SRAM */
LOCAL_L1D_SRAM: o = 0x00F00000 l = 0x00008000 /* 32kB LOCAL L1D/SRAM */
EMIF16_CS2 (R): o = 0x70001100 l = 0x003FE000
SHRAM (RWIX): o = 0x0C000000 l = 0x00400000 /* 4MB Multicore shared Memory */
EMIF16_CS3: o = 0x74000000 l = 0x04000000 /* 64MB EMIF16 CS3 Data Memory */
EMIF16_CS4: o = 0x78000000 l = 0x04000000 /* 64MB EMIF16 CS4 Data Memory */
EMIF16_CS5: o = 0x7C000000 l = 0x04000000 /* 64MB EMIF16 CS5 Data Memory */
DDR3: o = 0x80000000 l = 0x80000000 /* 2GB CE0 and CE1 external DDR3 SDRAM */
}
SECTIONS
{
.boot > BOOT
{
-l rts6600_elf.lib <boot.obj> (.text)
}
.csl_vect > INTVEC
.intvecs > INTVEC
.text > EMIF16_CS2
.stack > SHRAM
.bss > SHRAM
.cio > SHRAM
.const > EMIF16_CS2
.data > SHRAM
.switch > EMIF16_CS2
.sysmem > SHRAM
.far > SHRAM
.args > SHRAM
.ppinfo > SHRAM
.ppdata > SHRAM
/* COFF sections */
.pinit > EMIF16_CS2
.cinit > EMIF16_CS2
/* EABI sections */
.binit > SHRAM
.init_array > SHRAM
.neardata > SHRAM
.fardata > SHRAM
.rodata > SHRAM
.c6xabi.exidx > SHRAM
.c6xabi.extab > SHRAM
}
The size of sections may differ. But main thing is a position of boot section. It points to the start of CS2 in emif16 address space. In SECTIONS one must fix an address of _c_int00 that is allocated at boot.obj. _c_int00 must be allocated at 0x70000000 address.
2. After compilation we have an .out file which contain our program in ELF format. Next step is to convert this file in raw binary to load it into the flash. To simplify a process I’ve made a .bat with such content:
hex6x.exe convert_hex_preloader.rmd
b2ccs.exe c6000_preloader.btbl c6000_preloader.dat
ccs2bin.exe c6000_preloader.dat c6000_preloader.bin
You can find utilities hex6x, b2ccs and ccs2bin in ccs installation directory. Convert_hex_preloader.rmd file contain a commands for hex6x. In my case they are:
c6000_preloader.out
--ascii
--image
--map c6000_preloader.map
--entrypoint _c_int00
ROMS
{
ROM1: org=0x70000000, len=0x10000, romwidth=32, memwidth=32
files={c6000_preloader.btbl}
}
For more info look hex6x –help.
3. After that you have .bin file which you can flash to the nor starting with 0x70000000.
p.s.: Don’t forget to set bootstrap pins correctly. In my case they are BOOTMODE[12:0] = 1100_0001_0000. I hope this will helps someone.