Hi,
Very thanks for the support and concern.
Earlier I was getting error as "The flash loader program reported an error" when trying to Download & Debug in IAR using P&E USB Multilink Universal tool with TWR-K40X256 board. At that stage the Code Warrior was giving the pop info as "Device is Secure, Click to Unsecure". I have selected it to Unsecure the target in CW pop info, but the process got failed at the end. Somehow the efforts which CW made to unsecure the target caused the IAR to Successfully Download and Debug the Flash.
But now I am facing the different error as "Programming the Flash" pop info is not progressing up in IAR with FLASH_256KB_PFLASH_256KB_DFLASH and also in Code Warrior the process is now getting hanged at the stage of "Download Using 3rd Party Component". This type CW is not giving the error as "Device is Secure". It is trying and hang.
Please see the Console log message from the CW when I tried to Flash the Target with Debug Configuration set to "INTERNAL_FLASH" at the end of this Message. I have attached the Debug Configuration Image and the hanged state of Code Warrior also.
Yes, the code gets downloaded with [RAM_128KB] configuration but I am not able to debug it properly and also it is not executing perfectly. The SP and PC are pointing to a memory section which is reserved.
I am attaching the screenshot of the SP and PC state. Please have a look to it.
I highly appreciate your time and support. Please if you can help me in getting out of this I would be grateful to you.
Thanks & regards,
Gagan Garg



Console Log Messages (CW):
Executing Initialization File: F:\Work\k40_k20\KINETIS512_SC\k40-gpio/Project_Settings/Debugger/init_kinetis.tcl
radix x
thread break: Stopped, 0x0, 0x0, cpuARMLittle, k40-gpio.afx (state, tid, pid, cpu, target)
cmdwin::eclipse::config hexprefix 0x
cmdwin::eclipse::config MemIdentifier p
cmdwin::eclipse::config MemWidth 32
cmdwin::eclipse::config MemAccess 32
cmdwin::eclipse::config MemSwap off
cmdwin::reg DEMCR = 0x1000001
cmdwin::reg DWT_FUNCTION0 = 0x0
cmdwin::reg DWT_FUNCTION1 = 0x0
cmdwin::reg DWT_FUNCTION2 = 0x0
cmdwin::reg DWT_FUNCTION3 = 0x0
cmdwin::reg FP_COMP0 = 0x0
cmdwin::reg FP_COMP1 = 0x0
cmdwin::reg FP_COMP2 = 0x0
cmdwin::reg FP_COMP3 = 0x0
cmdwin::reg FP_COMP4 = 0x0
cmdwin::reg FP_COMP5 = 0x0
cmdwin::reg DWT_CTRL = 0x40000000
cmdwin::reg DWT_CYCCNT = 0x0
cmdwin::reg DWT_CPICNT = 0x0
cmdwin::reg DWT_EXCCNT = 0x0
cmdwin::reg DWT_SLEEPCNT = 0x0
cmdwin::reg DWT_LSUCNT = 0x0
cmdwin::reg DWT_FOLDCNT = 0x0
cmdwin::reg DWT_COMP0 = 0x0
cmdwin::reg DWT_COMP1 = 0x0
cmdwin::reg DWT_COMP2 = 0x0
cmdwin::reg DWT_COMP3 = 0x0
cmdwin::reg DWT_MASK0 = 0x0
cmdwin::reg DWT_MASK1 = 0x0
cmdwin::reg DWT_MASK2 = 0x0
cmdwin::reg DWT_MASK3 = 0x0
cmdwin::reg ITM_LAR = 0xc5acce55
cmdwin::reg ITM_TER = 0x0
cmdwin::reg ITM_TPR = 0x0
cmdwin::reg ITM_TCR = 0x0
cmdwin::reg ITM_LAR = 0x1
cmdwin::reg ETF_FCR = 0x300
cmdwin::reg MCM_ETBCC = 0x0
cmdwin::reg MCM_ETBRL = 0x0
cmdwin::reg SCB_VTOR = 0x20000000
cmdwin::reg SP = 0x20007FF8