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.
I have an "interesting" problem. I have the TIVA TM4C129X Development Kit. I am running CCS 5.5.0.00077 on Windows 7 64-bit.
I have an application that I have written the works great if loaded using LM Flash Programmer.
If I try to start the debugger, I get the following messages:
CORTEX_M4_0: GEL Output:
Memory Map Initialization Complete
CORTEX_M4_0: Trouble Reading Memory Block at 0x400fe1d0 on Page 0 of Length 0x4
CORTEX_M4_0: Trouble Writing Memory Block at 0x400fd000 on Page 0 of Length 0x4
CORTEX_M4_0: Trouble Writing Memory Block at 0x400fd008 on Page 0 of Length 0x4
CORTEX_M4_0: Trouble Reading Memory Block at 0x400fd008 on Page 0 of Length 0x4: Timed out while waiting for target powerup/polling a hardware resource.
CORTEX_M4_0: Trouble Reading Memory Block at 0x400fd008 on Page 0 of Length 0x4: Timed out while waiting for target powerup/polling a hardware resource.
CORTEX_M4_0: Error: Timed out while waiting for target powerup/polling a hardware resource.
CORTEX_M4_0: Unable to determine target status after 20 attempts
CORTEX_M4_0: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging
CORTEX_M4_0: Flash Programmer: Erasing flash contents timed out!
CORTEX_M4_0: Flash Programmer: Timed out while writing to Flash memory
CORTEX_M4_0: GEL: File: P:\Odyssey\Fovea\JBox\CCA\Micro129X\WorkSpace\TPI\Debug\TPI.out: Load failed.
At this point LM Flash Manager is unable to connect to the device (and it subsiquently crashes) and the device must be unlocked.
After unlocking, I am able to start the debugger one time. Any attempts after that yield the same error messages listed above. Even if I just start the debugger without executing any code, the same thing happens.
I have tried creating a new workspace and get the same results.
Any ideas?
Thanks,
Jeff
Jeff,
Do you see these messages only when loading your application, or when loading the example projects in TivaWare as well? If you haven't tried one of the examples recently, would you mind giving one of the examples for this board a try and let us know how that goes?
You may also want to take a look at these threads that might be helpful (check this and this).
I am able to debug the TivaWare example programs. Hmmm. How can the contents of my.bin file seemingly corrupt the debug interface making it unusable?
While the links you provide are similar to what I am seeing, I don't think are exactly the same.
Any other ideas or suggestions?
Thanks
Upon further investigation, I have found that if I remove (comment out) the following code, I can debug all I want.
// Setup Watchdog
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
// Enable the watchdog interrupt.
ROM_IntEnable(INT_WATCHDOG);
// Set the period of the watchdog timer.
ROM_WatchdogReloadSet(WATCHDOG0_BASE, g_ui32SysClock);
// Enable reset generation from the watchdog timer.
ROM_WatchdogResetEnable(WATCHDOG0_BASE);
// Enable the watchdog timer.
ROM_WatchdogEnable(WATCHDOG0_BASE);
I then loaded the TivaWare watchdog example project and I now get the same error messages that I was seeing in my project. Eureka!
Should this issue remain on this forum or should I start a new thread on the Tiva forum?
Thanks,
Jeff
Jeff,
I don't have that specific development kit to test the watchdog example but your issue sound like the ones reported in these threads:
http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/285442/1003480.aspx#1003480
http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/286801/1003474.aspx#1003474
The users in those threads were using different devices than yours, however it sounds like your symptoms are also watchdog related. Could you try the workaround suggested in those threads and let us know if it helps? Basically replace the CortexM3_util.gel in the CCS installation with the modified version posted by Chester in the second thread (please make sure to make a backup copy of the original GEL file in case you need to revert back). What this basically does is disable the watchdog prior to loading the program. Let us know if this helps with the issue.
Also could you please let us know the exact steps that allow you to recreate the error with the watchdog example in TivaWare? I will try to get access to the development kit or find someone that has access so we can reproduce it here. Once we are able to reproduce it we should be able to verify if it is the same or related bug and fix it.
I tried using the file from Chester and I got a new error related to trying to read from the address specified in the OnPreFileLoaded( ) function. I check the Tiva datasheet and the register (SRCR0) specified in the gel file does not exist in the Tiva device. I found a similar register (SRWD) for the Tiva device, and changed the code within the OnPreFileLoaded( ) function and that seems to work. Here is the updated function:
// Reset the WATCHDOG0 and WATCHDOG1 modules prior to loading a file, so that
// the watchdog doesn't corrupt downloading to flash
#define SYSCTL_SRCR0_R 0x400FE500 //0x400FE040
#define SYSCTL_SRCR0_WDT1 0x00000010 // 0x10000000 // WDT1 Reset Control
#define SYSCTL_SRCR0_WDT0 0x00000001 // 0x00000008 // WDT0 Reset Control
#define WR_MEM_32(addr, data) *(unsigned int*)(addr) = (unsigned int)(data)
#define RD_MEM_32(addr) *(unsigned int*)(addr)
OnPreFileLoaded()
{
//WR_MEM_32 (SYSCTL_SRCR0_R, RD_MEM_32(SYSCTL_SRCR0_R) | (SYSCTL_SRCR0_WDT1 | SYSCTL_SRCR0_WDT0));
//WR_MEM_32 (SYSCTL_SRCR0_R, RD_MEM_32(SYSCTL_SRCR0_R) & ~(SYSCTL_SRCR0_WDT1 | SYSCTL_SRCR0_WDT0));
WR_MEM_32 (SYSCTL_SRCR0_R, (SYSCTL_SRCR0_WDT1 | SYSCTL_SRCR0_WDT0));
}
I changed the define values as needed and now only write to the register as only two bits have any meaning.
To get the TivaWare watchdog example to fail, do this:
Thanks for the help!
Jeff