DSP 320C6727B
Code loaded to SRAM (IRAM) only.
I am witnessing differences in code execution depending on how the same piece of code is loaded. The code in question is designed to run entirely from IRAM, uses McASPs and other interrupt services.
Two scenarios:
A) Code loaded via CCS & JTAG debugger. A GEL file is executed that does PLL and EMIF setup (no cache or interrupt setup happens) when loading the code. Code when loaded is halted at main() ready for execution. EIR at that point is 0x2. When executing, code spawns threads which enable various interrupts (EIR=0x132) and code runs as expected.
B) Code is loaded via HPI by a PPC440. .out file is converted to .bin and loaded via a custom loader on the PPC. Code executes but doesn't quite run as expected. When halted, EIR=0x0 or EIR=0x12 (the interrupts that are not enabled here but are in scenario A are related to the functionality that is not as expected). A stage 2 bootloader is put at then end of IRAM that takes over from the DSP built-in loader, initializes the PLL and then waits for the PPC to load the main program. Before loading the main program, the PPC sets up the EMIF registers via HPI after the stage 2 loader does PLL setup. The handover from the stage 2 loader to the main program is similar to how the internal loader does it but using an area of memory at the end of IRAM. Entry point for the loader is _c_int00.
The PPC loader loads all text and initialized data segments.
I have verified most of the text segments via the debugger and proven that the resulting memory image is the same in both scenarios A and B prior to execution.
DSP code is all C++. DSP interrupts are setup in C++ object constructors.
Help?