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 4C129 BOOTCFG issues

Other Parts Discussed in Thread: TM4C1294NCPDT, LMFLASHPROGRAMMER, UNIFLASH, EK-TM4C1294XL, TM4C129XNCZAD

Greetings,

I have searched the forums and found similar posts but none of them addressed my issue so I'm posting yet another one here.

Using Tiva C TM4C1294NCPDT on Launchpad TM4C1294XL, am  unable to repeatedly program BOOTCFG register or trigger a boot using a pin.   I managed to program the bootcfg once, but am not sure how because I cannot reprogram it.

Goal is to drive GPIO PB4 low as boot trigger, reset and then bootload on the Uart 0 port.

* Using default key 0xA442 per the data sheet for BOOTCFG.

* Want to bootload using PB4 grounded when reset occurs.
* Setting all reserved bits high in register writes.
* BOOTCFG currently reported by ccs to be 0x7FFF30FE but can't be changed!

Using code composer studio and can therefore view the contents of the flash registers while stepping thru the code.

* Per data sheet, FLASHCTRL_BASE = 0x400FD000
FMA_OFFSET = 0x000
FMD_OFFSET = 0x004
FMC_OFFSET = 0x008
BOOTCFG_OFFSET = 0x01D0

=================================================================
SEQUENCE - please verify this is correct for writing to BOOTCFG
=================================================================

// ===================================================
// 1. Write BOOTCFG offset to FMA register 0x400FD000
// FMA: D31-D20 RESERVED, D19-D0 OFFSET
// ===================================================
*((volatile uint32_t *)(0x400FD000)) = (uint32_t)0xFFF001D0;   // this 

// =================================================
// 2 . Write bootcfg data to FMD register 0x400FD004.
// D31-D0 DATA
// =================================================
//*((volatile uint32_t *)(0x400FD004)) = (uint32_t)0x7FFF30FE;
*((volatile uint32_t *)(0x400FD004)) = (uint32_t)0x7FFFFFFE;

//=======================================================================
// 3. Write FMC register 0x400FD008
// D31-D16 WRKEY, D15-D4 reserved, D3 COMT, D2 MERASE, D1 ERASE, D0 WRITE
//=======================================================================
*((volatile uint32_t *)(0x400FD008)) = (uint32_t)0xA442FFF0; // tried setting write and commit here also
*((volatile uint32_t *)(0x400FD008)) |= (uint32_t)0x1; // set WRITE
*((volatile uint32_t *)(0x400FD008)) |= (uint32_t)0x8; // set COMMIT


========
details
========

Using CCS, registers FMA and FMD can be seen to change when written to.

FMC never changes and stays all zeros in the ccs register window.
when FMC is written to, register FLASH_FCRIS is seen to change to a value of 3

Currently BOOTCFG is set to 0x7FFF30FE which means a low on PB4 during reset
should force the ROM bootloader to execute. It does not do so but my code which
flashes LEDs does not run either. Seems to go into the weeds. The bootloader
download command sent from a windows side program to Tiva Uart 0 receives no reply.
If I call the ROM bootload function in my code on the target, the windows side download command
works fine (using Uart 0 on Tiva) and reflash works.

When I attempt the pin triggered bootload, I ground PB4 then power up the launchpad
then push launchpad reset button then start the windows application.

What am I doing incorrectly?

Thanks

Randall Miner (randall_miner@jabil.com)

  • Hello Randall,

    First of the all the BOOTCFG register bit-31 is 0. This bit is called the NW bit and when it is 0, then the BOOTCFG register cannot be recommitted. To be able to change it you would need to run the JTAG Unlcok Sequence, but that would erase all the information like Flash and other committed registers.

    As for the second issue of the PB4 not being able to run the boot loader, if you connect the CCS debugger w/o downloading the code then does it show that the PC of the Cortex M4 CPU is in 0x010x.xxxx address space. if yes then the ROM Boot Loaders have been invoked. At this point then check the configuration of UART0 registers. If you could let us know the value then we can check what is not working.
    Also can you send a snapshot of the LMFlashProgrammer configuration and program tab for the non-working case.

    Regards
    Amit
  • Thanks so much Amit for the quick reply.

    I see that I misread the description of the NW bit. As you stated, I should have set it to a one. Will have to investigate the JTAG unlock sequence, its ok if the flash gets erased completely.

    In reply to your second paragraph, I will have to see how to connect ccs without downloading but that's an exellent idea to look at the program counter to see if its in ROM vs. Flash, didn't think of that. Will try it.

    Unfortunately, LM Flash Programmer won't install on my PC, its a DLL issue I think. I do have uniflash installed.
  • Can I hold the reset switch on the launchpad then power it up to put flash registers back to factory default? I'm seeing a sequence on page 213 of the data sheet 4.3.4.3 Recovering a "Locked" Microcontroller which I don't completely understand the steps of but it looked like that might work.
  • Hello Randall,

    The unlock sequence requires the Stellaris ICDI to be used to be able to run the JTAG-SWD switch sequence along with the Power Up and Hold Reset method (which is the start for the sequence). If this is a custom board and you have a TM4C123 LaunchPad Handy, then you can blue wire handy then the following post can show you how.

    e2e.ti.com/.../1512680

    Similar approach if you have a TM4C129 Connected LaunchPad.

    UNIFlash can work with Stellaris ICDI so that should not be a problem.

    Regards
    Amit
  • yes I just discovered that functionality in uniflash, thank!!!

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Amit,  one other question.  In ccs, I never saw FMC change in the debugger when I wrote to it.  Is that normal?

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randall,

    Yes. The FMC register works as both Control and Status. The read of the register will show status.

    Regards
    Amit
  • So do you have any idea why ccs continued to display FMC = 0x00000000 after I wrote to it?

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randall,

    As per the data sheet: The bits for the WRKEY is WO and read will return 0. If the operation requested by use of the lower 4 bits is not complete only then shall they read 1. If the operation gets completed then they will also be read as 0.

    Regards
    Amit
  • sorry Amit, I'm not sure why I thought they were Read/Write.  That explains it..

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randall

    However one of the original issue of the PB4 low to invoke the boot loader, but not being able to update the image is still open.

    Could you send the requested data?

    Regards
    Amit
  • thanks for asking Amit.

    As soon as I can, I will do that.  My team is in the process of upgrading to the latest code composer studio and in this moment, I can no longer do builds until the upgrade of all our project files is completed.

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • May we note the inconsistency between the, "Repeated calls for tech support" and the, "free Ad for Engineering services?"

    The fact that such "Engineering Services" is revealed to NOT employ latest vendor tools further disturbs.

    And "never/ever" has "reports to:" found its way to such an advertisement.    Breaking such "new ground" proves not always successful!

  • what are you trying to tell me cb1?
  • My earlier post says it all.
  • Please be professional on this forum, trolls are not needed here. I did not understand your message to me. Please either be clear or please refrain from responding to my posts. I presume you are not a texas instruments support engineer. Thank you.
  • Do you really want to use that language to describe me?

    I made point by point review of your posts - the fact that you "attack" without addressing any of my points - speaks volumes!
  • Amit,

    Please block this person from posting here. My company is purchasing significant volume of TI parts and has paid for the ccs licenses we are using, including mine. We do not need this nonsense. I have no idea what this person is attempting to say about my posts but its not welcome. I posted because I requested support. Whether or not cb1 thinks my posts have merit or not is not relevant. thanks.
  • Hi Amit,

    I stand by my writing.    This poster appears not familiar with "slander" - he (and those he reports to) may (soon) learn the effects of such misuse!

  • Hello Randall, cb1,

    Can we all keep such discussions to the sidelines while we focus on the issue at hand. I will not block a forum member on the E2E, but only based on some level of good will, I can urge that we remain professional.
    I would appreciate that we do not discuss the last few posts any further (this includes responding to my thread) unless we have data to share on the issue.

    Regards
    Amit

  • I agree 100%

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Amit,

    I am not seeing a way in ccs 6.1 to connect to a target without downloading. In the Run menu of CCS Debug mode, Connect Target and Disconnect Target are both grayed out. I can only click on "Debug" at which time it downloads the program. This will not let me see if the program counter is in ROM range.
  • Also I see that autobaud is not synchronizing.
  • Hello Randall,

    In Code Composer Studio you would need to create a New Configuration File

    View -> Target Configurations

    This will open a Window Called Target Configuration. Right Click on User Defined and then select new Target Configuration

    Give this file a Name and Press Finish. Double Click the file and set it up for Stellaris In Circuit Debug Interface as Connection and Device as Tiva TM4C1294NCPDT. Save it.

    Right Click the Configuration File -> Launch Selected Configuration. This will launch a Debug Session. The in the Debug Session Right Click -> Connect target. This will connect the CPU w/o downloading a code.

    As for the second part, remove the check box for Auto Bauding and let us know (pic is worth a 1000 words)

    Regards
    Amit
  • "As for the second part, remove the check box for Auto Bauding and let us know (pic is worth a 1000 words)"

    Which application are you referring to?  Uniflash?   I have been using the TI command line utility sflash included with Tivaware.

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Inline image 1

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randall,

    Did you try sflash with the option -d to disable Auto baud?

    Looking at the screen snapshot it seems that the Debugger has not connected. Since either the Run button or the Halt Button should be visible. Did you follow the last instruction to connect Target?

    Regards
    Amit
  • Got it.  Was not connected.

    Inline image 1

    Here are the flash registers.  BOOTCFG is 0x7FFF30FE     Tried using the unlock command of uniflash to get NW bit back to 1 and in the process, I have two Launchpads that I can no longer connect to with any tool :(   Anyway, 30FE should work for me.  GPIO PB4 is grounded and when I do that before reset, the program in flash that flashes the Leds is not running anymore - a good sign we are now in the ROM bootloader.

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Yes I have tried running with autobaud disabled.  But from the bootloader document, I thought it was required.

    I see the run and stop buttons.   I was not sure where the file was saved to go right clicking on it per your instructions so I right clicked on the file name ConnectOnly.ccxml [code composer studio - device debugging] and selected connect.

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randall,

    It looks like the UART is not configured at all for Baud Rate. The register for Integer and Fractional Baud rate both show 0x0. Can you get the same snapshot by doing the entire process except running sflash (so that Auto Baud or Boot Code does not touch the UART configuration)?

    Also a snapshot of the CPU registers. Did you check if the PC points to ROM address space?

    Regards
    Amit
  • Tried again, here is the screen cap.  Its not displaying the registers.

    Inline image 1

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randall,

    From the snapshot: The debugger is not connected. Notice that one of the two buttons should be Active.

    Regards
    Amit
  • Hi Amit,

    I the snapshot above, notice that the red button [stop] is seen.  Doesn't that mean its running?   When I step thru code in the flash, I either see the green run arrow if stopped/paused or I see the pause or red icons when running.  What am I not understanding?

    Also can you tell me which baud rate the ROM function sets the uart to when the bootcfg pin is used to enter?  You wrote earlier that with sflash, the autobaud feature was optional.  If autobaud is not used, how does one sync the two baud rates?    I could not find this explained in the documentation.  I tried 115200 and 9600 for the sflash command utility.

  • Hello Randall

    The Red button is for debug session. It means that the debug session is active but does not mean that processor has been connected to. The ROM tries to do AutoBaud. I checked the same on my LaunchPad with an erased flash and the registers shows up as 0x0.

    I am using LMFlashProgrammer with the following setting. Can you attempt to do the same? Also can you send me the full command line for sflash.

    NOTE: COM port may be different on your PC.

    Regards

    Amit

  • I have never been able to get LM Flash Programmer to run.  I have tried reinstalling visual studio redistributables per what I found on the web about this generic error.  Nothing works.  Seems to be a dll issue but I don't know which one.  My laptop is x64

    Inline image 1

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • sflash.exe  -c 8 -d -s 60 -p 0x00 therapycontroller.bin

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • "The Red button is for debug session. It means that the debug session is active but does not mean that processor has been connected to. "   Good to know, thanks.  I always thought one had to be connected to enter a debug session.   I am running a software rebuild now and will try again when it completes.

    Thanks a lot Amit for all your help.  I LOVE TI !!!

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randall,

    I tried the same and it works with sflash.exe (I removed the -d as with -d it does not work)

    Regards

    Amit

  • That's what I thought.   I had read that autobaud was needed and the -d disables autobaud.

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Amit,

    I was not able to program my EK_TM4C1294XL launchpad using sflash with the bootcfg enabled pin asserted. When you programmed blinky using sflash, which launchpad did you use and how exactly were you connected into uart 0? I have a usb to serial converter cable with txd and rxd tied directly to uart 0 PA0 and PA1 of connector x11. Not sure how the "debug" processor ICDI on the board factors into this.
  • Hello Randall,

    I am using EK-TM4C1294XL (there is only one TM4C129 LP right now). The issue you are facing is the fact that the ICDI on the LaunchPad is connected to the TM4C129 for UART0. So both the ICDI MCU is driving UARTRX and so is the USB to serial converter (bus contention). The only way to resolve that is

    1. Do not use the converted but the on board ICDI.
    2. Remove the resistor R6 and R7 to prevent ICDI from driving the UART0 of the TM4C129. They can be reconnected by using the 100 mil jumper headers right next to R6 and R7.

    Regards
    Amit
  • Yeah, I tried disconnecting the straps to avoid the contention issue.    

    What do you mean by this Amit?   "1. Do not use the converted but the on board ICDI."

    Will I still be able to use ccs to download code via the ICDI if I perform step #2?

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randy,

    "Do not use the converted but the on board ICDI." I meant not to use the "USB to Serial Converter" but the on-board ICDI which has both JTAG and UART.

    Yes, you can still use CCS to download code as the UART COM port is being disconnected and not JTAG. You can mount a 2x2 header on the TXD and RXD header next to R6 and R7 resistor and then shunt them to get full ICDI function

    Regards
    Amit
  • Thanks for your help Amit.  I will take a look at the schematic included with the eval kit and make sure I understand what you've explained.

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • On thing that is really strange. I am able to call ROM_UpdateUART from my program after setting up uart 0 for 115200 baud and using the usb to serial cable connected to the uart 0 pins on connector x11, it downloads fine. That should not have worked because of the contention issue. But it does. Its only when using the BOOTCFG pin to launch ROM update, that it fails. Strange.
  • Hello Randall.

    That is a good point you raised and I need to look into the same. But to unblock you I suggested "method 1".

    As for the issue with Pin, I would need more info as I do not have your setup-application code environment: Does the UART update work if the device is erased and then you try to flash the application code when using USB to Serial Converter? This is to eliminate some code artifacts.

    Regards
    Amit
  • My method won't work if I use uniflash to erase the flash first.  This is because the code that I am running calls ROM_UpdateUart and if flash was erased, that would never happen.

    I started with the sflash source code and added a couple of new protocol messages that my embedded application code understands.  My application code comes up flashing an led (so I know its running) while polling the Rx fifo on uart 0.  when a message comes in (sflash protocol to Uart 0 using the usb to serial interface cable), ROM_UpdateUart is called.

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Amit,

    From the schematic, it looks like JP5 1-2 and JP4 1-2 could be removed instead of removing R6 and R7, do you agree?

    How does U20 (TMC123) actually use Uart 0?   Also the connection looks odd to me... U20 PA0 (Uart 0 Rx) connects to R6 then JP5 1-2 then into PA0 of the Tiva C 129 so we've got a Uart Rx connected to a Uart Rx instead of Rx to Tx????



    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------

  • Hello Randall

    But when you use PB3 then the modified sflash.exe will send in the packet with new protocol message. Is that a correct statement?

    Regards
    Amit
  • Using PB4 not PB3 and no, the modified sflash will NOT send out any new protocol messages.  That is for special case we have where one Tiva programs another (master/slave).

    Regards,

    Randy


    ------------------------------------------------------------------------
     Randall D. Miner,   Embedded SW Engineer contractor.
     Randstad Technologies.
     2050 Spectrum Blvd.  Ft. Lauderdale  FL. 33309
     cell (954)-812-8180    ofc (954) 828-2770
     Reports To: Ron Reinhart(JABIL) & Steve Machan (RT)
    ------------------------------------------------------------------------