Wang Walter

FRDM USBDM debugging failure

Discussion created by Wang Walter on Jul 4, 2018

Dears,

 

I'm using USBDM SW 4.12.1.230 and driver 4.12.3, both of them were latest downloaded from official sourceforge site.

A quite weird problem: I programmed my FRDM-KEAZ128Q80 with FRDM-KEAZ128Q80_Unique_ID.sx to support USBDM-on-FRDM to debug external MCU KEAZN8AMFK. The standalone ARM programmer application works well, my application can be programmed successfully and run OK, but failure occurs when debugging using CodeWarrior 10.7, error message dialogue shows: 

Failed to resume target process.
ARM GDI Protocol Adapter : An error occurred while trying to write memory. ARM transaction Fault

Consol prints:

GDI: DiGdiClose()
GDI: => DI_OK
=== CodeWarrior GDI protocol log ===
GDI DLL: C:\Freescale\CW MCU v10.7\MCU\bin\Plugins\Debugger\protocols\..\..\support\arm\gdi\usbdm-gdi-arm.4.dll
CPU: KEAZN8M4

GDI: DiGdiOpen()
GDI: => DI_OK
GDI: DiGdiGetFeatures()
GDI: => DI_OK
GDI: Identification: USBDM ARM, Version: 1.2.6, MeeAvailable: false, NrCpusAvailable: 1
GDI: DiGdiAddCallBack(cb_type = 0x4000)
GDI: => DI_OK
GDI: DiGdiInitIO()

=============================================
USBDM GDI Version 4.12.1.230
=============================================
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.setTargetVdd, Value : 1, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.cycleTargetVddOnReset, Value : 0, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.cycleTargetVddOnConnect, Value : 0, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.leaveTargetPowered, Value : 0, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.maskInterrupt, Value : , R) => DI_ERR_NONFATAL
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.automaticReconnect, Value : 1, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.useResetSignal, Value : , R) => DI_ERR_NONFATAL
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.usePSTSignals, Value : , R) => DI_ERR_NONFATAL
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.useAltBDMClock, Value : , R) => DI_ERR_NONFATAL
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.connectionSpeed, Value : 1500000, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.powerOffDuration, Value : 1000, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.powerOnRecoveryInterval, Value : 1000, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.resetDuration, Value : 500, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.resetReleaseInterval, Value : 500, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.resetRecoveryInterval, Value : 500, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : net.sourceforge.usbdm.connections.usbdm.defaultBdmSerialNumber, Value : USBDM-OPENSDA-8490389, R) => DI_OK
GDI: Mtwks Callback(MTWKS_CB_PROJECTACCESS, Section : , Entry : com.freescale.cdt.debug.cw.CW_SHADOWED_PREF.ARM Debugger.processor, Value : KEAZN8M4, R) => DI_OK
Unrecognised device - using default settings
GDI: => DI_OK
GDI: DiExecResetChild()
GDI: => DI_OK
GDI: DiExecGetStatus(cpu_status = (cause = GDI_WAIT_RUNNING, brkpt_id = 16778240, reason = Running))

Executing Initialization File: Z:\SkyDrive_Projects\MCU_Projects\Test_ZN8/Project_Settings/Debugger/init_kinetis.tcl
radix x
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 User\/System Mode Registers/LR = 0xFFFFFFFF
failed on register write: LR
cmdwin::reg Breakpoint Unit Registers/BP_COMP0 = 0x0
GDI: DiMemoryWrite(addr = 0xE0002008, space = 4, mem_items = 1, size = 4)
GDI: 00 00 00 00
GDI: => DI_OK
cmdwin::reg Breakpoint Unit Registers/BP_COMP1 = 0x0
GDI: DiMemoryWrite(addr = 0xE000200C, space = 4, mem_items = 1, size = 4)
GDI: 00 00 00 00
GDI: => DI_OK
cmdwin::reg Core Debug Registers/DEMCR = 0x1000001
GDI: DiMemoryWrite(addr = 0xE000EDFC, space = 4, mem_items = 1, size = 4)
GDI: 01 00 00 01
GDI: => DI_OK
cmdwin::reg Data Watchpoint and Trace Unit Registers/DWT_FUNCTION0 = 0x0
GDI: DiMemoryWrite(addr = 0xE0001028, space = 4, mem_items = 1, size = 4)
GDI: 00 00 00 00
GDI: => DI_OK
cmdwin::reg Data Watchpoint and Trace Unit Registers/DWT_FUNCTION1 = 0x0
GDI: DiMemoryWrite(addr = 0xE0001038, space = 4, mem_items = 1, size = 4)
GDI: 00 00 00 00
GDI: => DI_OK
cmdwin::reg Watchdog timer (WDOG)/WDOG_TOVALH = 0x03
GDI: DiMemoryWrite(addr = 0x40052004, space = 1, mem_items = 1, size = 1)
GDI: 03
GDI: => DI_OK
cmdwin::reg Watchdog timer (WDOG)/WDOG_TOVALL = 0xE8
GDI: DiMemoryWrite(addr = 0x40052005, space = 1, mem_items = 1, size = 1)
GDI: E8
GDI: => DI_OK
cmdwin::reg Watchdog timer (WDOG)/WDOG_CS2 = 0x03
GDI: DiMemoryWrite(addr = 0x40052001, space = 1, mem_items = 1, size = 1)
GDI: 03
GDI: => DI_OK
cmdwin::reg Watchdog timer (WDOG)/WDOG_CS1 = 0x23
GDI: DiMemoryWrite(addr = 0x40052000, space = 1, mem_items = 1, size = 1)
GDI: 23
GDI: => DI_OK
GDI: DiMemoryDownload(StartDownload)
GDI: => DI_ERR_NOTSUPPORTED
DiErrorGetMessage() => GDI Function not supported
GDI: GDI Function not supported
GDI: DiMemoryWrite(addr = 0x0, space = 4, mem_items = 48, size = 4)
GDI: 00 03 00 20 41 05 00 00 11 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00
GDI: 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00
GDI: 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00
GDI: 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00
GDI: 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00
GDI: 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00 1D 04 00 00

It seems USBDM driver attemps to write memory but failed?

PS: FRDM-KEAZ128Q80 was modified to 3.3V-compliant and works well for debugging my another product which using KEAZ128. The connection between FRDM and target board is 3-wire: SWD_DIO, SWD_CLK and GND, target board is 3.3V powered.

 

Thanks in advance for any hints.

 

OSBDM and TBDMLpgo

Outcomes