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.

How to run boot_serial, boot_demo1 and boot_demo2 together

Other Parts Discussed in Thread: LMFLASHPROGRAMMER

I am trying to learn bootloader basics, for beginning, I just want to run these three code samples.

So, I built all three code samples as is. Key points:

boot_demo1 and boot_demo2:

#define APP_BASE 0x00004000
#define RAM_BASE 0x20000000

boot_serial:

#define APP_START_ADDRESS       0x4000
#define UART_ENABLE_UPDATE

Then I execute "Debug boot_serial" command in CSS. I think that boot_serial design is loaded to the board, since previous design stops working. In CSS I have the following message:

CORTEX_M4_0: GEL Output:
Memory Map Initialization Complete
CORTEX_M4_0: AutoRun: Target not run as the symbol "main" is not defined

Now I execute "Debug boot_demo1" in CSS. LED1 starts to blink, as expected. When I press SW1, LED1 stops blinking, as described in the code sample documentation.

Now, I don't know how to continue. I want to load boot_demo2.bin and see that LED2 is blinking. Should I use LM Flash Programmer? What parameters to use?

If I disconnect the board from USB and connect it again, LED1 doesn't blink, boot_serial + boot_demo1 pair cannot start. So, I just need a simple description, how to make these three programs working.

My working environment:

Code Composer Studio Version: 6.1.3.00034
TivaWare_C_Series-2.1.3.156
Board: EK-TM4C129XL Rev D
Windows 10 x64

  • Hello Alex

    Once the LED stops blinking the boot loader is invoked. You can use the same steps as earlier to load the boot_demo2.bin at 0x4000

    Regards
    Amit
  • Thank you. What steps exactly? Should I burn boot_demo2 from CSS by using "Debug boot_demo2" command? No problems with this, but I think bootloader should allow to load design without CSS. Also, I wonder why the board stops working if I disconnect and connect it. Should bootloader load one of boot_demo1/2 programs? LED doesn't blink after reloading (power off-on).
  • Hello Alex,

    No. You have to use the LMFlashProgrammer to download the code using UART Serial Interface.,

    Regards
    Amit
  • I tried LMFlashProgrammer with UART interface , but it doesn't work:

    **ERROR**: Failed to establish communication with the board!
    To program using the serial port (UART), the board must be programmed
    with the serial flash loader or a properly configured bootloader.

    I think that bootloader is not working. So, the main question is: how to make bootloader working? This is what I have for now:
    1. I imported boot_serial to CSS, built it and loaded to the board using "Debug" command. CSS gives the following message:
    CORTEX_M4_0: GEL Output:
    Memory Map Initialization Complete
    CORTEX_M4_0: AutoRun: Target not run as the symbol "main" is not defined
    2. I imported boot_demo1 to CSS, built it, and loaded to the board using "Debug" command. LED1 is blinking, when SW1 pressed, LED1 stops blinking. So, boot_demo1 is OK.
    3. I disconnect the board from USB and connect it again. LED1 is not blinking.

    So, bootloader is not working, it doesn't load boot_demo1. How to fix this?
  • Hello Alex,

    Did you disable auto baud function? I would like to see what are the settings of the LMFlashProgrammer that you are using to download the boot loader and applications.

    Regards
    Amit
  • 1. Open boot_serial in CCS and download it to the board using Debug command (is this correct? Should I use LM Flash Programmer for this?)

    2. Open boot_demo1 in CCS and and download it to the board using Debug command. LED1 is blinking. When SW1 pressed, LED1 stops blinking.

    3. Open LM Flash Programmer. Parameters:
    Manual Configuration
    Interface: Setial (UART)
    Disable Auto Baud Support - checked (if unchecked, the same result)
    COM Port: COM6 (Stellaris Virtual Serial COM Port)
    Baud Rate: 115200
    Transfer Size: 60
    .bin file: boot_demo1\Debug\boot_demo1.bin
    Program Address Offset: 0 (BTW, is this correct?)

    Click Program. button Error:

    **ERROR**: Failed to establish communication with the board!

    To program using the serial port (UART), the board must be programmed
    with the serial flash loader or a properly configured bootloader.

    4. Power off/on the board. LED1 is not blinking. Why?
  • Hello Alex

    Alex Farber38 said:
    1. Open boot_serial in CCS and download it to the board using Debug command (is this correct? Should I use LM Flash Programmer for this?)

    If the device is erased, then you can download the binary for the boot_serial as well using the LMFlashProgrammer and Serial Port

    Alex Farber38 said:
    2. Open boot_demo1 in CCS and and download it to the board using Debug command. LED1 is blinking. When SW1 pressed, LED1 stops blinking.

    Once the boot serial is loaded, disable auto-baud and download the demo1 code

    Alex Farber38 said:
    Program Address Offset: 0 (BTW, is this correct?)

    Click Program. button Error:

    **ERROR**: Failed to establish communication with the board!

    It should be the offset as specified by the VECTOR ADDRESS. It should be 0x4000 for TM4C129x and 0x2800 for TM4C123x examples of TivaWare.

    Regards

    Amit

  • Thank you, got it working. The problem was in Erase Method Flash Programmer option. By default it is "Erase entire flash", so when I burn one program, I erase another program. I change it to "Erase necessary pages", and it started to work.
    In the beginning, I can burn boot loader and boot_demo1 using LM Flash Programmer JTAG interface, addresses 0 and 0x4000, Erase necessary pages. Then I reboot the device, LED is blinking. Press SW1, and not I can use LM Flash Programmer with UART interface, Auto Baud disabled, to burn boot_demo2.

    The same erase method should be selected in CCS project properties to burn the project from CCS.
  • Hello Alex,

    Can you please share a snap shot of the first 2 tabs of LMFlashProgrammer when selection boot_demo2.bin

    Regards
    Amit
  • Hello Alex

    Yes, it looks correct. Did you make any change to the original project?

    Also try the same with the bin files already provided in the project folders.

    Regards
    Amit