AnsweredAssumed Answered

Debugging/Breakpoints not working well in KDS 3.0 and KSDK 1.2.0

Question asked by Sean MacKay on May 18, 2015
Latest reply on Oct 28, 2015 by Carlos Hass

Hello,

I'm trying to work with the KDS 3.0 and KSDK 1.2.0 setup to get an MQX based application running. I'm experiencing some issues (pointers keep getting wiped out for some reason in one case, or execution seems to randomly cease in others) but the biggest hurdle is the debugger and breakpoint system seems to be really inconsistent. I've tried both with the Segger JLink_OpenSDA_V2_2015-04-23 bootloader, USB drivers, and debug configuration, and also with the PEMicro DEBUG-FRDM-K64F_Pemicro_v108a_for_OpenSDA_v2.0.bin USB drivers and bootloader. (v2.1 with v108b seems to not work on my K64F).

 

 

I keep finding myself unable to properly set breakpoints, or unable to step into or to the next line of code consistently. When I start debugging I get this:

GNU gdb (GNU Tools for ARM Embedded Processors) 7.6.0.20140731-cvs Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>.   monitor preserve0 0 Warning: the current language does not match this frame. Continuing. continue Note: automatically using hardware breakpoints for read-only addresses.   Temporary breakpoint 9, main () at ../Sources/BSP_Files/mqx_main.c:93 93    _mqx( (MQX_INITIALIZATION_STRUCT_PTR) &MQX_init_struct ); No breakpoint number 11. 

 

And when I'm running the debug console looks like this:

 

Connection from "127.0.0.1" via 127.0.0.1 Copyright 2012 P&E Microcomputer Systems,Inc. Command Line :D:\Freescale\KDS_3.0.0\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_2.0.8.201504092111\win32\pegdbserver_console -device=Freescale_K6x_K64FN1M0M12 -startserver -singlesession -serverport=7224 -interface=OPENSDA -speed=5000 -port=USB1 -conf      CMD>RE     Initializing. Target has been RESET and is active. CMD>CM D:\Freescale\KDS_3.0.0\eclipse\plugins\com.pemicro.debug.gdbjtag.pne_2.0.8.201504092111\win32\gdi\P&E\supportFiles_ARM\Freescale\K6x\freescale_k64fn1m0m12_1x32x256k_pflash.arp     Initializing. Initialized.     ;version 1.02, 06/02/2014, Copyright 2014 P&E Microcomputer Systems, Inc. All rights reserved. www.pemicro.com [mk64_1024k_n_pflash0_pflash1]     ;device freescale, k64fn1m0m12, 1x32x256k, desc=pflash     ;begin_cs device=$00000000, length=$00100000, ram=$20000000     Loading programming algorithm ...  Done. CMD>EM     Erasing. Module has been erased.     Initializing. Initialized.     ;version 1.02, 06/02/2014, Copyright 2014 P&E Microcomputer Systems, Inc. All rights reserved. www.pemicro.com [mk64_1024k_n_pflash0_pflash1]     ;device freescale, k64fn1m0m12, 1x32x256k, desc=pflash     ;begin_cs device=$00000000, length=$00100000, ram=$20000000     Loading programming algorithm ...  Done. CMD>PM     Programming. Processing Object File Data ...                                   .  Programmed. CMD>VC Verifying object file CRC-16 to device ranges ...     block 00000000-00033247 ...  Ok.      Checksum Verification Successful. (Cumulative CRC-16=$25CB)       CMD>RE     Initializing. Target has been RESET and is active. Error setting BP @3fe6 Error setting BP @403e Error setting BP @419c Warning - Not all breakpoints could be written. Preset breakpoint encountered.     Error removing BP @3fe6 Error removing BP @403e Error removing BP @419c 

 

Right from the start, there are errors setting and clearing breakpoints, stepping to the next line occasionally doesn't work, and instead goes until the next breakpoint that did properly set. This is very annoying as I'm trying to step through and see why a pointer declared as const is suddenly being wiped and pointing to an invalid memory address (which then freezes execution when a printf call attempts to print a string out of memory).

 

Does anyone know what may be going on? Is it my cable, the K64F board, drivers? I've been using this K64F and USB cable previously with MQX 4.1.1 without issue. Is it the GDB in the KDS being buggy and untested? Is there something I'm possibly missing in my setup?

 

This project was created with the KSDK and KDS new project guide, I haven't tried with a demo application to compare yet, but with the KSDK 1.1.0 and KDS  2.0 the demo applications seemed better, but not immune to inconsistent debugging behaviour.

 

Thank you if anyone can help figure out what's happening,

Sean

Outcomes