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/CC1310: TIRTOS and BIM

Part Number: CC1310
Other Parts Discussed in Thread: CC1350

Tool/software: TI-RTOS

Hello,

What changes I need to make to empty rtos project

to allow from

C:\ti\simplelink_cc13x0_sdk_2_20_00_38\examples\rtos\CC1350_LAUNCHXL\blestack\util\bim\

to jump (    asm(" BX R1 ");     )

to empty rtos project?

Vitaly

  • Hi Vitaly,

    Can you explain the context a little bit more? What are you trying to achieve?

    What device are you using, and are you using a custom board?

    Why do you want to use the blestack BIM project (instead of using e.g. the Easylink BIM project)?
  • Hi, Marrie H.
    Can you explain the context a little bit more? What are you trying to achieve?
    1. I want to take a BIM (Bootloader) and load it to cc1350.
    2. I want to take and Empty TI-RTOS project and load it to the cc1350.
    3. Be able to load the Empty TI-RTOS project from the bootloader (BIM) - the asm(" BX R1 "); command.
    4. Rewrite the Empty TI-RTOS project with Empty2 TI-RTOS project from the bootloader (BIM).
    5. Do step 3 with the new Empty2 project.

    What device are you using, and are you using a custom board?
    CC1350 on SmartRF06 Evaluation Board.

    Why do you want to use the blestack BIM project (instead of using e.g. the Easylink BIM project)?
    Because I'm using IAR and Easylink BIM doesn't have an IAR environment.

    Vitaly
  • Hi Vitaly,

    The code for jumping into an image from BIM is found in main() (bim_main.c).

    If you're attaching an OAD image header to your image, you can jump to 0x0010 (assuming reset vectors come immediately after the oad image header), if not, you can jum to 0x0000. 

    If you don't want to hard code the addrss, you can make a function like this:

    /*******************************************************************************
     * @fn          jumpToPrgEntry
     *
     * @brief       This function jumps the execution to program entry to execute
     *              application
     *
     * @param       prgEntry - address of application entry.
     *
     * @return      None.
     */
    void jumpToPrgEntry(uint32_t prgEntry)
    {
    #ifdef __IAR_SYSTEMS_ICC__
    
        prgEntry +=4;
        uint32_t *entry = (uint32_t *)&prgEntry;
        __asm volatile( "LDR R2, [%0]\n\t"    :: "r" (entry));
        asm(" LDR.W R2, [R2] ");
    
        // Reset the stack pointer,
        asm(" LDR SP, [R0, #0x0] ");
        asm(" BX R2 ");
    
    #elif defined(__TI_COMPILER_VERSION__)
    
        // Reset the stack pointer,
        prgEntry +=4;
        asm(" LDR SP, [R0, #0x0] ");
        ((void (*)(void))(*((uint32_t*)prgEntry)))();
    
    #endif
    }

  • Yes, It works only when the version is without RTOS.
    When I upload RTOS version it does NOT work!!!

    At your example I get an "HardFault exception" and the cpu goes to FaultISRHandler.
    Thats happens at the line:
    "
    asm(" LDR SP, [R0, #0x0] ");
    "

    Vitaly

  • Hi Vitaly,

    Did you program the device with both BIM and the empty project? Can you double-check that the empty project works with a debug session?

    Can you set a breakpoint and look at R0 when his happens?
  • Thanks, Marie H. it works.

    For anyone who will look into this thread:

    If you want two empty projects to run, you need the symbol __intvec_start__  to leave at 0x0 and move the symbol ROM_start__ to a different location.

    Also, you must move the bootloader page0 from the 0x0. Otherwise, you get the HardFault event.

    Another point that may someone may be interested. The location of the application is written in 0x4.

    The location of the application is read by this command:

    asm(" LDR.W R2, [R2] ");

    Vitaly