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/TM4C1294NCPDT: Locating embedded application to specific address

Part Number: TM4C1294NCPDT


Tool/software: TI-RTOS

Hi,

I am developing embedded application on TM4C1294NCPDT using TI-RTOS v2.16.

I want to locate application to specific address.

Scenario 1: I have 2 different applications based on TI-RTOS. Application 0 should start at power-up and starts/launches Application 1.

Application 0: Start address = 0x00000000 and size = 0x00040000

Application 1: Start address = 0x00040000 and size = 0x00040000

Scenario 2: I have 3 applications of which 2 uses TI-RTOS. Application 0 should start at power-up and starts/launches Application 1 or Application 2 based on GPIO pin state.

Application 0: Start address = 0x00000000 size = 0x00010000 (Baremetal application)

Application 1: Start address = 0x00010000 size = 0x00020000 (TI-RTOS application)

Application 2: Start address = 0x00040000 size = 0x0004000 (TI-RTOS application)

What and which changes I need to do for both scenarios to set start address and size of each applications linker file along with project settings ?

How can I jump from one TI-RTOS application to another TI-RTOS application ? Is only TI-RTOS API BIOS_exit() and jump to other application from myExitSystem() which is called upon BIOS_exit() is enough ?

Thanking you.

Best Regards,

Harshal

  • Hi Harshal,

    There is an example that covers much of what you will need:
    processors.wiki.ti.com/.../TI-RTOS_USB_DFU

    Theexample is about Device Firmware Upgrades over USB but it covers bootloaders and specifying application boundaries in CCS. You can simply ignore the USB parts in the USB_Serial_DFU.pdf.

    As for jumping between applications, you will need to define the c_int00 addresses of each of your apps and either use an inline branch instruction or a function call on a function pointer that points to one of these addresses. I hope that covers most of your questions, let me know if you need further clarifications.

    Thanks,

    Sean

  • Thanks Sean for you suggestion.
    I have referred document and project suggested by you.

    As per my understanding, it needs modification in startup file to copy vector table.

    Is it possible to update startup file for TI-RTOS project ? OR How can I get control over startup file ?

    My basic need is to jump successfully from one TI-RTOS application to other TI-RTOS application.

    For scenario 1 mentioned in my problem statement which has 2 applications and both are using TI-RTOS.

    Please share example project for scenario 1.
  • In above shared example, as per my understanding jump to application is through bare metal code of bootloader.

    In start-up file, CallApplication() manages launching other application. Similarly for TI-RTOS project/application which start-up file is used ?
  • No problem Harshal. Your RTOS applications will be configured to place their vector tables in their own flash space per the example documentation. So there is no need to modify their startups. If you did want to modify start up for TI RTOS apps, there is an XDC runtime module called Startup which allows users run their own code during startup before Main(). The documentation for startup (xdc->runtime->startup) can be found in the SYS/BIOS documentation:

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/sysbios/6_75_01_05/exports/bios_6_75_01_05/docs/cdoc/index.html

    Note you should go to the docs for the version of SYS BIOS you are using. This version number should be in a manifest in your SDK.

    For your scenario #1, the first app is placed at 0x0 and runs until it jumps to your next app (let's say you placed it at 0x4000) which then runs as usual. For jumping to your next application, you can do what the bootloader does with inline assembly:

        //
        // Load the stack pointer from the application's vector table.
        //
    #if (APP_START_ADDRESS != VTABLE_START_ADDRESS)
        asm(" movw    r0, #(APP_START_ADDRESS & 0xffff)");
    #if (APP_START_ADDRESS > 0xffff)
        asm(" movt    r0, #(APP_START_ADDRESS >> 16)");
    #endif
    #endif
        asm(" ldr     sp, [r0]");
    
        //
        // Load the initial PC from the application's vector table and branch to
        // the application's entry point.
        //
        asm(" ldr     r0, [r0, #4]");
        asm(" bx      r0");

    You only have to provide to the application (at compile time) what the address of the next application is (0x4000 for example). Since you will configure your apps to have their vector tables at their start address, the apps will run as if they were placed normally.

    Thanks,

    Sean

  • I tried as suggested, but it is launching same application at 0x0000 instead 0x4000.
  • I loaded R0 with application start address and it's working successfully.

    Thanks for support.