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.

Programming bootloader with LM Flash Programmer

I have customized the StellarisWare bootloader example for UART programming of our LM4F232H5BB mcu.  If I erase the device and enter the Debug mode of code composer studio to load the bootloader into the device, everything works fine (i.e. upon power cycle I am able to initiate programming of our main application through the UART via our bootloader).

However, if I load the bootloader into the blank device via LM Flash Programmer (either through the JTAG connection or through the ROM bootloader using the UART), I am unable to enter our bootloader at all.

If I go into the CCS debug mode (without loading the program), an inspection of the Memory Browser shows that my bootloader code has been offset in memory by 0x34 (i.e. Flash addresses 0x00000000 through 0x00000033 are filled with who knows what and my bootloader code starts at address 0x00000034).

Does anyone have any thoughts as to why this might be happening?

  • Ron,

    Can you give some more details about your set up.   

    Ron Dumas said:
    I have customized the StellarisWare bootloader example for UART programming of our LM4F232H5BB mcu.  If I erase the device and enter the Debug mode of code composer studio to load the bootloader into the device, everything works fine (i.e. upon power cycle I am able to initiate programming of our main application through the UART via our bootloader).

    Where does the bootloader code start? 0x0, or 0x34 also.

     

    Ron Dumas said:
    I However, if I load the bootloader into the blank device via LM Flash Programmer (either through the JTAG connection or through the ROM bootloader using the UART), I am unable to enter our bootloader at all.

    If I go into the CCS debug mode (without loading the program), an inspection of the Memory Browser shows that my bootloader code has been offset in memory by 0x34 (i.e. Flash addresses 0x00000000 through 0x00000033 are filled with who knows what and my bootloader code starts at address 0x00000034).

    Is the program offset set to 0x0 on the program tab for LM Flash programmer?  What are your settings on the Configuration and Program tab? 

    Ron Dumas said:
    Does anyone have any thoughts as to why this might be happening?

    Are you initializing the UART correctly?  CCS enables the UART when the debugger is launched.

    Lela

  • The bootloader code is supposed to start at 0x00.  The bl_startup.ccs.s file from the StellarisWare\boot_loader example code has not been changed

    I have modified the bl_link_ccs.cmd file from ...

    MEMORY

    {

         FLASH (RX) : origin = 0x00000000, length = 0x00010000

         SRAM (RWX) : origin = 0x20000000, length = 0x00010000

    }

    to

    MEMORY

    {

        FLASH (RX) : origin = 0x00000000, length = 0x00000800

        SRAM (RWX) : origin = 0x20000000, length = 0x00008000

    }

    The configuration/program tab settings are set to one of the following (both with the same results) to program the bootloader.out file ...

    1) Stellaris Development Board w/ Erase Entire Flash, Verify After Program, Reset MCU After Program and Program Address Offset 0x0

    2) Manual Configuration (UART, Disable Auto Baud Support NOT checked, COM Port:  COM6, Baud Rate:  57600, Transfer Size: 60) w/ Reset MCU After Program and a Program Address Offset of 0x0.

    The problem happens when I program the bootloader through the JTAG port as well.  And when I do program throught the UART instead of the JTAG, the device is blank so the ROM bootloader should be in control and no UART initialization should be necessary or even possible ...

    Also, can you tell me why the LM Flash Programmer is saying that it has programmed 29632 bytes when my bootloader is only setup to be 2K in FLASH?

    The data that is at address 0X00000000 is ...

    464C457F  00010101  00000000  00000000  00280002  00000001  200005F3  000070D8  00007118  05000000  00200034  00280002  00100011

    with the bootloader code picking up at address 0x00000034

    Here is the top of my bootloader.map file ... in case it helps at all ...

    ******************************************************************************

    TMS470 Linker PC v4.9.1

    ******************************************************************************

    >> Linked Wed Jan 18 09:39:36 2012

    OUTPUT FILE NAME: <BootLoader.out>

    ENTRY POINT SYMBOL: "_c_int00" address: 200005f3

    MEMORY CONFIGURATION

    name origin length used unused attr fill

    ---------------------- -------- --------- -------- -------- ---- --------

    FLASH 00000000 00000800 00000658 000001a8 R X

    SRAM 20000000 00008000 000007c0 00007840 RW X

    SEGMENT ALLOCATION MAP

    run origin load origin length init length attrs members

    ---------- ----------- ---------- ----------- ----- -------

    20000000 00000000 00000658 00000658 r-x

    20000000 00000000 00000044 00000044 r-- .intvecs

    20000044 00000044 00000610 00000610 r-x .text

    20000654 00000654 00000004 00000004 r-- .const

    20000658 20000658 00000168 00000000 rw-

    20000658 20000658 00000068 00000000 rw- .bss

    200006c0 200006c0 00000100 00000000 rw- .stack

    SECTION ALLOCATION MAP

    output attributes/

    section page origin length input sections

    -------- ---- ---------- ---------- ----------------

    .intvecs 0 00000000 00000044 RUN ADDR = 20000000

    00000000 00000044 bl_startup_ccs.obj (.intvecs)

    .text 0 00000044 00000610 RUN ADDR = 20000044

    00000044 000002c8 bl_main.obj (.text)

    0000030c 000000f0 bl_packet.obj (.text)

    000003fc 000000d8 bl_check.obj (.text)

    000004d4 00000098 bl_flash.obj (.text)

    0000056c 00000088 bl_startup_ccs.obj (.text)

    000005f4 00000060 bl_uart.obj (.text)

    .const 0 00000654 00000004 RUN ADDR = 20000654

    00000654 00000004 bl_packet.obj (.const)

    .data 0 00000658 00000000 UNINITIALIZEDRUN ADDR = 20000658

    .bss 0 20000658 00000068 UNINITIALIZED

    20000658 00000050 bl_main.obj (.bss:g_pulDataBuffer)

    200006a8 00000010 bl_main.obj (.bss)

    200006b8 00000008 bl_check.obj (.bss)

    .stack 0 200006c0 00000100 UNINITIALIZED

    200006c0 00000100 bl_startup_ccs.obj (.stack)

    Thanks

  • Ron,

    I am confused about your set up...

    Are you trying to create a flash resident bootloader that is a modified version of the one in stellarisware that handles firmware updates for application code to 0x800?

    Can you go to a known working setup and do the following:

    1.) erase the flash

    2.) use lm flash programmer to program hello.bin from stellarisware via uart.

    Does that work? 

    Lela

  • Hi Lela,

    Yes, I am creating a flash resident bootloader for updating my main application firmware that begins at address 0x800.  What I failed to do was add the the commands to my project's post-build steps to generate the .bin file.

    "${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"

    So I was just downloading the .out file with the LM Flash Programmer which is, apparently, not the right thing to do.  If I generate a .bin file and download it with the LM Flash Programmer, everything works exactly like it is supposed to.

    Thank you for your help.

    Ron