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.

DK-TM4C129X: Fail to Boot to Flash

Part Number: DK-TM4C129X

I can use CC9 to debug and run the sample project like Blinky fine. How do I permanently program the firmware to my board DK-TM4C129X? When I use CC9 to load the firmware, it does not run after reset or power cycle.

I also tried using LM Flash Programmer to program the Blinky.bin at address offset 0. Same problem, nothing runs after power cycle.

Please help.

Phil

  • Yes, the normal operation is that CCS programs the code into the flash and it will run without the debugger when power is applied. I don't know why it is not working for you. I Used CCS v9.0.1 and imported the project from "C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\dk-tm4c129x\blinky". I renamed it to DK-blinky to avoid conflicting with the version of blinky for the EK-TM4C123GXL board. I connected the USB cable to the debug port and was able to program and run using CCS9. Then I disconnected the usb cable (which disconnected power to the board) and quit CCS. When I plugged the USB cable back into the debug port of the board, the green LED started blinking again without starting CCS. I have attached a .zip file of my project. You can use the "file" -> "import" function of CCS to copy this project into your workspace.

    /cfs-file/__key/communityserver-discussions-components-files/908/DK_2D00_blinky.zip

  • Hi Bob,

    Thanks for your quick response. I imported your project and changed the SW_ROOT to point to my folder. Compiled and clicked Run-Load DK-Blinky.out on my DK-TM4C129X board. Green LED blinked. Quit CS9, then removed USB cable. Reinserted cable, nothing ran. I also noticed that when I depressed the reset button, green LED stopped blinking.

    Are you using the same development board? It seems the bootloader of my board is not working. How can I recover and make this board works again? All these times, I was just using CS9 to Run and Debug.

    Please help.

    Thanks

    Phil Chu 

  • This is the DK-TM4C129x board I am using.

    The project I provided will only run from the flash memory. Are you powering the board through the Debugger USB connection in the upper right corner as shown in the picture? 

    Which bootloader are you referring to? The DK-TM4C129 board has an on-board JTAG controller. That is what you connect to when you connect to the Debugger USB port. You should not need a bootloader.

    When the TM4C129 device is blank, it will execute a bootloader out of ROM. That bootloader checks for commands from UART0 or the USB OTG port. Once you have programmed code into the TM4C129, that bootloader is bypassed.

  • Bob,

    Yes, I connected my board via Debugger port (J4) just like your picture. Code just does not run after I depress the rest button or cycle power. Please explain to me how the the TM4C129 starts when power is turned on or reset is asserted. Where is the Blinky firmware programmed at?

    What I don't understand is why the code runs when I run it with CS9, but not by itself.

    BTW, I ran the EK version blinky on my EK-TM4C1294XL, it ran either with CS9 or upon power up or reset.

    What else can I check on my DK-TM4C129X?

    Thanks again.

    Phil Chu

  • Bob,

    Another thing I noticed is that after I cycle power or depress reset and insert USB cable to the OTG port, PC sees a device - Stellaris Device Firmware Upgrade. Not sure this is normal or not, the EK-TM4C1294 does not have that.

    So far I have run 3 projects on this board, usb_bulk_dev, tidm_tm4c129cusbhs2ethernet and blinky. Can any of these break something? Could the LM_Flash_Programmed break anything?

    Is it possible that I can get an replacement board from TI?

    Thanks

    Phil Chu

  • Seeing the "Stellaris Device Firmware Upgrade" when plugging into the OTG port is normal if the TM4C129 device is blank. This is an indication that the bootloader is running on that blank device. Programming those projects into the TM4C129 should not have caused an issue. However, if you used LM_Flash_Programmer while connected to the Debug USB port and selected "USB DFU" you may have accidentally overwritten the firmware of the JTAG scan controller. To check this, connect the Debug USB port and verify that you can see the "Stellaris In-Circuit Debug Interface" in your device manager.

    Unfortunately I believe these development boards are out of production. Only the EK-TM4C1294XL and EK-TM4C129EXL boards are available.

  • Bob,

    The Stellaris In-Circuit Debug Interface is all there, just like the picture.

    Why does it  run in CS9, but not off the flash?

    BTW, how can I attach picture to the message?

    Thanks.

    Phil Chu

  • Bob,

    I used the LM Flash Programmer and verified the flash is programmed with blinky FW from 0 to 0x4C1. Both CRC and binary compare passed.

    I read out the Reg #1 & 2. They are 0x00B61A00 and 0x00538402 respectively. I don't know what these values stand for.

    I then read the registers from the EK-TM4C1294XL. They are 0x00B61A00 and 0x002B5403.

    Reg #2 values are different. Is it normal? What is the correct value for DK-TM4C129X? Does it matter?

    Thanks

    Phil

  • Bob,

    I believe those reg #1 & 2 are MAC Addr.

    In the LM Flash Programmer, there is the Debug Port Unlock Utility. Can it help?

    Again, flash has the FW code, board just does not boot to it. It thinks the board is blank.

    Thanks

    Phil

  • Yes, the user registers 1 and 2 are used to store a MAC address. 

    The debug port unlock is not likely to help as it does not appear that your debug port is locked. I have been racking my brain to figure out how you can be executing blinky with CCS9 attached, but not when you hit reset. Please check that the stack pointer and the reset vector are programmed into the first two flash locations. Once you connect to the device, do "View" -> "Memory Browser". Then set the address in the memory browser to 0. The first word in memory should be the address of the top of stack. The second word should be the address of the first instruction + 1. In my example it looks like this: 

    I create the images that I insert in these posts by using "Snipping Tool" from Windows 10 and then saving the image as a .PNG file. Then I use the icon highlighted in the image below to insert the picture in my post.

      

  • Bob, I am appreciated that you are following up on this.

    I clicked Debug in CS9, it paused at first line of main(). Please look at the printout in console window, it writes, then erase. Is it normal?

    Memory window is same as yours.

    So strange. Thanks

    Phil

  • Yes, that all looks correct. I assume if you run the code by either "Run" -> "Resume", or by clicking the little green arrow/triangle, the green LED will flash. If that is the case, can you logically disconnect the debugger (but not disconnect the USB) by either clicking the little connection icon show below, or selecting "Run" -> "Disconnect Target". The green LED should be blinking.

    At this point, the USB cable is only supplying power to the device. You should be able to press the reset button on the DJ-TM4C129x board and the LED will stop while reset is held and blink again when reset is released. You should be able to disconnect the USB  cable, and the board will power down. (All of this is done while CCS9 is open, but is not "logically connected" to the device.) You plug the USB cable back into the Debug USB port and the board should power up and the LED will start blinking again. Click on the little connect icon (to reconnect the debugger logically to the board) and the code execution (and LED blinking) should stop.

  • Bob,

    I am looking into the registers. FLASH_BOOTCFG is 0x7FFF5CFE, but it is oxFFFFFFFE for the EK-TM4C1294XL. What should it be? I also attached a text file that contains the register values.

    Thanks

    Phil

    register.txt
    521177 14
    R PC 0x0000000B 0x00000334
    R SP 0x0000000B 0x20000200
    R LR 0x0000000B 0x0000045B
    R xPSR 0x0000000B 0x41000000
    R R0 0x0000000B 0x00000000
    R R1 0x0000000B 0xE000ED88
    R R2 0x0000000B 0x00000000
    R R3 0x0000000B 0x00000000
    R R4 0x0000000B 0x00000000
    R R5 0x0000000B 0x00000000
    R R6 0x0000000B 0x00000000
    R R7 0x0000000B 0x00000000
    R R8 0x0000000B 0x00000000
    R R9 0x0000000B 0x00000000
    R R10 0x0000000B 0x00000000
    R R11 0x0000000B 0x00000000
    R R12 0x0000000B 0x00000000
    R R13 0x0000000B 0x20000200
    R R14 0x0000000B 0x0000045B
    R MSP 0x0000000B 0x20000200
    R PSP 0x0000000B 0x00000000
    R DSP 0x0000000B 0x00000000
    R CTRL_FAULT_BASE_PRI 0x0000000B 0x00000000
    R SYSEXC_SYSEXC_RIS 0x0000000B 0x00000000
    R SYSEXC_SYSEXC_IM 0x0000000B 0x00000000
    R SYSEXC_SYSEXC_MIS 0x0000000B 0x00000000
    R SYSEXC_SYSEXC_IC 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FMA 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FMD 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FMC 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FCRIS 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FCIM 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FCMISC 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FMC2 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FWBVAL 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_FLPEKEY 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FWBN 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_PP 0x0000000B 0xF01401FF
    R FLASH_CTRL_FLASH_SSIZE 0x0000000B 0x000003FF
    R FLASH_CTRL_FLASH_CONF 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_ROMSWMAP 0x0000000B 0x00004000
    R FLASH_CTRL_FLASH_DMASZ 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_DMAST 0x0000000B 0x00000000
    R FLASH_CTRL_FLASH_RVP 0x0000000B 0x01000000
    R FLASH_CTRL_FLASH_BOOTCFG 0x0000000B 0x7FFF5CFE
    R FLASH_CTRL_FLASH_USERREG0 0x0000000B 0x00B61A00
    R FLASH_CTRL_FLASH_USERREG1 0x0000000B 0x00538402
    R FLASH_CTRL_FLASH_USERREG2 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_USERREG3 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE0 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE1 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE2 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE3 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE4 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE5 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE6 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE7 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE8 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE9 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE10 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE11 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE12 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE13 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE14 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPRE15 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE0 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE1 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE2 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE3 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE4 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE5 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE6 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE7 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE8 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE9 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE10 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE11 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE12 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE13 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE14 0x0000000B 0xFFFFFFFF
    R FLASH_CTRL_FLASH_FMPPE15 0x0000000B 0xFFFFFFFF
    R SYSCTL_SYSCTL_DID0 0x0000000B 0x100A0002
    R SYSCTL_SYSCTL_DID1 0x0000000B 0x1032E076
    R SYSCTL_SYSCTL_PTBOCTL 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_RIS 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_IMC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_MISC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RESC 0x0000000B 0x00000012
    R SYSCTL_SYSCTL_PWRTC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_NMIC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_MOSCCTL 0x0000000B 0x0000000C
    R SYSCTL_SYSCTL_RSCLKCFG 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_MEMTIM0 0x0000000B 0x00300030
    R SYSCTL_SYSCTL_ALTCLKCFG 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DSCLKCFG 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DIVSCLK 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SYSPROP 0x0000000B 0x00031F31
    R SYSCTL_SYSCTL_PIOSCCAL 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PIOSCSTAT 0x0000000B 0x00370037
    R SYSCTL_SYSCTL_PLLFREQ0 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PLLFREQ1 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PLLSTAT 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SLPPWRCFG 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DSLPPWRCFG 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_NVMSTAT 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_LDOSPCTL 0x0000000B 0x00000018
    R SYSCTL_SYSCTL_LDODPCTL 0x0000000B 0x00000012
    R SYSCTL_SYSCTL_RESBEHAVCTL 0x0000000B 0xFFFFFFFF
    R SYSCTL_SYSCTL_HSSR 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_USBPDS 0x0000000B 0x0000003F
    R SYSCTL_SYSCTL_USBMPC 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_EMACPDS 0x0000000B 0x0000003F
    R SYSCTL_SYSCTL_EMACMPC 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_LCDMPC 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_PPWD 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_PPTIMER 0x0000000B 0x000000FF
    R SYSCTL_SYSCTL_PPGPIO 0x0000000B 0x0003FFFF
    R SYSCTL_SYSCTL_PPDMA 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPEPI 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPHIB 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPUART 0x0000000B 0x000000FF
    R SYSCTL_SYSCTL_PPSSI 0x0000000B 0x0000000F
    R SYSCTL_SYSCTL_PPI2C 0x0000000B 0x000003FF
    R SYSCTL_SYSCTL_PPUSB 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPEPHY 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPCAN 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_PPADC 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_PPACMP 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPPWM 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPQEI 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPLPC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PPPECI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PPFAN 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PPEEPROM 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPWTIMER 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PPRTS 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PPCCM 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPLCD 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPOWIRE 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPEMAC 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PPHIM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRWD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRTIMER 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRGPIO 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRDMA 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SREPI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRHIB 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRUART 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRSSI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRI2C 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRUSB 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SREPHY 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRCAN 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRADC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRACMP 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRPWM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRQEI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SREEPROM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRCCM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SRLCD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SROWIRE 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SREMAC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCWD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCTIMER 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCGPIO 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCDMA 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCEPI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCHIB 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_RCGCUART 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCSSI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCI2C 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCUSB 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCEPHY 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCCAN 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCADC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCACMP 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCPWM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCQEI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCEEPROM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCCCM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCLCD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCOWIRE 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_RCGCEMAC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCWD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCTIMER 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCGPIO 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCDMA 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCEPI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCHIB 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_SCGCUART 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCSSI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCI2C 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCUSB 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCEPHY 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCCAN 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCADC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCACMP 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCPWM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCQEI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCEEPROM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCCCM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCLCD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCOWIRE 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_SCGCEMAC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCWD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCTIMER 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCGPIO 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCDMA 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCEPI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCHIB 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_DCGCUART 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCSSI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCI2C 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCUSB 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCEPHY 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCCAN 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCADC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCACMP 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCPWM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCQEI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCEEPROM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCCCM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCLCD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCOWIRE 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_DCGCEMAC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PCWD 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_PCTIMER 0x0000000B 0x000000FF
    R SYSCTL_SYSCTL_PCGPIO 0x0000000B 0x0003FFFF
    R SYSCTL_SYSCTL_PCDMA 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCEPI 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCHIB 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCUART 0x0000000B 0x000000FF
    R SYSCTL_SYSCTL_PCSSI 0x0000000B 0x0000000F
    R SYSCTL_SYSCTL_PCI2C 0x0000000B 0x000003FF
    R SYSCTL_SYSCTL_PCUSB 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCEPHY 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PCCAN 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_PCADC 0x0000000B 0x00000003
    R SYSCTL_SYSCTL_PCACMP 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCPWM 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCQEI 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCEEPROM 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCCCM 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCLCD 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCOWIRE 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PCEMAC 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PRWD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRTIMER 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRGPIO 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRDMA 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PREPI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRHIB 0x0000000B 0x00000001
    R SYSCTL_SYSCTL_PRUART 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRSSI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRI2C 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRUSB 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PREPHY 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRCAN 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRADC 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRACMP 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRPWM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRQEI 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PREEPROM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRCCM 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PRLCD 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PROWIRE 0x0000000B 0x00000000
    R SYSCTL_SYSCTL_PREMAC 0x0000000B 0x00000000
    

  • Phil,

    That's it. Someone has programmed the boot configuration register of that DK to force it to run the bootloader from reset when GPIO PC7 is low. That register is decoded on page 708 of the datasheet. You can put a pullup on that pin and it should then run the code properly from reset. Or, you can run the "Debug Port Unlock" procedure to restore the FLASH_BOOTCFG register to its default state of 0xFFFFFFFF. If you do that, write down the MAC address in User registers 1 and 2 as they will also be erased. 

  • Bob,

    I ran it in Debug, then disconnect, when I depressed the reset, it stopped blinking. Disconnected adn reconnected USB, no blink. Connected Debugger, and Run, no blink. Could not break in debugger.

    Thanks

    Phil

  • Bob,

    Okay. I will try that on Thurs. Hopefully, I won't have to bother you again.

    The DK board ran the weather application no problem every time I powered it up. Just wonder how was that register changed. Could I mistakenly change that in CC9? I have no idea how. Can this register be set to some value in the CS project?

    Thanks

    Phil

  • I don't think that you accidentally changed the value. I think it more likely that someone else had programmed that register (unless this was a new DK that was not used by anyone else). When the GPIO PC7 pin is left floating, it might read high or it might read low. That is more likely why the reset worked sometimes but not others.

  • Bob,

    The DK board is brand new and I am the only one using it. Good news is that I am able to recover and set the FLASH_BOOTCFG register to its default value of 0xFFFFFFFE. I read the datasheet, there is no way that I can manually program the register via JTAG. Good thing is that TI provides the LM Flash Programmer software which I used to perform the Debug Port Unlock and to reprogram the MAC Addr. I ran CS9 and verified the FLASH_BOOTCFG is 0xFFFFFFFE. I ran the Blinky and usb_bulk_dev projects. Upon power cycle or reset, my DK board boots to flash and runs the application as expected.

    After reading the data sheet, I believe that there is no way my blinky and usb_bulk_dev code can write to the FLASH_BOOTCFG register. I then ran the project  tidm_tm4c129cusbhs2ethernet from The TI Design link is: http://www.ti.com/tool/TIDM-TM4C129USBHS  on my DK board. I could not debug it, CS9 just kind of locking up. I ran blinky in debug, and checked the FLASH_BOOTCFG register, it was set back to 0x7FFF5CFE. Okay, that is good because I can reproduce the issue. The project tidm_tm4c129cusbhs2ethernet is set to TM4C1294NCPDT, and my blinky project is set to TM4C129XNCZAD. Although the memory maps are the same, but they use different packages. I assume the pin assignments are different.

    So, is this my problem that I should have never run the tidm_tm4c129cusbhs2ethernet project on my DK-TM4C129X board? I think my DK board got corrupted because of the different pin out. If not, are there some settings in the tidm_tm4c129cusbhs2ethernet project that can change the FLASH_BOOTCFG register?

    Thanks

    Phil

  • OK, that explains it for me. That project programs the BOOT_CFG register when executed. It is designed to run on hardware that has a pull-up resistor on port pin PC7 with a push button switch to ground. The code is in lines 445-460 of tidm_tm4c129cusbhs2ethernet.c:

        //
        // Check if BOOT Mode Pin is configured or not. If not then configure and
        // commit the same. The next power cycle shall make it permanent. The
        // switch S2 if pressed at power on or during a reset will cause the
        // design to call the ROM Boot Loader
        //
        ui32User0 = HWREG(FLASH_BOOTCFG);
        if((ui32User0 & FLASH_BOOTCFG_NW) == FLASH_BOOTCFG_NW)
        {
            ui32User0 = HWREG(FLASH_BOOTCFG);
            ui32User0 &= 0x7FFF00FE;
            ui32User0 |= (FLASH_BOOTCFG_PORT_C | FLASH_BOOTCFG_PIN_7);
            HWREG(FLASH_FMD) = ui32User0;
            HWREG(FLASH_FMA) = 0x75100000;
            HWREG(FLASH_FMC) = (FLASH_FMC_WRKEY | FLASH_FMC_COMT);
        }
    

    From page 11 of the user's guide for that TI Design:

  • Bob,

    Thanks for pin pointing to the root cause of my issue. I was focusing on the USB ULPI High Speed issue, and was not paying attention to these boot options.

    I used the LM Flash Programmer, although it took two attempts to recover, my DK board is back to normal that it boots to the application in flash. Now, I am back to getting this DK-TM4C129X to work with USB2.0 High Speed. I will be posting the issue I am facing. I really wish TI had the USB2.0 Phy built onto this board.

    Is it possible to change the title of this thread to something like "Fail to Boot to Flash"

    Thanks so much for all your help.

    Phil Chu

  • Phil Chu said:
    and was not paying attention to these boot options.

    Really - who else was - as well?    Few would have 'expected/anticipated your plight.'    

    The fact that together - 'you & Bob systematically proceeded' and were then 'rewarded' - provides a great lesson to (so many) here!

    This thread serves as a 'Real Teaching Moment' - which really was 'Built by you two!'     (And NOT an over-reaching (past) Gov't - claiming that, 'THEY Did it!')

    BTW - if things have not changed since my 'forum departure' - YOU may Edit your thread's title yourself.    (Go back to your 'Opening Post' - which includes an editable, ' Thread Title Block.')