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.

TMS320C6746: HPI boot failure

Part Number: TMS320C6746
Other Parts Discussed in Thread: AM3354

Hi guys,

I'm currently working on the HPI boot of C6746 via AM3354 (the host). Basically I'm following the procedures below:

• Bootloader interrupts the host by setting the HINT bit, in the HPIC register, to inform that it is ready and
that the host can start loading the application image to device memory.
• Host acknowledges this interrupt by clearing the HINT bit.
• Host loads the application image to device memory and writes application entry point to location
0x11800000 in device memory.
• Host reads back the final word it wrote to device memory to make sure all HPI writes have completed
successfully.
• Host interrupts bootloader by setting DSPINT bit in HPIC register to inform that loading of application
image is complete.
• Bootloader acknowledges host by clearing DSPINT bit.
• Bootloader reads application entry point (written by host) from address 0x11800000 and branches to it.

Now, the host has

0) reset the DSP, so that the boot pins are latched into BOOTCFG register, which exactly showed 0x4, indicating HPI boot mode. (Now HPIC = 0x44)

1) cleared HINT (HPIC turns from 0x44 to 0x40);

2) loaded the application image (.bin file) as a whole to 0x1180E000 ~ 0x1180F078, which is a piece of DSP memory of my choice;

3) written the application entry point to 0x11800000. The app entry turned out to be 0x1180EEF0. I'll explain how I got this number later;

4) read back the final word of the DSP application image and confirmed it.

5) set DSPINT (HPIC turns from 0x40 to 0x42).

Then I connected the XDS100V3 emulator to DSP and opened the memory browser in CCS. I found that HPIC = 0x42, HPIA = 0x1180F078, and the image was indeed properly loaded. However, the DSP program did NOT run, otherwise the GPIO should have lit an LED on my board (actually I can light the LED when I load the program via the emulator, so the DSP program itself should not have a problem).

The boot table was as follows:

const char DSPinitBootTable[]={
 /*Program Entry point*/
 0xe0, 0x0e, 0x80, 0x11,
 /*Section .text begin*/
 0x20, 0x10, 0x00, 0x00, /*Size in bytes*/
 0x00, 0x00, 0x80, 0x11, /*Load address*/
 0x00, 0x00, 0x80, 0x11, /*Run address*/
 /*Raw section Data*/
......
 /*Section .cinit begin*/
 0x34, 0x00, 0x00, 0x00, /*Size in bytes*/
 0x20, 0x18, 0x80, 0x11, /*Load address*/
 0x20, 0x18, 0x80, 0x11, /*Run address*/
 /*Raw section Data*/
......
}
When I load the program via emulator, the program entry point (0x11800EE0) is exactly the location of c_init00, and the first byte of raw data in .text section resides just at 0x11800000.
Now that I load the program via HPI, I'll have calculate the real position of c_init00 by:
real application entry point at HPI boot = PE + (BD - 0x11800000) + 0x10,
where:
PE = Program entry point indicated by the boot table, which in my case is 0x11800EE0;
BD = Destination of application image burnt, which in my case is 0x1180E000;
The last term 0x10 is the offset from the head of boot table to the first byte of raw data in .text section.
I guess there might be problems with:
1) the way I burnt the image. Currently I burn the image as a whole, but I doubt if I should load the .cinit section to a different place.
2) the way I calculated the application entry point, as demonstrated above.
I appreciate any comments and suggestions.
Charlie