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.

TM4C1294 ROM Bootloader

Other Parts Discussed in Thread: TM4C1294NCPDT, MAX3232

I'm trying to load a device for the first time (never been programmed, board straight from the board house). I'm using LM Flash Programmer build 1613. The configuration is UART, COM1, 115200, Transfer size 60. I've tried both with and without autobaud support. The most progress I've seen is with autobaud support enabled. The status bar says Erasing... for a while, and then I receive two errors: Failed to send download command, followed by Failed to program/update the board. I'm using UART0 on the device. I've confirmed that the board is wired correctly by flashing another board through JTAG and communicating on the serial port with the flashed program.

The chip is being clocked by a 16 MHz crystal between OSC0 and OSC1. Is 115200 the correct baud rate to be using to communicate with the ROM boot loader? What am I missing? How can to load the board through the serial port after it comes in from the board house?

  • Suspect the ROM version, Tiva server uses TFTP port 69 from LM flash in the same way as software BL.

    You sound suspicious: Crystal frequency is made 25Mhz on Tiva 1294 launch pad . Lay odds ROM version is using auto baud rate configuration based on crystal frequency.
  • But I thought that's what the autobaud feature was supposed to handle. I've tried all baud rates between 115200 and 9600. None were successful.

    As another piece of information, I know my setup works. My firmware has an upgrade command that calls ROM_UpdateUART(), and that works if I disable autobaud support. But of course, the UART is already set up to the proper configuration before the call.

  • I always believed auto baud rate was from the client perspective not the server in most written IEEE standard.

    The server would some how automatically adjust Baudot timing after a few bytes were received back from the client.

    Data sheet does concur with supporting 5-25mHz select crystals shown near page 1842.

    BTW:

    Do you have Boot CFG register 68, reset default GPIO port H pin 7 pulled up to VDD as to enable the ROM boot loader?

     

  • Isn't the chip the server, and LM Flash the client? The chip should be detecting the incoming baud rate from the computer and adjusting accordingly. That appears to be how the example boot loader code provided by TI works. One would think that their own ROM boot loader would operate in much the same way.

    I don't yet have Boot CFG register set because this is a fresh chip that's never been programmed. My program does set the appropriate bits once it's flashed and run for the first time so that the boot loader can be forced in the event of an incident during a programming cycle. But I can't test that until I can get the chip programmed initially.
  • May this outside observer - w/little to offer this subject - note that BP indicated that PH_7 must be pulled up - for the ROM boot loader to function!  Such requires NO programming - and if his PH_7 guidance proves valid - you've not (yet) addressed that (quick/dirty) directive!

  • All input is welcome. Thanks for chiming in. Interestingly enough, there is no pin 7 on port H of this part (TM4C1294NCPDT). I was caught off guard by the same thing. When I asked the EE designing the board to used H7 for the button so that I could use the default BOOT CFG, I looked a little silly when he explained that there's no such pin. So the board will use H0 when we get it working.
  • Scott Kassan said:
    All input is welcome

    Such describes those (few) parties to which I'm (on occasion) invited.    My "gift/bribe" left just outside, entry door...

    Is your choice of PH_0 clearly documented - in your MCU manual - as "proper" for b/l activation/engagement?    I know the other poster (not) to have custom board - his knowledge thus likely confined to vendor's standard issue board.   (not yours)

    Should PH_0 prove proper - and you're driving it to spec - my idea bank reads, "empty."    Bon chance...

  • CB1 to smells a simple mistake at hand - chimes in like a hawk. ;)

    Seems an earlier clue missing necessary enable port H pin 7 is indeed the case. There fore LM Flash will never invoke the ROM boot loader when so commanded.

    Simple test might include first programming the BootCFG register to use GPIO port H pin 0 via JTAG port then try to use LM Flash once again.

    Unlikely a Baudot issue at all, BTW an intelligent client can and does automatically adjust his rate to match the host. The cling word auto adjust on the server side infers the Baudot divisor is adjusted to match the crystal and the default Baud rate always remains at 115200.

     

     

     

  • Quoting from the data sheet for the device (section 5.2.2.2, page 222):

    If the flash address 0x0000.0004 contains an erased word (value 0xFFFF.FFFF) or the EN bit is of the BOOTCFG register is clear, the stack pointer and reset vector pointer are loaded from ROM at address 0x0100.0000 and 0x0100.0004, respectively. The boot loader executes and configures the available boot slave interfaces and waits for an external memory to load its software.

    This is the behavior I'm trying to invoke. The GPIO pin only comes into play if the chip has been programmed and 0x0000.0004 does not contain 0xFFFF.FFFF. It will be used as an emergency recovery mechanism in the unfortunate event that an update is interrupted.

    The goal is to be able to program brand new boards using the serial port rather than JTAG. If I have to connect JTAG to program the BOOTCFG register, I may as well go ahead and program the whole device while the JTAG is connected.

  • "The GPIO pin only comes into play if the chip has been programmed and 0x0000.0004 does not contain 0xFFFF.FFFF".

    My take is the MPU reads register 68 after a POR, if pin H7 is High the Rom BL is invoked. Other wise RBL would be invoked after IPL when not desired for RBL invoke after POR.

    So pin H7 is High && location 0x0000.0004 is !Not 0xffff.ffff, inferring an IPL succeeded. RBL will not be invoked next POR negating the need to install a jumper to pull down pin H7 after IPL, initial program load. You save .50 cents on a jumper and gold plated pins and only add one 10k pull up resistor. Not to bad a trade off!

  • Review of RO-EN bit appears to be status bit read by internal logic, detects when ok to enable RBL. Other question at hand do you have RS232 PCAT 9 pin (DTE) pin TXD crossed to RXD UART0 GPIO port A0?

    Might I suggest to Invest in a nice 8 diopter magnification lamp, 1mm solder tip, .02" rosin solder wick. Install a fine diameter wire wrap type wire to a near by 10k resistor pull up over to port H7 input.

    BTW: Purchase a wire wrap tool mostly for stripping insulation in the razor wedge. Dikes often end up cutting micro fine wire. Got mine at Radio Shack some 20 years ago, dang getting old sucks.
  • I'm not using DTE, only RX and TX. But I'm sure the port hardware is capable of working correctly. It works when my code calls ROM_UpdateUART().

    It's rather difficult to wire anything to port H7 since the part I'm using only has H0:H3.

    My interpretation of the boot logic is as follows:

    if location 0x0000.0004 constains 0xFFFF.FFFF

    ROM Bootloader // This is the one I'm having trouble invoking

    else if BOOTCFG and GPIO in proper configuration

    ROM Bootloader

    else

    Boot from flash

  • "It's rather difficult to wire anything to port H7 since the part I'm using only has H0:H3."

    How is that possible when the TM4C1294NCPDT has over 128 pins?

    The PinMux tool will not show GPIO pins of register 68 since it is already programmed by default. Solder a wire to the pin H7 then MPU will invoke the RBL anytime the flash has been erased 0xffff.ffff.

    5.2.2015: Don't shoot the messenger for relaying incorrect datasheet information! We often don't have time to go check every aspect such as the TQFP package pin layout. This case it was assumed a custom chip had been made for what ever the reason. Later discovered the datasheet incorrectly claims defaults of register 68 assert pin H7 on a Truncated GPIO port H. Poster did not kindly relay that information.

    The LM Flash expects COM1-4 UART connections and windows USB virtual serial device driver iseemingly out of the question without first adding ICDI support via TM4C123 MPU. The TM4C1294 Launch Pad uses embedded code in TM4C123 to access the USB serial CDL driver and relays the serial Com port configuration parameters to the client such as LM Flash Tool.

  • "I'm not using DTE, only RX and TX." 

    Elaborates effectively to communicate the RBL configuration: Score = 3

    *Typical to Infer RS232-DB9 pin port of PCAT is DTE configured (data terminal equipment).

  • See your point H0-3 do apologize for not checking the TQFP 128 pin layout. Was expecting TI experts have already done that made corrections in Errata doc's or by updated DS.

    Page 670 data sheet shows Port H Pin 7 as reset default must be typo. Don't believe anyone has ever brought this issue up in past discussions of RBL. PinMux tool shows H0-3 as you stated but GPIO section shows full pin layout.

    Suspect may actually be GPIO D7 the NMI pin likely redirects directly pointer to RBL but that's only a guess on my part.
  • Page 1822 TQFP shows some interesting details about RBL and USB. RBL might just support Windows virtual serial CDL driver after all by redirecting UART0 RXD into virtual USB. Then LM Flash may infer selected UART Com1 as the serial USB virtual pipe.

    If that is your intent you will have to install the Windows device driver found in { TivaWare_C_Series-2.1.0.12573/windows_drivers/usb_dev_serial.inf}.

    Don't believe using the bulk driver for LM Flash since it suggests a serial Com port selection.

  • Seems the text states we must use a GPIO pin to invoke the RBL:

    At reset, the user has the opportunity to direct the core to execute the ROM Boot Loader or the application in Flash memory by using any GPIO signal from Ports A through H as configured by the bits in this register.

    "has the opportunity" infers a mandate in order to use RBL virtual CDL pipe into LM Flash on selected COM ports.

    Likely is port D7 NMI to invoke the RBL. What say CB1 chime into that NMI thing,

    BootCFG sequence :

    1. The BOOTCFG register is read. If the EN bit is clear, the ROM Boot Loader is executed.

    2. In the ROM Boot Loader, the status of the specified GPIO pin is compared with the specified polarity. If the status matches the specified polarity, the ROM is mapped to address 0x0000.0000 and execution continues out of the ROM Boot Loader.

    3. If the EN bit is set or the status doesn't match the specified GPIO port polarity, the data at address 0x0000.0004 is read, and if the data at this address is 0xFFFF.FFFF, the ROM is mapped to address 0x0000.0000 and execution continues out of the ROM Boot Loader.The status would be from SSIO or other retuned status.

    KEY:

    ** At POR the EN bit is cleared by setting it to 1, the reset default and therefore RBL reacts to GPIO pin.

    Boot GPIO Enable: EN=1

    Clearing this bit enables the use of a GPIO pin to enable the ROM Boot Loader at reset. When this bit is set, the contents of address 0x0000.0004 are checked to see if the Flash memory has been programmed. If the contents are not 0xFFFF.FFFF, the core executes out of Flash memory. If the Flash has not been programmed, the core executes out of ROM

  • Here's a short update on my progress:
    I've been disassembling and stepping through the ROM as the system first comes up. I've confirmed the following:
    - the ROM bootloader is invoked if the chip has not been flashed yet
    - the ROM bootloader is invoked if I press the button that pulls H0 high after BOOTCFG is modified for my board.

    I think the baud rate is being calculated incorrectly after the initial auto-baud pulse train. I see the following values being loaded into the baud rate registers: IBRD = 0x10, FBRD = 0x02. The system is correctly detecting that I have a 16 MHz crystal driving the system clock. The high-speed enable bit is clear. By my calculations, to achieve 115200 the baud rate registers should be IBRD = 0x08 and FBRD = 0x2C. It seems to be off my about a factor of two, but not exactly. If the HSE bit were set, the correct values would be IBRD = 0x11, FBRD = 0x17. I'm still looking for the actual baud rate calculation code to learn where it's going wrong.

    For anybody at TI that's listening in, the version of ROM I'm working with is 3.01.
  • That's good detective work - your (rare for here) update is very much appreciated.

    May we ask, "How you've confirmed that the ROM boot-loader was invoked?"     (we note such claim in 2 places - thus this fact should be detailed)

    Might you (more positively) confirm that the (system) is correctly detecting your external xtal's value - by switching to a different value xtal - and then noting, "if/how" that's accommodated?

    Many would benefit from your success in this effort.     My push for more, "support/verification for your findings" aims to better enlist vendor aid.

  • Good progress yet mystery has lingering Mary Drew artifacts in the mix.

    Earlier asked if your crystal manufacture is listed in acceptable vendor shown in datasheet.
    TI must have tested all those listed to be mostly error free to within so many OSCPS.

  • Hello Scott

    Before I check anything else, I would like to see the schematic for TM4C129 on the custom board to root out anything obvious.

    Regards
    Amit
  • Yes, the same part used on the Launchpad.
  • I confirmed that the bootloader is invoked by placing a breakpoint in bootloader code and hitting that when I run.

    I confirmed that the xtal value is being detected correctly by looking at the value in the debugger. There's a place where it looks at the value to see if Ethernet and/or USB booting is possible. Those are only possible if the xtal is 25 Mhz. So right before the compare, I look at the register that it's comparing, and the value was 16,000,000 (0x00F4.2400).

    My work this morning has yielded more results. I must have been incorrect about the baud rates. I found somebody with much younger eyes than mine to place some jumper wires on the MAX3232 so I could monitor the signals with a logic analyzer. Where are the test points when you need them?:) I saw the following traffic. The values of the commands are found in C:\ti/TivaWare_C_Series-2.1.0.12573/boot_loader/bl_commands.h.

    PC says 0x55 0x55 (autobaud pulse train)
    Tiva says ACK
    PC says PING
    Tiva says ACK
    PC says GET_STATUS
    Tiva says SUCCESS
    PC says DOWNLOAD address 0x0000.0000, count 0x0002.2560
    Dead silence.

    When I repeat the programming sequence in the scenario that does work (jumping to ROM_UpdateUART from my code), the Tiva responds with an ACK 293 ms after the DOWNLOAD command. So for some reason, the Tiva is failing to ACK the DOWNLOAD command. It also appears that the device is not even being erased. After a failed attempt, a power cycle results in my program running. I think the Tiva is supposed to start erasing the part after receiving the DOWNLOAD command. That's probably what takes 293 ms before the command is ACKed.
  • Amit,
    Thanks for joining the discussion. I'll check with the powers that be to see if that's possible. If so, I'd feel much better about sharing that information in a more private fashion. Is there some way to private message on the board?
  • Hello Scott,

    I think it is ETH#03 Errata that may be the cause. Please look at the WA mentioned and we can take the discussion from that point onwards.

    Regards
    Amit
  • Amit,
    Forgive me. I'm not familiar with the abbreviation WA. Could you please point me to the appropriate document. I tried Googling TM4C1294NCPDT Errata and found this link, but it is non-responsive: www.ti.com/.../getliterature.tsp;.

    For the benefit of others, after looking at my schematic, Amit suggested installing the resistor for RBIAS. That proved to be a daunting task, but he also suggested that as a quick-and-dirty test, the pin could be shorted to ground directly. That was a little easier, since an adjacent pin is ground. With assistance from my younger colleague with better eyesight and steadier hands, that test was performed. After going through a reset cycle to completely erase the flash, I was able to successfully program the chip directly through the serial port.

  • jumper wires on the MAX3232:
    Dude this is a DTE device on the custom board not a virtual CDL serial USB driver so why did you claim is was not otherwise?
  • That was not exactly the question being asked about the crystal manufacturer but it will do.
    Good to see you are bending to the help desk line of questions! :-)
    Amit is sure to answer why the data sheet shows GPIO H pin 7 as reset default BL invoke pin.
    Appears your wizardry debug steps proved GPIO H pin 0 indeed the winner in that all FF's jump to flash load bin file.
  • Hello BP101.

    ETH#03 was the cause of the issue. For some reason Scott's response did not come on the forum (though an email got generated)

    Regards
    Amit
  • Had Scott bothered to respond or check the data sheet pages #'s I earlier posted discussed what to do with unused TQFP 128 pins and RBL, well covered. Perhaps topic should overstate the RBias pin must have 4.87K ohm 1% resistor no mater if PHY is configured or not. Have to feel for Scott on that one since he was likely not even enabling the PHY peripheral.

    Head exploding is data sheet stating BootCFG register GPIO port H pin 7 reset clear 1 invokes RBL when EN bit is clear. PinMux tool showing only lower 4 bits of GPIO H is a rip off where did the upper nibble go? When bit/s are cleared = 1 some areas in data sheet show WCL = 1. Always assumed I had those upper nibble port H pins and feel cheated they are MIA, eye opening Stellaris never did that to me. :-)

    That WCL makes it very clear to understand what is stated in side bar text of each bit position matches the binary Boolean reset value. That may help to clarify what (is) exactly means in overview paragraph and helps to tie side bar text to the symbolic bit position table meaning.
  • Hello Scott,

    WA stands for Work Around :-)

    Regards
    Amit
  • Well deserved is to check the box Question Answered - raise the Flag in Amit's support remedy.