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.

Tiva TM4C123x ROM Bootloader

Other Parts Discussed in Thread: TM4C123GH6PGE, LMFLASHPROGRAMMER

This question is related to first time programingin a production environment.

ROM Bootloader question – when a virgin device is powered up for the first time, presumably the ROM Bootloader will run since memory locations are full of FF’s.  The ROM Bootloader has 4 possible sources, UART0, SSI0, I2C0 and USB. 

How does the Bootloader determine which hardware port to use ?

I could not find this answer anyplace.  Can you point me in the right direction ?

Thanks

Dave


  • Hi,

       See, the Tivaware Boot Loader User's Guide doc.

    -kel

  • D. Johnson said:
    How does the Bootloader determine which hardware port to use ?

    Perhaps bit more detail - placed right here - saves many from further search/effort...

    Indeed w/in the appropriate Bootloader User Guide the following should reveal:

    "There are a number of defines that are used to configure the operation of the boot loader."  (found w/in bl_config.h)

    ENABLE_UPDATE_CHECK
    FORCED_UPDATE_PERIPH
    FORCED_UPDATE_PORT
    FORCED_UPDATE_PIN
    FORCED_UPDATE_POLARITY
    FORCED_UPDATE_WPU or FORCED_UPDATE_WPD
    and then ID the soruce as: UART, SSI, I2C, CAN, even USB depending upon specific device...

    As you'll note - rather exhaustive command/control over boot-loader sourcing - is provided...  Detail alive/well w/in the specific User Guide...  Many of these "signal points" enable multi-port selection/flexibility.  However our LX4F (older) device enables only, U0_RX & U0_TX when the UART is selected as boot source... 

  • cb1_mobile, the question was "How does the Bootloader determine which hardware port to use" at FIRST power-on, so nothing to do with the defines you describe...

    Dave, the answer can be found in the ROM User Guide, page 12, section 2.3 USB Interface: " The USB update mechanism allows the boot loader to either be called from a functioning application or from startup when no firmware has been downloaded to the microcontroller."

  • There are two things to think about here - The actual PCB design (What port) and the ROM bootloader.  There is documentation for the ROM functions and documentation for the Boot Code that can be user modified.  Since we do not have the actual ROM code, it is impossible to guess as to which port the ROM bootloader is looking at for input.   USB requires some very specific clocking so I can't believe that USB is the default. I do not believe there is any external pin that will direct the port selection (of a blank device) so there must be a default.  Maybe it looks at all 4 choices until communication starts ?

    Need some input from the TI Team.

    Real issue - During production of a system we would like to use the bootloader to program the part for the first time, not JTAG.

  • @tibsci:  You are correct - missed that, "FIRST" power-on fact.  Resolution of this issue will be interesting although use of JTAG/SWD (even via, "bed of nails" connect) enables quick, eased solution & harvests other data of interest...

  • Bootloader will look at all supported interfaces until one of the interface receives a valid signal, it will then use that interface for the update.

    Once you configure LMFlash programmer to pick a specific interface, such as serial, it will send bootloader a pattern of data via UART, once bootloader detects that pattern, it will switch to use UART interface. Similar for USB, once you have USB device port connected to PC, bootloader can detect that connection and then switch to USB interface. 

    Does it answer your question?

    Angela  

  • Thanks.  That is the answer I was looking for.

  • Sorry for responding to an already answered and verified thread one week afterwards.

    I was very happy to find out (from the response of Angela) that: “Bootloader will look at all supported interfaces until one of the interface receives a valid signal, it will then use that interface for the update.”

    In order to clear a small question I had, I searched TI site for the document recommended by kel in the thread. I found SPMU301.pdf “TivaWare Boot Loader USER’S GUIDE, Version 1.0, dated April 11, 2013. After reading it, I was very disappointed.

    That Tiva boot loader “can be programmed at the beginning of flash”. What does it mean by program? Isn’t it the similar to load? What do you use to load this bootloader? Like the chicken and egg?

    After some more searching, I found another “TivaWare Boot Loader” in the ROM USER’S GUIDE. That seems to make more sense. Should I ignore TivaWare Boot Loader USER’S GUIDE?

  • @ OCY,

    You are not alone.  And - it is possible (even likely) that - via very fine detail - both guides are correct!

    Note that originating poster had a highly specific - and limiting quest - that of programming a, "virgin MCU, via the existing ROM Bootloader, after selecting & using only one of the supported serial ports."  This tightly defined requirement may be outside your expressed needs...

    One bootloader (the ROM one) "pre-exists" in the MCU's ROM.  The other can be programmed - and added to your device - should your MCU not contain the ROM bootloader or in the case when you seek to add bootload behavior and/or features...

    The "verified" answer appears to me to be just, "pencil verified."  Others/myself would much prefer, "real-world" confirmation/verification - after multiple ports (on virgin MCUs) were, "challenged and found to properly & repeatedly accept" such bootloads...  Note too that the "answer" described only UART & USB as ROM bootload inputs - are not others available, too?

    I have (presently unanswered concerns) that the presence of "other" signals and levels upon the "non-selected" serial "bootload candidate pins" (as may normally appear on a completed MCU based board) - may in some way disturb or reduce the robustness of such, "automatic, boot-load port detection," and may be subject to further (and restricted) "special handling advice/guidelines..." 

  • Please be aware, we have two versions of boot loaders, ROM-based boot loaders and Flash-based boot loaders. Most Tiva devices has bootloaders in ROM, so no need to use flash-based boot loaders unless the bootloader itself needs to customized to add specific feature which isn't available in ROM-based bootloader. Some earlier Stellaris devices don't have bootloaders in ROM, so flash-based boot loaders can be used on those devices.

    As for User's Guide, TivaWare Boot Loader User's Guide is a guide for Flash-based boot loaders, yes, you can ignore this document if you are not planning to use flash-based boot loaders. As you have found out, ROM User's Guide is the document which describes ROM-base boot loaders.

  • If code is executing from FLASH..at some point we need to pass control to ROM and execute its code written.

    how to download code to ROM?

    Generally we write the code FLASH from LM flash programmer.

    Also, how to swith the program control from FLASH to ROM?

  • You cannot change the code in ROM. If you need to customize the bootloader, you will need to use flashed base boot loader.

    To pass control to ROM, the corresponding ROM API should be called. such as ROM USB boot loader, ROM_UpdateUSB(), or ROM UART boot loader, ROM_UpdateUART. There are some steps necessary before jumping to ROM bootloader, please see example code in boot_demo_usb and boot_demo_uart for more details.

    Angela

  • How to load code into ROM? is there any tool or software to debug or program or read data from ROM memory of TM 4C123GH6PGE? we want to load bootloader into ROM.

  • please any1 reply on how to load the (bootloader) code into ROM memory of TM4C123GH6PGE? Any tool is there?

     

  • ROM memory can NOT be erased or written, that means bootloader in ROM cannot be changed or erased, so it is always there in the ROM space(0x01000000).

    Please refer to ROM User's Guide for any information on how to use the ROM bootloader.

    Hope it helps

    Thanks,

    Angela

  • We are using flashed base boot loader for our project and customized as per our requirement. But after power On does ROM based bootloader will execute and then ROM based bootloader will execute flash based bootloader? If yes then whether i can avoid execution of ROM based bootloader.

    Shridhar Kulkarni

  • It is good to here that Bootloader will automatically search the interfaces for update when flash is empty.

    But while I am trying it without using LMFlash programmer by writing my own code to send the firmware through UART it is unable to respond.

    Problem is when I am sending packet "03 20 20" " command_ping " it is not returning any acknowledgment and the returned value is NULL

    can u help me, before sending any commands what can i make microcontroller to respond for update through uart

  • Hello,

    I'm working with Tiva TM4C129x, but likely the ROM bootloader is the same as TM4C123x.
    I've understood that ROM bootloader looks at all supported interfaces (UART0, SSI0, I2C0, USB0), I wonder how all the involved pins behave during that phase.

    As I would like to use them as GPIO/other functions in my application, I need to know how they are used by ROM bootloader(that is the feature we are going to use for updating). In particular I would like to know, for each, if it is configured as input, output (which default level) or high impedance.

    Probably some of the following pins is not really configured by ROM bootloader as I suppose that all interfaces are used at minimum mode (UART only Rx,Tx, SPI not QUAD/BI speed and so on).

    Please can you provide me some info in order to be able to fill following table?

    Input Output High impedance
        Low High  
    PA0 U0RX x
    PA1 U0TX
    PB2 I2C0SCL
    PB3 I2C0SDA
    PA2 SSSI0CLK
    PA3 SSI0FSS
    PA4 SSI0DAT0
    PA5 SSI0DAT1 x
    PA6 SSI0XDAT2, USB0EPEN
    PA7 SSI0XDAT3, USB0PFLT, USB0EPEN
    PB2 USB0STP
    PB3 USB0CLK
    PD6 USB0EPEN
    PD7 USB0PFLT
    PL0 USB0D0
    PL1 USB0D1
    PL2 USB0D2
    PL3 USB0D3
    PL4 USB0D4
    PL5 UDBD5
    PL6 USB0DP
    PL7 USB0DM
    PP3 USB0DIR
    PP4 USB0D7
    PP5 USB0D6

    Regards Lorenzo.

  • Hi Lorenzo,

    First of all, ROM boot loader of TM4C129x has all the API's of TM4C123x.

    All pins are by default configured as Input, you have to write 1 to make it as output.

    You can change the any gpio state except locked pins( PA[1:0], PA[5:2], PB[3:2], PC[3:0] , PD[7] and  PF[0] ).

    ROM boot loader also does the same as TIVA api's there is no much difference and refer the attached link for complete info on pins(Topic 10. GPIO).Data Sheet

    Regards
    Sravan

  • Hi Sravan,

    thanks. I've found Table 10-5. GPIO Pins With Special Considerations and also read "Considerations When Using the UART Boot Loader in ROM" in 8.2.2.1 from your link (TM4C123x datasheet). It says "U0Tx is not driven by the ROM boot loader until the auto-bauding process has completed" that makes things clear for Uart interface.

    So, could you confirm that I2C0SDA and SSI0DAT0 behave as U0Tx? Are they not driven until first transition of respectively I2C0SCL and SSI0CLK occurs? If true, I could use them as input during normal application and even avoid to disconnect them from the other circuitry when in rom booloader execution (as I'll use only Uart0 interface for updating).

    What about USB0 signals? Are they all tri-stated untill usb interaction?

    Regards.
    Lorenzo.
  • Hello Lorenzo,

    I2C and SSI have slave function and will respond only when addressed or transacted by the master. As for USB, the device shall present itself when interrogated by a host as a device capable of DFU.

    Regards
    Amit
  • Amit, Hi!

    Is it possible to download a firmware into the "clear" (from the pallete) device with LMFlashProgrammer thru Ethernet interface? Which MAC and IP have I to use in this case?
  • Hello Vyacheslav,

    No. A MAC address must be available in the TM4C device in User Reg0-1. The IP address is then requested by the ROM Ethernet Boot Loader. This IP address has to be then looked up on the DHCP server to be able to communicate.

    Regards
    Amit
  • Hello Sravan. Did you get the solution for this question? I'm also looking for a solution for the same. On what UART pins should i send the commands so that i can get a reply and how manually can i program my TM4C1294 with just 2 UART pins and custom code? Can you help me?
  • Hi Nishit,

    We need to know only Baud rate to communicate, I referred LM flasher document (even source) and found that they are sending some pattern 0xAAAAAAAA or 0x55555555 to get the baud rate.

    when you send that pattern you will get some data I don't remember exact data, but we can get to know baud rate easily from it.

    Then you open the com port with this baudrate and you will be able to flash.

    Refer this from the following thread:

    Regards

    Sravan