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.

Creating a bootloader for MSP430

Other Parts Discussed in Thread: MSP430F5328

Hi,


Could anyone help me to create the bootloader and  application for MSP430 using IAR workbench.

Is there any sample source code of bootloader and application for MSP430.

  • Hi,

    Here is the link -> Bootloader (BSL) for MSP low-power microcontrollers

    http://www.ti.com/tool/mspbsl

  • Hi,

    I am using MSP430F5328 and IAR workbench.

    First i am creating 2 workspace, 1 bootloader and another one Application.

    I divided the flash, assigned 4K for bootloader and remaining for application.


    but after running the bootloader code it's not jumping to application.

    is there any sample code for Bootloader and application.

  • neil johnson78695 said:

    is there any sample code for Bootloader and application.

    Maybe it helps:

    software-dl.ti.com/.../index_FDS.html

  • Hi All,


    I have created two separate projects, one for the boot loader and one for the application.

    Divided the flash size between the bootloader and application as below,

    Bootloader linker file:

    Application Linker File:

    I have written small bootloader code as below and jump to main application.

    int main( void )
    {    
        // Stop watchdog timer to prevent time out reset   
        WDT_A_hold(WDT_A_BASE);
        
        GPIO_setAsOutputPin(
                    GPIO_PORT_P6,
                    GPIO_PIN0
                    );          
        
            __delay_cycles(500000);
            GPIO_setOutputHighOnPin(GPIO_PORT_P6, GPIO_PIN0);         
            __delay_cycles(500000);
            GPIO_setOutputLowOnPin(GPIO_PORT_P6,GPIO_PIN0);
            
            asm("mov.w &0xFBFE,PC");
    }

    and IAR config for Bootloader.

    But couldn't able to jump to main application.

    Could anyone please help on this.

  • Hi Neil,

    Merging your related threads...

    Your files were not attached properly, can you please try again? What TI-provided resources are you using to support this effort? Your application seems very similar to MSPBoot (SLAA600). Please provide any debug efforts or screenshots displaying what you believe the issue can be related to.

    Regards,
    Ryan

  • Hi All,


    I have created two separate projects, one for the boot loader and one for the application.

    Divided the flash size between the bootloader and application as below,

    Bootloader linker file as below:

    // ---------------------------
    // Constant data
    //

    -Z(CONST)DATA16_C,DATA16_ID,TLS16_ID,DIFUNCT,CHECKSUM=4400-53FF

    // ---------------------------
    // Code
    //

    -Z(CODE)CSTART,ISR_CODE,CODE16=4400-53FF


    // -------------------------------------
    // All memory 0-FFFFF
    //

    // ---------------------------
    // Code
    //

    -P(CODE)CODE=4400-53FF

    // ---------------------------
    // Constant data
    //

    -Z(CONST)DATA20_C,DATA20_ID,CODE_ID=4400-53FF


    // -------------------------------------
    // Interrupt vectors
    //

    -Z(CODE)INTVEC=FF80-FFFF
    -Z(CODE)RESET=FFFE-FFFF

    Application Linker Fileas below:

    // ---------------------------
    // Constant data
    //

    -Z(CONST)DATA16_C,DATA16_ID,TLS16_ID,DIFUNCT,CHECKSUM=5400-FF7F

    // ---------------------------
    // Code
    //

    -Z(CODE)CSTART,ISR_CODE,CODE16=5400-FF7F


    // -------------------------------------
    // All memory 0-FFFFF
    //

    // ---------------------------
    // Code
    //

    -P(CODE)CODE=5400-FF7F,10000-243FF

    // ---------------------------
    // Constant data
    //

    -Z(CONST)DATA20_C,DATA20_ID,CODE_ID=5400-FF7F,10040-243FF


    // -------------------------------------
    // Interrupt vectors
    //

    -Z(CODE)INTVEC=FF80-FFFF
    -Z(CODE)RESET=FBFE-FFFF

    I have written small bootloader code as below and jump to main application.

    int main( void )
    {    
        // Stop watchdog timer to prevent time out reset   
        WDT_A_hold(WDT_A_BASE);
        
        GPIO_setAsOutputPin(
                    GPIO_PORT_P6,
                    GPIO_PIN0
                    );          
        
            __delay_cycles(500000);
            GPIO_setOutputHighOnPin(GPIO_PORT_P6, GPIO_PIN0);         
            __delay_cycles(500000);
            GPIO_setOutputLowOnPin(GPIO_PORT_P6,GPIO_PIN0);
            
            asm("mov.w &0xFBFE,PC");
    }

    0xFBFE is the reset vector of user Application.


    IAR Configuration:

    Under Debugger Section select linker file:

    Add the bootloader project (to the application project) with Project -> Options -> Debugger -> Images -> Download extra image

    check box "Debug info only" isn't checked.

    But couldn't able to jump to main application.

    Could you please check what mistake i am doing.

    Regards,

    Neil

  • Hi,
    I have solved the issue,
    I was adding the image file of Application in bootloader but need to add bootloader image file into Application.
    After running bootloader it is jumps to application program. :)

**Attention** This is a public forum