Unable to Step Through Code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to Step Through Code

Jump to solution
11,173 Views
chadgraham
Contributor V

Hello,

Something changed with my project an I am no longer able to step through code.  Using MCUXpresso, I can connect to and program a RT1060 dev board.  I am able to run the code to a breakpoint, but I am unable to step after I hit the breakpoint.  Frustratingly, I can step through the SDK samples without issue and I used to be able to on my main project.  Given that I suspect this is some kind of setting, does anyone have any suggestions?

0 Kudos
Reply
1 Solution
11,019 Views
chadgraham
Contributor V

Hello,

After having issues getting my application to run, I ended up reverting to the last time I had the project working and reinstated my changes one at a time.  The system is not working and I'm able to step through the code, but I don't know what caused my issue nor what I needed to do to fix it.

View solution in original post

17 Replies
11,050 Views
chadgraham
Contributor V

@converse 

Hello,

I am still trying to track down the source of the problem, but I changed something that now prevents me from even working with the code.  Now, when I program the device, it jumps to a random location and starts running.  (This last time it jumped to location 0x2173e0)  Unfortunately, I've reverted back everything that I thought I'd changed and I still have the issue.  Anything I might have missed?

0 Kudos
Reply
11,020 Views
chadgraham
Contributor V

Hello,

After having issues getting my application to run, I ended up reverting to the last time I had the project working and reinstated my changes one at a time.  The system is not working and I'm able to step through the code, but I don't know what caused my issue nor what I needed to do to fix it.

4,204 Views
rjleiser
Contributor II

I had the same issue.

I went back to a previous project folder. Re-copied the "source" from code that wouldn't debug step correctly. And now it's fine. So it's nothing in the source code.

0 Kudos
Reply
11,170 Views
ErichStyger
Specialist I

does the debugger/console show anything related to this?

0 Kudos
Reply
11,166 Views
chadgraham
Contributor V

Hello Erich,

The Debug tab and the Debug Console do not show anything.  However, I do get this the Debug Messages:

Using memory from core 0 after searching for a good core
debug interface type = CoreSight DP (DAP DP ID 0BD11477) over SWD TAP 0
processor type = Cortex-M7 (CPU ID 00000C27) on DAP AP 0
number of h/w breakpoints = 8
number of flash patches = 0
number of h/w watchpoints = 4
Starting execution using system reset and halt target
Stopped: Step
Stopped: Breakpoint #1
Stopped: Breakpoint #1
Stopped: Breakpoint (Unknown)
Stopped: Breakpoint (Unknown)

Every time I try to step, I get another "Unknown" breakpoint line.  (I only have 2 breakpoints set.)

0 Kudos
Reply
11,121 Views
ErichStyger
Specialist I

Just a wild guess: check the breakpoints view and remove all breakpoints.

ErichS_0-1632806774903.png

 

I saw cases where other breakpoints might confuse gdb.

I hope this helps,

Erich

0 Kudos
Reply
11,159 Views
converse
Senior Contributor V

What about the GDB traces console?

0 Kudos
Reply
11,158 Views
chadgraham
Contributor V

I don't have a GDB trace console (that I'm aware of), but I got this from the CDT Global Build Console: (I changed the project name to Xxxx)

14:10:15 **** Incremental Build of configuration DevBoard_Debug for project Xxxx ****
make -r -j12 all
Building target: Xxxx .axf
Invoking: MCU C++ Linker
arm-none-eabi-c++ -nostdlib -L"C:/Work/Designs/Cx/Xxxx /Xxxx /../../Platform/MIMXRT1062xxxxA_Project/DevBoard_Debug" -Xlinker -Map="Xxxx .map" -Xlinker --gc-sections -Xlinker -print-memory-usage -Xlinker --sort-section=alignment -Xlinker --cref -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -T Xxxx _DevBoard_Debug.ld -o "Xxxx .axf" ./xip/evkmimxrt1060_flexspi_nor_config.o ./xip/evkmimxrt1060_sdram_ini_dcd.o ./xip/fsl_flexspi_nor_boot.o ./utilities/fsl_debug_console.o ./utilities/fsl_str.o ./startup/startup_mimxrt1062.o ./source/Xxxx .o ./source/Xxxx _Configuration.o ./source/Xxxx _FlashController.o ./source/Xxxx _Interrupts.o ./source/Xxxx _MmcController.o ./source/Xxxx _RamController.o ./source/Xxxx _WatchdogController.o ./source/cpp_config.o ./source/semihost_hardfault.o ./drivers/fsl_clock.o ./drivers/fsl_common.o ./drivers/fsl_flexio.o ./drivers/fsl_flexio_i2c_master.o ./drivers/fsl_flexram.o ./drivers/fsl_flexram_allocate.o ./drivers/fsl_gpio.o ./drivers/fsl_gpt.o ./drivers/fsl_lpi2c.o ./drivers/fsl_lpspi.o ./drivers/fsl_lpuart.o ./drivers/fsl_pit.o ./drivers/fsl_semc.o ./device/system_MIMXRT1062.o ./component/uart/lpuart_adapter.o ./component/serial_manager/serial_manager.o ./component/serial_manager/serial_port_uart.o ./component/lists/generic_list.o ./board/board.o ./board/clock_config.o ./board/peripherals.o ./DevBoardPinout/pin_mux.o -lMIMXRT1062xxxxA_Project
Memory region Used Size Region Size %age Used
BOARD_FLASH: 370292 B 2 MB 17.66%
BOARD_FLASH_DEFAULT: 0 GB 4 MB 0.00%
BOARD_FLASH_2: 0 GB 2 MB 0.00%
BOARD_FLASH_IMAGE_A: 0 GB 4 MB 0.00%
BOARD_FLASH_IMAGE_B: 0 GB 4 MB 0.00%
BOARD_SDRAM: 32532 B 22 MB 0.14%
SRAM_DTC: 0 GB 128 KB 0.00%
SRAM_ITC: 0 GB 128 KB 0.00%
SRAM_OC: 0 GB 768 KB 0.00%
UPDATE_IMAGE_VERIFICATION: 0 GB 4 MB 0.00%
UPDATE_IMAGE: 0 GB 4 MB 0.00%
NCACHE_REGION: 132 B 2 MB 0.01%
Finished building target: Xxxx .axf

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size "Xxxx .axf"; # arm-none-eabi-objcopy -v -O binary "Xxxx .axf" "Xxxx .bin" ; # checksum -p MIMXRT1062xxxxA -d "Xxxx .bin";
text data bss dec hex filename
370292 0 25128 395420 6089c Xxxx .axf

14:10:17 Build Finished. 0 errors, 0 warnings. (took 1s.880ms)

 

0 Kudos
Reply
11,133 Views
converse
Senior Contributor V
0 Kudos
Reply
11,113 Views
chadgraham
Contributor V

Hello,

@converse 

Following the instructions in the link, I only have the "gdb traces" for the application. 

@ErichStyger

I tried clearing all breakpoints, but it didn't fix the problem.

0 Kudos
Reply
11,103 Views
converse
Senior Contributor V

Looking through the GDB Traces log, there is no indication of trying to step. I see that a breakpoint has been hit at QspiMaster.cpp, line 191. I then see that the local (stack-based) variables are retrieved. I see no evidence of anything happening after the breakpoint is hit and the values are retrieved.

0 Kudos
Reply
11,101 Views
chadgraham
Contributor V

@converse 

I can confirm that the stepping isn't working when I use the button shortcut or when I use the f-keys.  Why would MCUXpresso stop trying to step?

0 Kudos
Reply
11,098 Views
converse
Senior Contributor V

Sorry, no idea. Can you set breakpoints and run to them?

have you tried deleting the launch configuration and recreating a new one?

0 Kudos
Reply
11,087 Views
chadgraham
Contributor V

Hello,

I'm still struggling to resolve this.  I blew away the launch and I am seeing the IDE trying to step, but nothing ever happens. What else can I try?

 

0 Kudos
Reply
11,079 Views
ErichStyger
Specialist I

It could be that your running code somehow affects the debug block on the device.

Are you able to step properly through the startup code?

If yes, it could be something in your code writing to the device affecting debug functionality?

0 Kudos
Reply
11,076 Views
chadgraham
Contributor V

@ErichStyger 

This is indeed the case.  I can step, run to a breakpoint and step again at the beginning of the application.  What kinds of things could be affecting the debug functionality? 

0 Kudos
Reply
11,067 Views
converse
Senior Contributor V

I'd suggest single stepping through your code until you find what causes it. Start by stepping over library calls (e.g SDK) and then when you find single stepping has broken, stepping into the library. I think this is the only way you are going to find what is causing this.

0 Kudos
Reply