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.

Boot Loader

Other Parts Discussed in Thread: TM4C1237D5PZ, TM4C123GH6PGE, LMFLASHPROGRAMMER

I am trying to make an evaluation board using TM4C1237D5PZ. I am having the chip : TM4C1237D5PZ. I am using another Tiva C series launch pad to download the code into TM4C1237D5PZ. I have one USB port connected with TM4C1237D5PZ in my designed board. 

My 1st question :  Can I download the code to TM4C1237D5PZ using this USB port? 

I think for this I need to send bootloader to TM4C1237D5PZ.

My 2nd question :  How to download the bootloader to TM4C1237D5PZ?

I have "TivaWare_C_Series-2.1.3.156" where I can see there is a folder boot_loader which has lots of .c and .s file. From these files how can I get the boot_usb.bin file to upload? What are the tools / software required to upload?

Thank you

  • Hello Amria,

    1. Yes, you can download the code to TM4C123 device using USB port. Please refer the USB_Boot example code for TM4C123 DK board in Tiveware.

    C:\ti\TivaWare_C_Series-2.1.2.111\examples\boards\dk-tm4c123g\boot_usb

    2. You have to use JTAG to program the boardloader into the flash. TI provides a tool called LM Flash Programmer for downloading the bin file into the MCU flash. 

     

    Regards,

    QJ

  • Thank you QJ for your reply.

    Now I have downloaded the boot_usb.bin into the TI microcontroller using LM Flash Programmer.

    But after that how do I program the TI using USB? I tried LM Flash Programmer to see throuhgh interface USB DFU, but nothing is appearing.

    And also I have checked the Device manager, no new device is appearing there too.

    So how should I access the TI using USB

    Thanking you

  • Also, I am having TivaWare_C_Series-2.1.3.156, will it work?
    I am unable to find TivaWare_C_Series-2.1.2.111 in ti.com
  • Finally I got "TivaWare_C_Series-2.1.2.111" from an external source.
    TivaWare_C_Series-2.1.2.111\examples\boards\dk-tm4c123g\boot_usb : i check this from CCS studio properties and found variant: TM4C123GH6PGE. I tried to rebuild the project and it built successfully;

    But when I change it to TM4C1237D5PZ then on building it is giving the following error:

    [E0001] Address must be of a non-global defined in the current section bl_startup_ccs.s /boot_usb/boot_loader line 646 C/C++ Problem

    So please let me know how can I change it to my micro i.e. "TM4C1237D5PZ " and generate .bin file

    thanking you
  • Hello Amrita,

    First of all check the Pin Map between the two devices.... Is it the same for USB? Also if possible share the compilation log on the forum.

    Regards
    Amit
  • Hello How can I check the pin map of the device?

    What are the parameters I need to change in bl_config.h.

  • Hello Amrita

    Check the section on USB port and pin mapping in the bl_config.h Then compare it to the pins for USB as specified in the datasheet

    Regards
    Amit
  • hello,
    actually when i inserted the chip it was identifying the usb, In LM flash programmer it was identified as DFU device;
    but unfortunetely i downloaded a .bin file into it and the boot loader vanished.
    can i get back it, or is there any such file which was preloaded into it and can i download it?
  • Hello Amrita,

    You need to erase the flash via JTAG,

    Regards
    Amit
  • Okay got it;
    Could you please tell me how to download the application codes on the TI, so that boot loader does not get erased;
    means how to set the starting address (in lm flash programmer utility) while downloading the application code like - blinky.
  • Hello Amrita

    The boot loader you are seeing when a blank device is used is called the ROM boot loader and it does not get erased. It is invoked under the conditions

    (a) When the flash locations 0x0 and 0x4 are erased
    (b) When the application in flash does an explicit call

    A simple example like blinky cannot call the ROM based boot loader. There are specific steps required

    1. Either use the BOOTCFG registers to call the ROM based boot loader when a GPIO is held in a particular state and the Reset is deasserted
    2. Initialize the USB pins and peripheral and call the ROM based boot loader

    The second method is shown in the boot_usb example under DK-TM4C123G. I would suggest referring to it.

    Regards,
    Amit Ashara
  • Bootloader (boot_usb.bin) file is downloaded using jtag flash utility but after that when i download the blinky.bin the earlier bin is getting deleted and then the usb can not recognize the microcontroller any more.


  • Hello Amrita,

    Please read the documentation for the example. The boot_usb requires that the application be placed at an offset. To do so you need to recompile the blink example with the correct start address and then use the LMFlashProgrammer.

    Again: please read the documentation in TivaWare for the boot_usb and boot_demo1/2 application examples.

    Regards
    Amit
  • there is no documenteation under that folder
  • Hello Amrita

    Every example has a readme.txt. Besides that in the path where you installed TivaWare, there is docs folder which has the boot loader user guide.

    Regards
    Amit Ashara
  • Sorry I am not able to get it.
    But, I found something
    #define APP_START_ADDRESS 0x2800 , meaning the application should start from address 0x2800, so in case of blinky example where should I change this value ? or can I do it from flash utility directly by setting the offset in flash utility?
  • Hello Amrita,

    The blinky example is compiled from a start address of 0x0. So all code references would be w.r.t start of application at 0x0. By just adjusting the start address of 0x2800 in the flash utility how would it be logically possible for the code to execute correctly!!!!

    You must recompile the blinky example with the correct start address in the linker command file.

    Regards
    Amit
  • Yes, I am checking in <name>.cmd file only; there I am seeing

    MEMORY
    {
    FLASH (RX) : origin = 0x00000000, length = 0x00010000
    SRAM (RWX) : origin = 0x20000000, length = 0x00006000
    }

    So do you mean it should be changed to

    MEMORY
    {
    FLASH (RX) : origin = 0x00002800, length = 0x00010000
    SRAM (RWX) : origin = 0x20000000, length = 0x00006000
    }
  • Hello Amrita,

    Almost correct, except for the length section

    MEMORY
    {
    FLASH (RX) : origin = 0x00002800, length = 0x0000D800
    SRAM (RWX) : origin = 0x20000000, length = 0x00006000
    }

    Regards
    Amit
  • What I am doing I am writing step by step

    1. Downloading the boot_usb.bin file using LM Flash programmer  (Erase entire flash; program address offset 0x0

    2. Then the USB - DFU option getting activated

    2. Then I am creating my application and changing the tm4c1237d5pz.cmd with your options:

    MEMORY
    {
        FLASH (RX) : origin = 0x00002800, length = 0x0000D800
        SRAM (RWX) : origin = 0x20000000, length = 0x00006000
    }


    SECTIONS
    {
        .intvecs:   > 0x00002800
        .text   :   > FLASH
        .const  :   > FLASH
        .cinit  :   > FLASH
        .pinit  :   > FLASH
        .init_array : > FLASH

        .vtable :   > 0x20000000
        .data   :   > SRAM
        .bss    :   > SRAM
        .sysmem :   > SRAM
        .stack  :   > SRAM
    }

    __STACK_TOP = __stack + 512;


    3. Building the application and getting the .bin file inside the release folder

    4. Now again using the LM Flash programmer downloading the .bin file (of application)
    USB DFU option
    program address offset 0x2800

    5. Once I do this the application starts running but the USB-DFU option getting vanished. How can I get rid of this????
    This is the only problem I am facing

    6. Then again using JTAG I need to download the boot_usb.bin file to get access of USB-DFU.




  • Hello Amrita

    To be able to get back the USB DFU, you would need to configure the USB DP and DM IO and call the boot loader. If you call the boot loader unconditionally, then the application will never run enough for you to observe it. Have a look at the boot_demo examples to see how to call the USB boot loader

    Regards
    Amit
  • Yes, I am able to get back the USB DFU using  "JumpToBootLoader()".
    But as you have written i am doing it unconditionnaly and the application not running continuously.

    I need to put a condition such as when some GPIO is high then it will stop the application and will go back to boot loader part. Am I correct?






  • Hello Amrita,

    Yes. You can put that as the while condition where you blink the LED. As long as the GPIO is low, then blink. If the GPIO is high then break out of the loop and call the boot loader.

    Regards
    Amit