Hello,
I started getting errors while programming my custom tm4c123 board, after loading a program that attempts to readwrite from eeprom.
Here are the errors:
CORTEX_M4_0: GEL Output:
Memory Map Initialization Complete
CORTEX_M4_0: Trouble Halting Target CPU: (Error -2062 @ 0x0) Unable to halt device. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.2.1.00046)
CORTEX_M4_0: Error initializing flash programming: Target failed to read 0x400FE000
CORTEX_M4_0: Trouble Halting Target CPU: (Error -2062 @ 0x0) Unable to halt device. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.2.1.00046)
CORTEX_M4_0: Trouble Halting Target CPU: (Error -2062 @ 0x0) Unable to halt device. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.2.1.00046)
CORTEX_M4_0: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.
Here is the code that I uploaded:
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_memmap.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/eeprom.h"
#include "driverlib/flash.h"
#ifdef DEBUG
void
__error__(char *pcFilename, uint32_t ui32Line)
{
while(1);
}
#endif
int main(void) {
volatile uint32_t ui32Loop;
volatile uint32_t result;
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_GPIOC)) {}
GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_7);
SysCtlPeripheralEnable(SYSCTL_PERIPH_EEPROM0);
while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_EEPROM0)));
// write
//uint32_t temp = 500000;
//result = EEPROMProgram(&temp, 0x00, 4);
// read
uint32_t temp;
EEPROMRead(&temp, 0x00, 4);
while(1) {
GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_7, GPIO_PIN_7);
for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++){}
GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_7, 0x0);
for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++){}
}
}
This above program probably gets blocked at eepromread, rendering the mcu in a non reprogrammable state.
Have I bricked my tm4c123gh6pm? Is there a way to fix this?
Best Regads,
Can