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.

Re:Bootloader for LM4F232 kit

Other Parts Discussed in Thread: LM3S8962

Hi,

I am using LM4F232 evk and LM Flash programmer.

I tried the steps given in the below links to set up the serial bootloader to work but was not successful, getting error when tried to load code via serial

port 'Failed to establish communication with the board ', so please help to get the appropriate steps

http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/242473.aspx

http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/85249.aspx

Best Regards,

Santosh.

  • Santosh,

    The examples posted are for the LM3S bootloader. The LM4F boot_serial in the LM4F232 library expects the the boot_demo programs to be at location 0x2800 instead of 0x1000. The boot_demo1 readme.txt has a good explanation of why it is that location and how to change it if desired.

    I followed the directions in your first linked post, except I replaced 0x1000 with 0x2800 and it worked for me.

  • Hi Santosh,   

       Just to add.

       At LM Flash Programmer, make sure that your COM port is set for your LM4F232 Dev Kit when you load the boot demo example. You can check at the Device Manager for the appropriate COM#.

       Here below is another step-by-step instruction on using the Serial Bootlader by TI Sue. Set the program offset to 0x2800.

    http://e2e.ti.com/support/microcontrollers/stellaris_arm/f/471/t/85249.aspx

    -kel

      

  • Hi Markel & John,

    Thanks for your suggestions.

    Now I am able to load code over UART successfully but after loading blinky.c and reseting the MCU nothing works so need to add something in code??

    Best Regards,

    Santosh.

  • Hi Santosh,

    At this point, most probably you are unable to communicate with your board. So, erase the flash using LM Flash Programmer.

    You need to change the blinky linker script, for the blinky program to execute at address 0x2800. If you are using Keil Uvision the linker script file is "blinky.sct". To modify it, go to Project -> Options for Target "blinky", at linker tab, edit blinky.sct. Modify the file as below. Build the project after modifying the .sct file.

    LR_IROM 0x00002800 0x00040000
    {
    ;
    ; Specify the Execution Address of the code and the size.
    ;
    ER_IROM 0x00002800 0x00040000
    {
    *.o (RESET, +First)
    * (InRoot$$Sections, +RO)
    }

    ;
    ; Specify the Execution Address of the data area.
    ;
    RW_IRAM 0x20000000 0x00008000
    {
    ;
    ; Uncomment the following line in order to use IntRegister().
    ;
    ;* (vtable, +First)
    * (+RW, +ZI)
    }
    }

    Then follow these steps below using LM Flash Programmer:

    1. Load boot_serial using ICDI interface (Setting: Erase Entire Flash, Program Address Offset 0x0)
    2. Load blinky using Uart (Setting: Disable Auto Baud Support, Baud Rate - 115200, Reset MCU After Program, Program Address Offset 0x2800)

    Linker scripts for each tool chain from SW-BOOTLDR-UG-xxxx.pdf:

    xxxx.ld (Code Red Technologies tools, GNU GCC, and CodeSourcery Sourcery G++)
    xxxx.sct (Keil RV-MDK)
    xxxx.xcl (IAR Embedded Workbench)
    xxxx.cmd (TI Code Composer Studio)

    -kel

    Click Verify Answer if this answers/solves your problem.

  • Hi Markel,

    Now it is working.

    Now I want to try the same for my target board, so the concern is for every time before using serial port for programming should I load bin_serial.bin via ICDI?

    I am not able to re-program via serial port after programming once the device. Does anything required to be changed in startup.ccs file?

    Best Regards,

    Santosh.

     

     

  • Santosh,

    It's not the startup.ccs file that needs to be changed. Your application needs to be able to jump back into the bootloader in order to reprogram the board after your application has started executing. The boot_demo1 has code of how to do this. Use the SetupForUART() function to do the serial setup and then use the JumpToBootLoader() to enter the bootloader.

    I did a quick proof of concept modification of blinky where I used the up button on the EK to send the application into the bootloader. If you modify blinky, make sure to call SysCtlClockSet() and run the part from the PLL. It didn't work for me until I set the clocking.

  • Santosh,

    Santosh PG said:
    Now I want to try the same for my target board, so the concern is for every time before using serial port for programming should I load bin_serial.bin via ICDI?

    You only need to load the boot_serial.bin once.

    Santosh PG said:
    I am not able to re-program via serial port after programming once the device. Does anything required to be changed in startup.ccs file?

    Refer to TI John's reply.

    Much better to just use the boot_demo1 or boot_demo2 as base for your application. 

    -kel

  • Hi Markel/John,

    Please send me refernce code if you have implemented with boot_demo1 and blinky (or any other application with boot_demo1), which will help to refer.

    Best Regards,

    Santosh.

  • Santosh,

    As Markel suggested, the boot_demo1 example is a sufficient reference for code for entering the bootloader (just disregard all the graphics code for the display). I leave the choice of when to enter the bootloader up to you and your application.

  • Hi John/Markel,

    Appreciate your support I am able to do it now.

    My next job is to copy the firmware from external flash(SPI Flash) and write to the internal flash erasing old firmware.

    So I need to execute the instruction in RAM for copying and writing into flash so can you let me guide over the steps.

    Best Regards,

    Santosh.

  • Santosh,

    Could you more fully explain your system, what it is intended to be used for, and why you switched firmware update methods from LMFLASH serial bootloader to SPI flash?

    Everyone can help you better if they know how the questions you ask relate to the overall problem you are trying to solve.

  • Hi John,

    Ok..

    Initially used LM flash programmer to test the bootloader functionality the actual job is to inetrface serial flash to MCU and

    copy the firmware from the serial flash to MCU by erasing the existing firmware. similar to firmware upgrade.

    Best Regards,

    Santoh.

  • Santosh,

       First problem solved, since you have already made the UART bootlader work. Lets say this thread is already closed because of that. 

       Second problem, need to make SSI bootloader work. Start by reading through the Bootloader Guide and other necessary documents and codes, to understand "how to do that". Then, just post a new thread if you encounter any problems implementing SSI bootloader.

    -kel

  • Hi,

    I have a similar problem with boot_eth, using the lm3s8962.

    I would like to read boot_demo1-readme.txt but i don't have such file. Is there a link where I could download the text or explanation?

    Jules

  • Markel Robregado said:
    First problem solved... Lets say this thread is already closed...

    @KEL- Great to see your sense of organization/efficiency on display!  Our group reacted same way - and surely poster's path will twist/turn - (likely w/out limit) unless some "gentle" rudder employed.

    Would be even better if vendor staff could, "rise above over-arching PC" - and enforce some rules - to steer this forum resource away from, "wasteland."

    Irks many that such effort - back/forth extended - while poster's "real mission" sat unmentioned/unattended...

  • Hi Markel,

    I am using XDS100v2 and loaded boot_serial from CCS5v2 to my proto board and using LM4F232H5QC, after loading

    I am just reseting MCU and trying to load bliny.bin through serial port using LM Flash programmer but getting error.

    But when I used ICDI to load boot_serial from LM flash programmer and than blinky.bin it is getting loaded.

    So any configuration changes required for XDS100v2 while loading from CCS5v2.

    Best Regards,

    Santosh.

  • Hi Markel/John,

    We are not using external crystal on the board so in boot-config.h of boot_serial code what should be frequency value instead of 16000000??

    #define CRYSTAL_FREQ            16000000

    Best Regards,

    Santosh.

  • Jules,

    The boot_demo1 readme for the 8962 will be in the boot_demo1 folder. If it has somehow been deleted, reinstall StellarisWare. If you are using boot_serial on your 8962, your application should start at 0x1000, since boot_serial was changed for the LM4F232 board.

    Santosh,

    Using boot_serial to do firmware updates from SPI flash will not be as simple as just reconfiguring it for SPI. See Eric's post in this thread for an explanation.

    For this reason, as the other posters have commented, a request for help in solving this new problem would best be served by starting a new thread.

  • Hi John,

    Thanks for the reply, if you see my recent query it is related to serial boot loader(UART).

    I have XDS100v2 and the proto board with LM4F232H5QC without external crystal(16MHz) so does the same code(boot_serial) works?

    If you see the config.h in boot_serial code it has preprocessor statement , 

    #define CRYSTAL_FREQ            16000000

    what should be frequency value instead of 16000000 if external crystal 16MHz is not used as used in LM4F232 kit??

    Eventhough from the datasheet it is understood MCU has internal 16MHz oscillator it is not clear it is internal or external crystal refers.

     

    Best Regards,

    Santosh.

     

  • Santosh,

    If you aren't using a crystal, just comment that #define out.

    The XDS100v2 does not support serial UART on its cables or board, though the FT2232 chip is capable of it.