Hi Tom,
The External flash used is IN28F256K3 Intel StrataFlash® Synchronous Memory(K3/K18).So the interrupt used is Slice timer 1 and Slice timer 0 for Watchdog. So after programming the operational code using PROGCFZ Flash programmer from PE Micro while Write_to_flash gets called in the process,the SW gets stuck ,so while I Debugged, I found that once it enters erase flash functions or write into flash functions if the interrupt is not disabled then it would not continue further and gets stuck.When I disabled ,write to flash function/eare to flash function would work fine. This is the linker lcf file I used
KEEP_SECTION {.vectortable}
MEMORY
{
boot (RWX) : ORIGIN = 0x00000000 , LENGTH = 0x00200000
text (RWX) : ORIGIN = 0x02001000 , LENGTH = 0x02000000
vector_ram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400 /* Vector table */
data (RWX) : ORIGIN = AFTER(text), LENGTH = 0
bss (RWX) : ORIGIN = AFTER(data), LENGTH = 0
}
SECTIONS
{
# Heap and Stack sizes definition
___heap_size = 0x100;
___stack_size = 0x100;
.vector_ram : {} > vector_ram
___MBAR = 0x10000000;
__MBAR = ___MBAR ;
___SDRAM = 0x02000000 ;
___SDRAM_SIZE = (8 * 1024 * 1024);
# ___SDRAM_SIZE = (16 * 1024 * 1024);
___SYS_SRAM = ___MBAR + 0x00010000;
___SYS_SRAM_SIZE = (32 * 1024) ;
___MCDAPI_START = ___SYS_SRAM;
___MCDAPI_SIZE = (12 * 1024);
___CORE_SRAM0 = 0x20000000 ;
___CORE_SRAM0_SIZE = (4 * 1024) ;
__CORE_SRAM0 = ___CORE_SRAM0;
___CORE_SRAM1 = 0x20001000 ;
___CORE_SRAM1_SIZE = (4 * 1024) ;
__CORE_SRAM1 = ___CORE_SRAM1 ;
__CORE_SRAM1_SIZE = ___CORE_SRAM1_SIZE;
___CODE_FLASH = 0x00000000 ;
___CODE_FLASH_SIZE = (32 * 1024 * 1024);
___FLASH = ___CODE_FLASH ;
___BOOT_FLASH = 0x00000000 ;
___BOOT_FLASH_SIZE = (2 * 1024 * 1024);
# ___VECTOR_RAM = ___SDRAM;
___VECTOR_RAM = ADDR(.vector_ram);
# ___SP_AFTER_RESET = ___CORE_SRAM1 + ___CORE_SRAM1_SIZE - 4;
.boot :
{
. = ALIGN(0x4);
_BOOT_BEGIN = .;
_VECTOR_BEGIN = .;
vectors_s.obj(.text)
_VECTOR_END = .;
mcf548x_lo_s.obj(.text)
mcf5xxx_s.obj(.text)
sysinit_c.obj(.text)
. = ALIGN(0x4);
_BOOT_END = .;
} > boot
_VECTOR_SIZE = _VECTOR_END - _VECTOR_BEGIN;
.text : AT(0x00010000)
{
. = ALIGN(0x4);
_TEXT_BEGIN = . ;
#vectors_s.obj(.text)
*(.text)
*(.rodata)
. = ALIGN(0x4);
___DATA_ROM = . ;
_TEXT_END = . ;
} > text
_TEXT_PHYSICAL = 0x00010000;
_TEXT_VIRTUAL = _TEXT_BEGIN;
_TEXT_SIZE = _TEXT_END - _TEXT_BEGIN;
.data : AT(0x00010000 + SIZEOF(.text))
{
. = ALIGN(0x4);
___DATA_RAM = . ;
*(.data)
*(.sdata)
*(.relocate_code)
*(.relocate_const)
*(.relocate_data)
. = ALIGN(0x4);
___DATA_END = . ;
} > data
_DATA_PHYSICAL = 0x00010000 + SIZEOF(text);
_DATA_VIRTUAL = ___DATA_RAM;
_DATA_SIZE = ___DATA_END - ___DATA_RAM;
.bss :
{
. = ALIGN(0x4);
___BSS_START = . ;
*(.sbss)
*(SCOMMON)
*(.bss)
*(COMMON)
. = ALIGN(0x4);
___BSS_END = . ;
} > bss
___HEAP_START = .;
___HEAP_END = ___HEAP_START + (512*1024);
___SP_END = ___HEAP_END;
___SP_INIT = ___SP_END + (4*1024);
__SP_INIT = ___SP_INIT;
}