Hello,
I'd like to ask community advice on the following topic.
In our design we use ARM controller to boot DSP over HPI. Boot binaries are stored in NAND flash. ARM reads binary from the flash, resets DSP using its GPIO pin, loads binary to DSP's memory and triggers DSPINT.
As I understand booting process, upon DSPINT, DSP starts execution code from zero address. Since I want to use DSP/BIOS application, I have to start with _c_int00 execution. To do that I created a section at the memory origin, defined following C function and told linker to put function to that section.
#pragma CODE_SECTION (boot_main, ".sect_hpi_boot");
extern void c_int00(void);
void boot_main(void)
{
c_int00(); // jump to DSP/BIOS init
}
It seems to work, but produces 32 bytes of code with unnecessary stack pointer operations, though never returns pragmas were used. Because sole purpose of this code is to jump to _c_int00 location, I am thinking about linear assembly. But that area is dark for me.So far I came out with the following code:
.sect ".sect_hpi_boot" ; Tell assembler to place following code in specific section
; Later we link this section starting from address 0x00.
.ref _c_int00 ; DSP/BIOS entry. This symbol defined elsewhere and
; referenced here. Resolve at link time.
.global _boot_main ; We define _boot_main symbol here.
; Tell linker to place it in symbol table.
_boot_main:
b _c_int00 ; Jump to DSP/BIOS init
I remember I've heard many times, that branching takes some time to occur and NOP instruction should be used. Do I need them in this example? Perhaps I have to use bnop?
My results are not very stable now, so I'd like to ask for clarification on other point. In DSP/BIOS scheduler, for HWI_RESET should I specify default _c_int00 or redefine to my _boot_main?
Thanks in advance.