Other Parts Discussed in Thread: UNIFLASH, CC1310
Tool/software: Code Composer Studio
Hello Friends,
In my project i am supposed to write some values to the internal FLASH memory of the microntroller TM4C1230C3PM) . We actually can read and write to the flash memory, but after REBOOT i am encountering the problem "CORTEX_M4_0: Can't Run Target CPU: (Error -1268 @ 0x1090001) Device is locked up in Hard Fault or in NMI. "
The setting of my memory for the microcontroller is as follows :
/******************************************************************************
*
* Default Linker Command file for the Texas Instruments TM4C1230C3PM
*
* This is derived from revision 15071 of the TivaWare Library.
*
*****************************************************************************/
--retain=g_pfnVectors
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00007C00
SRAM (RWX) : origin = 0x20000000, length = 0x00003000
FLASHDATA (RWX) : origin = 0x00007C00, length = 0x00000400
}
/* The following command line options are set as part of the CCS project. */
/* If you are building using the command line, or for some reason want to */
/* define them here, you can uncomment and modify these lines as needed. */
/* If you are using CCS for building, it is probably better to make any such */
/* modifications in your CCS project and leave this file alone. */
/* */
/* --heap_size=0 */
/* --stack_size=256 */
/* --library=rtsv7M4_T_le_eabi.lib */
/* Section allocation in memory */
SECTIONS
{
.intvecs: > 0x00000000
.text : > FLASH
.const : > SRAM
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}
__STACK_TOP = __stack + 512;
and the function used in my FW are:
#define FLASHDATA_VERSION ((uint32_t) 0x00007C00)
#define FLASHDATA_ADC1_CAL ((uint32_t) 0x00007C00 + 4)
#define FLASHDATA_ADC2_CAL ((uint32_t) 0x00007C00 + 8)
#define FLASHDATA_ADC3_CAL ((uint32_t) 0x00007C00 + 12)
uint8_t read_byte[4] = { 0x00, 0x00, 0x00, 0x00 };
uint32_t flashBuffer[5] = { 0, 0, 0, 0, 0 };
FlashProtectSet(FLASHDATA_VERSION, FlashReadWrite);
FlashErase(FLASHDATA_VERSION);
FlashProgram(flashBuffer, FLASHDATA_VERSION, 4);
FlashProgram(flashBuffer + 1, FLASHDATA_ADC1_CAL, 4);
FlashProgram(flashBuffer + 2, FLASHDATA_ADC2_CAL, 4);
FlashProgram(flashBuffer + 3, FLASHDATA_ADC3_CAL, 4);
for (i = 0; i < 4; i++)
{
read_byte[i] = *(uint8_t *) (FLASHDATA_VERSION + (sizeof(uint8_t) * i));
}
for (i = 0; i < 4; i++)
{
read_byte[i] = *(uint8_t *) (FLASHDATA_ADC1_CAL + (sizeof(uint8_t) * i));
}
for (i = 0; i < 4; i++)
{
read_byte[i] = *(uint8_t *) (FLASHDATA_ADC2_CAL + (sizeof(uint8_t) * i));
}
for (i = 0; i < 4; i++)
{
read_byte[i] = *(uint8_t *) (FLASHDATA_ADC3_CAL + (sizeof(uint8_t) * i));
}
FlashProtectSet(FLASHDATA_VERSION, FlashReadWrite);
Note: I am actually reading the values written to the flash Memory correctly when i check them in the Debugger.
Thank you in advance for your valuable feedback.
with regards,
Marco.