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.

Booting C641x over HPI

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.

  • First, which device are you using. Detailed questions can require a specific device number instead of a generalized family answer. The C6412 may have different boot details than the C6415, for example.

    Second, which version of DSP/BIOS and CCS are you using? We usually have some good examples for building standalone projects with interrupt vector tables and linker command files to hand you all of these answers. And I also thought that DSP/BIOS gives you a vector table that you can locate at address 0 to branch to _c_int00.

    Third, you can go to the TI Wiki Pages and look for the TMS320C6x1x DSP Integration Workshop. It has information on building a project and the vector table, and some associated lab files that can be used as examples.

    Regards,
    RandyP

  • Hello,

    Its about C6414 and C6416, DSP/BIOS 5.41.

    I feel I missed to tell more details. For years we used DSP to boot from parallel flash on EMIFB. That bootmode consists of copying 1K of code from EMIFB CE0, and then executing it. So, at zero address of the binary image there was a code of bootloader. We use separate section for it. Bootloader effectively is was copying binary from the flash to RAM and then proceed with jump to _c_int00. Later we added one more section right after boot loader with image ID info, so we can identify image by its content on the disk and in runtime as well. Given all this, there was no _c_int00 at zero address. As I saw from the map file, it was not even close to memory origin. Now we try to use HPI boot process. Perhaps, I have to reconsider section placement, letting _c_int00 land at zero address. Then, additional jump would not be required. Will appreciate hints.

  • Ok, I saw how to place _c_int00 at known address. To do that I have to create separate section for .sysinit. Can you guess, whether its size, I mean code size for sysinit would be same, or at least not grow too much, so I could have other section placed right above it and don't have to modify it later?

    Thanks in advance.

  • If you want two sections to begin at the same place each time, use similar methods for both. There are a lot of linker "tricks" you can use, described in the Assembly Language Tools Reference Guide for your version of the tools.

    The safe thing to do is to assume .sysinit can change. If you need a definite answer, the BIOS Forum would be the place to ask. If you do, please post a link to that thread here so future readers can follow it.

    Regards,
    RandyP

  • Thanks, I've got enough information to think.