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.

RTOS/TMS320F28075: SYS/BIOS and BOOT/FIRMWARE separation

Part Number: TMS320F28075

Tool/software: TI-RTOS

Hi,
I'm developing a new board with TMS320F28075 DSP and TI SYS/BIOS (only TI SYS/BIOS, not complete RTOS).
I'm using CCS version 6.1.1.00022.

In the previous weeks I've made some tests with TI examples to become familiar with SYS/BIOS management of Tasks, Clocks, Swi, Hwi, ecc.

Now I want to structure the software for the board.

The software is divided into two parts:

1) BOOT: it includes init() function which is executed at startup, after DSP is powered on.
init() function initializes some basic DSP resources (CPU clock, port, etc.) then it checks an external Flash Memory: if a new FIRMWARE is found in it, init() copies that FIRMWARE in FW_FLASH_SECTION of DSP flash.
Finally init() calls main() function, which is included in FIRMWARE.

2) FIRMWARE: it includes main() function and all functions related to the application.
main() function initializes some data structures and then it calls BIOS_start() function, starting SYS/BIOS.

BOOT and FIRMWARE are developed and compiled in the same CCS project.

In the first programming BOOT and FIRMWARE are downloaded into DSP with bootloader.

After the first programming I want to upgrade FIRMWARE via fieldbus/USB port as often as I want with the following procedure (suppose FIRMWARE version 1.0 is installed on board and FIRMWARE version 2.0 has to be installed)
- the master downloads FIRMWARE 2.0 into external Flash Memory on board;
- FIRMWARE 1.0 exits and the BOOT is executed again;
- BOOT finds FIRMWARE 2.0 into external Flash Memory, it cancels FIRMARE 1.0 by erasing FW_FLASH_SECTION and then it copies FIRMWARE 2.0 in FW_FLASH_SECTION;
- finally BOOT calls main() function included in FIRMWARE 2.0 and so new FIRMWARE is executed.

The focal points are:
a) BOOT must call main() function (correctly!) with all FIRMWARE versions, altough BOOT is compiled only once with FIRMWARE version 1.0. In other words BOOT must know the address of main() function of all FIRMWARE future versions;
b) there must be NO link between BOOT functions/data and FIRMWARE functions/data.

In my previous applications (without SYS/BIOS) I applied some workarounds to meet these requirements:
a) the address of main() function is copied into the same flash location ADDRESS_MAIN well known by the BOOT. In other words in different FIRMWARE versions main() is located at different flash locations but its address is always copied into ADDRESS_MAIN so BOOT init() function can calls main() through a pointer to ADDRESS_MAIN;

b) BOOT and FIRMWARE are developed in the same CCS project but they are located in distinct sectors of DSP flash memory (BOOT_FLASH_SECTION and FW_FLASH_SECTION). Moreover BOOT and FIRMWARE use distinct RAM sectors for its data and variables (BOOT_RAM_SECTION and FW_RAM_SECTION).

In this application I use SYS/BIOS.
I've read that Startup sequence is managed by XDCTools ( http://rtsc.eclipse.org/docs-tip/Using_xdc.runtime_Startup )  and that somewhere main() function is called (even if I don't know where...).
With regard to requirement a) I need that main() call is not made directly otherwise I must compile and upgrade BOOT and FIRMWARE together, whereas I want to upgrade only FIRMWARE.

QUESTION 1: How can I do to meet this requirement?

With regard to requirement b) I locate Startup_resetFxn(), Startup_firstFxns(), Startup_lastFxns() into BOOT_FLASH_SECTION while Task, Clocks, Timers, Swis, Hwis and all SYS/BIOS stuff are located into FW_FLASH_SECTION because I want there's NO link between BOOT and FIRMWARE, except for ADDRESS_MAIN.
However I don't know if XDCTools or SYS/BIOS still retain some "hidden links" between functions or data structure located in BOOT_FLASH_SECTION/BOOT_RAM_SECTION with those located in FW_FLASH_SECTION/FW_RAM_SECTION.

QUESTION 2: What I have to do to be sure that all XDCTools/SYS-BIOS stuff in BOOT is not linked to XDCTools/SYS-BIOS stuff in FIRMWARE?

Thanks in advance for any answer.

  • Hi Demis,

    SYS/BIOS is really not setup to meet your requirements. As you noted, there are several items called before main() by the kernel. We've never documented the entire list of items that need to happen before main() and I'm reluctant to do so because it may change with different versions.

    We don't have a mechanism to remove the pre-main items from the image also. I think you need to have a simple boot-loader (without SYS/BIOS) that does your BOOT functionality. Then a separate FIRMWARE project.

    Todd
  • Hi Todd,
    thank you for your answer. I was afraid that this was the solution, but I hoped not.
    Never mind, that's ok.

    Thanks.

    Demis