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.

TMS570LS1227: Branch assembly instruction for Jump to Application Address

Part Number: TMS570LS1227

Dear TI Team,

Branch assembly instruction for Jump to Application Address.

Which and how the assembly instruction should be used to jump to Application code from Bootloader. The Assembly Instruction has to be written in C file.

Thanks & Regards,

Vijay B. Shinde

  • Hi Vijay,

    1. You can use the following C instruction to jump to Application

            ((void (*)(void))g_ulTransferAddress)();

    2. or AM Assembly instruction:

        asm( "   BLX Rm");

  • Dear QJ Wang,

    Thanks for your reply. But still some below doubts.

    1) How and where is this Rm symbol defines?

    e.g. The application code address starts at 0x80000, so how it has to be defined in configuration file and in the above asm BLX Rm instruction.

     2)  ((void (*)(void))g_ulTransferAddress)(); : is this any library function? 

    Thanks & Regards,

    Vijay B. Shinde

  • 1) How and where is this Rm symbol defines?

    Rm is any of the MCU general registers.

    The application code address starts at 0x80000, so how it has to be defined in configuration file and in the above asm BLX Rm instruction.

    asm("  mov r12, #0x80000");

    asm("  blx r12");

     2)  ((void (*)(void))g_ulTransferAddress)(); : is this any library function?

    No, this is from my bootloader example project. g_ulTransferAddress is the application start address.

           

  • Dear QJ Wang,

    Thanks for your reply. But still some below doubts.

    1) asm(" mov r12,#0x200000");

        asm(" blx r12");

           is not working in CCS compiler

           we are not able to put breakpoint also while debugging at this line.

    2) Can you please provide the definition for the respective routine :

           #define APP_START_ADDRESS               0x00020000U

         g_ulTransferAddress = (uint32_t)APP_START_ADDRESS;

       ((void (*)(void))g_ulTransferAddress)();

    Thanks & Regards,

    Vijay B. Shinde

  • Hi Vijay,

    1) asm(" mov r12, 0x20000");

         asm(" blx r12");

    should work.

    This is example. 0x5960 is the address of sciInit().

    2) 

    Can you please provide the definition for the respective routine :

      ((void (*)(void))0x20000)();  

    In the above function call, (void (*) (void)) is the data type: a pointer to a function that takes no arguments and that returns a void.

    The 0x20000 is the address to cast. After the type cast, the function pointer points to address 0x20000. Note that we put parentheses () around the data type and the 0x20000. This is unnecessary if we only want to cast 0x20000 to a function pointer. However, since we are going to invoke the function, these parentheses are required.

    Casting a numeric constant to a pointer is not the same as calling a function through a pointer. To do that, we must specify an argument list. That is what the () at the end of the line does.

    Note that all parentheses in this expression are required. Grouping and precedence are important.

  • OK. Thanks for your reply. We will check and reply. Thanks