On our own C6457 based board we boot from external flash using the EMIFA boot mode. The bootloader copies the software image into L2 RAM at 0x800000 and then vectors to c_int00.
What is strange is that one of our boards boots OK and the other refuses to boot at all.
With the faulty board I do the following:
Load the software using CCS into RAM at 0x800000
Run the software in order to enable the EMIFA
Stop the software
Clear the memory from 0x800000 to 0x9c0000 where the software goes (the rest we use for the actual L2 cache)
In the disassembly window set the PC to the start address of the bootloader
Do a Debug->Run
After a few seconds it is obvious that booting has not occurred because there is nothing on StdOut: i.e. we are not really booting but running the bootcode while connected to CCS and in emulation boot mode.
Do a Debug->Halt in order to see what is going on
Found out that the memory from 800000 to 9c0000 is all zero: i.e. the bootloader has copied nothing
Again, in the disassembly window set the PC to the start address of the bootloader
Do a Debug->Run
This time the software "boots" because we see StdOut and it is functionally operational.
The bootcode disables the L1D because we are basically copying data to memory and then executing that memory as instructions. However, even if for some reason the L1D was not disabled then only 32K could be floating in cache and not written and this would not account for why 0x1c0000 is not written.
I have tested the flash address lines and data lines with walking '1' and '0' respectively and the device appears OK. I have also used a pseudo random number generator to write data and then read back the whole flash. This also works OK. CCS in the disassembly window can 'see' the flash when the EMIFA CE3 is enabled.
What is strange is that basically my bootloader sometimes copies to 800000 to 9c0000 and sometimes does not.
Ideas?
I thought for completeness I would include the bootcode (its not very elegant):
What it does is:
Disable L1D
Sets up EMIFA
Sets up PLL to 600MHz from board clock of 60MHz
Copy software image from flash at 0xb0010000 to internal DSP ram at 0x800000
B0000000 0000002A MVK.S2 0x0000,B0
B0000004 0000006A MVKH.S2 0x0000,B0
B0000008 0080202A MVK.S2 0x0040,B1
B000000C 0080C26A MVKH.S2 0x1840000,B1
B0000010 000402F6 STW.D2T2 B0,*+B1[0]
B0000014 00000000 NOP
B0000018 00000000 NOP
B000001C 00000000 NOP
B0000020 000402E6 LDW.D2T2 *+B1[0],B0
B0000024 00000000 NOP
B0000028 00000000 NOP
B000002C 00000000 NOP
B0000030 00000000 NOP
B0000034 00000000 NOP
B0000038 00000000 NOP
B000003C 00000000 NOP
B0000040 000C502A MVK.S2 0x18a0,B0
B0000044 00030DEA MVKH.S2 0x61b0000,B0
B0000048 0080422A MVK.S2 0x0084,B1
B000004C 00B8006A MVKH.S2 0x70000000,B1
B0000050 00000000 NOP
B0000054 00000000 NOP
B0000058 00000000 NOP
B000005C 00000000 NOP
B0000060 000402F6 STW.D2T2 B0,*+B1[0]
B0000064 00000000 NOP
B0000068 00000000 NOP
B000006C 00000000 NOP
B0000070 00000000 NOP
B0000074 00000000 NOP
B0000078 00000000 NOP
B000007C 00000000 NOP
B0000080 0080442A MVK.S2 0x0088,B1
B0000084 00B8006A MVKH.S2 0x70000000,B1
B0000088 00000000 NOP
B000008C 00000000 NOP
B0000090 00000000 NOP
B0000094 00000000 NOP
B0000098 00000000 NOP
B000009C 00000000 NOP
B00000A0 000402F6 STW.D2T2 B0,*+B1[0]
B00000A4 00000000 NOP
B00000A8 00000000 NOP
B00000AC 00000000 NOP
B00000B0 00000000 NOP
B00000B4 00000000 NOP
B00000B8 00000000 NOP
B00000BC 00000000 NOP
B00000C0 0000802A MVK.S2 0x0100,B0
B00000C4 0000006A MVKH.S2 0x0000,B0
B00000C8 007FFFD2 ADDK.S2 -1,B0
B00000CC 00008000 NOP 5
B00000D0 20000110 [ B0] B.S1 0xB00000C8 (PC+8 = 0xb00000c8)
B00000D4 00000000 NOP
B00000D8 00000000 NOP
B00000DC 00000000 NOP
B00000E0 00000000 NOP
B00000E4 00000000 NOP
B00000E8 00000000 NOP
B00000EC 00000000 NOP
B00000F0 00000000 NOP
B00000F4 00000000 NOP
B00000F8 00000000 NOP
B00000FC 00000000 NOP
B0000100 000004AA MVK.S2 0x0009,B0
B0000104 0000006A MVKH.S2 0x0000,B0
B0000108 0080882A MVK.S2 0x0110,B1
B000010C 00814D6A MVKH.S2 0x29a0000,B1
B0000110 000402F6 STW.D2T2 B0,*+B1[0]
B0000114 00000000 NOP
B0000118 00000000 NOP
B000011C 00000000 NOP
B0000120 00000000 NOP
B0000124 00000000 NOP
B0000128 00000000 NOP
B000012C 00000000 NOP
B0000130 00000000 NOP
B0000134 00000000 NOP
B0000138 00000000 NOP
B000013C 00000000 NOP
B0000140 0040002A MVK.S2 0xffff8000,B0
B0000144 0000006A MVKH.S2 0x0000,B0
B0000148 0080942A MVK.S2 0x0128,B1
B000014C 00814D6A MVKH.S2 0x29a0000,B1
B0000150 000402F6 STW.D2T2 B0,*+B1[0]
B0000154 00000000 NOP
B0000158 00000000 NOP
B000015C 00000000 NOP
B0000160 0000A000 NOP 6
B0000164 0000A000 NOP 6
B0000168 0000A000 NOP 6
B000016C 0000A000 NOP 6
B0000170 0000A000 NOP 6
B0000174 0000A000 NOP 6
B0000178 0000A000 NOP 6
B000017C 0000A000 NOP 6
B0000180 0000002A MVK.S2 0x0000,B0
B0000184 0000006A MVKH.S2 0x0000,B0
B0000188 0080802A MVK.S2 0x0100,B1
B000018C 00814D6A MVKH.S2 0x29a0000,B1
B0000190 000402F6 STW.D2T2 B0,*+B1[0]
B0000194 00000000 NOP
B0000198 00000000 NOP
B000019C 00000000 NOP
B00001A0 0000A000 NOP 6
B00001A4 0000A000 NOP 6
B00001A8 0000A000 NOP 6
B00001AC 0000A000 NOP 6
B00001B0 0000A000 NOP 6
B00001B4 0000A000 NOP 6
B00001B8 0000A000 NOP 6
B00001BC 0000A000 NOP 6
B00001C0 0000A000 NOP 6
B00001C4 0000A000 NOP 6
B00001C8 0000A000 NOP 6
B00001CC 0000A000 NOP 6
B00001D0 0000A000 NOP 6
B00001D4 0000A000 NOP 6
B00001D8 0000A000 NOP 6
B00001DC 0000A000 NOP 6
B00001E0 0000A000 NOP 6
B00001E4 0000A000 NOP 6
B00001E8 0000A000 NOP 6
B00001EC 0000A000 NOP 6
B00001F0 0000A000 NOP 6
B00001F4 0000A000 NOP 6
B00001F8 0000A000 NOP 6
B00001FC 0000A000 NOP 6
B0000200 0000A000 NOP 6
B0000204 0000A000 NOP 6
B0000208 0000A000 NOP 6
B000020C 0000A000 NOP 6
B0000210 0000A000 NOP 6
B0000214 0000A000 NOP 6
B0000218 0000A000 NOP 6
B000021C 0000A000 NOP 6
B0000220 0000A000 NOP 6
B0000224 0000A000 NOP 6
B0000228 0000A000 NOP 6
B000022C 0000A000 NOP 6
B0000230 0000A000 NOP 6
B0000234 0000A000 NOP 6
B0000238 0000A000 NOP 6
B000023C 0000A000 NOP 6
B0000240 000000AA MVK.S2 0x0001,B0
B0000244 0000006A MVKH.S2 0x0000,B0
B0000248 0080802A MVK.S2 0x0100,B1
B000024C 00814D6A MVKH.S2 0x29a0000,B1
B0000250 000402F6 STW.D2T2 B0,*+B1[0]
B0000254 00000000 NOP
B0000258 00000000 NOP
B000025C 00000000 NOP
B0000260 00000000 NOP
B0000264 00000000 NOP
B0000268 00000000 NOP
B000026C 00000000 NOP
B0000270 00000000 NOP
B0000274 00000000 NOP
B0000278 00000000 NOP
B000027C 00000000 NOP
B0000280 0000002A MVK.S2 0x0000,B0
B0000284 000003EA MVKH.S2 0x70000,B0
B0000288 0400002A MVK.S2 0x0000,B8
B000028C 040003EA MVKH.S2 0x70000,B8
B0000290 00000000 NOP
B0000294 00000000 NOP
B0000298 00000000 NOP
B000029C 00000000 NOP
B00002A0 0080002A MVK.S2 0x0000,B1
B00002A4 00D800EA MVKH.S2 0xb0010000,B1
B00002A8 0100002A MVK.S2 0x0000,B2
B00002AC 0100406A MVKH.S2 0x800000,B2
B00002B0 018CB02A MVK.S2 0x1960,B3
B00002B4 01804A6A MVKH.S2 0x940000,B3
B00002B8 00000000 NOP
B00002BC 00000000 NOP
B00002C0 007FFFD2 ADDK.S2 -1,B0
B00002C4 02040AE6 LDW.D2T2 *+B1[B0],B4
B00002C8 007FFFD2 ADDK.S2 -1,B0
B00002CC 02840AE6 LDW.D2T2 *+B1[B0],B5
B00002D0 007FFFD2 ADDK.S2 -1,B0
B00002D4 03040AE6 LDW.D2T2 *+B1[B0],B6
B00002D8 007FFFD2 ADDK.S2 -1,B0
B00002DC 03840AE6 LDW.D2T2 *+B1[B0],B7
B00002E0 047FFFD2 ADDK.S2 -1,B8
B00002E4 02090AF6 STW.D2T2 B4,*+B2[B8]
B00002E8 047FFFD2 ADDK.S2 -1,B8
B00002EC 02890AF6 STW.D2T2 B5,*+B2[B8]
B00002F0 047FFFD2 ADDK.S2 -1,B8
B00002F4 03090AF6 STW.D2T2 B6,*+B2[B8]
B00002F8 047FFFD2 ADDK.S2 -1,B8
B00002FC 03890AF6 STW.D2T2 B7,*+B2[B8]
B0000300 00000000 NOP
B0000304 2FFFF810 [ B0] B.S1 0xB00002C0 (PC-64 = 0xb00002c0)
B0000308 00000000 NOP
B000030C 00000000 NOP
B0000310 00000000 NOP
B0000314 00000000 NOP
B0000318 00000000 NOP
B000031C 00000000 NOP
B0000320 00000000 NOP
B0000324 000C0362 B.S2 B3
B0000328 00008000 NOP 5
B000032C 00000000 NOP
B0000330 00000000 NOP
B0000334 00000000 NOP
B0000338 00000000 NOP
B000033C 00000000 NOP