AnsweredAssumed Answered

Problem with debug application in Cortex M4 of MCIMX8QXP with arm gdb and j-link

Question asked by Isaias Acosta on Aug 30, 2019

Hello,

I am working with MCIMX8QXP-CPU (i.MX 8QuadXPlus Multisensory Enablement Kit) and I want to start working with the M4 part, so I downloaded the MCUXpresso SDK:

 

 

I followed the instructions from Getting Started with MCUXpresso SDK for i.MX 8QuadXPlus.pdf, section 5.1 Linux host.

 

At Section 5.1.3 Run an example application at step 6, after I execute monitor go, the hello_world app does not start, see below for the arm gdb input

 

boards/mekmimx8qx/demo_apps/hello_world/armgcc/debug$ arm-none-eabi-gdb hello_world.elf
GNU gdb (7.10-1ubuntu3+9) 7.10
Copyright (C) 2015 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=x86_64-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello_world.elf...done.
(gdb) target remote localhost:2331
Remote debugging using localhost:2331
0x1ffe5582 in ?? ()
(gdb) monitor reset
Resetting target
(gdb) monitor halt
(gdb) load
Loading section .interrupts, size 0xa00 lma 0x1ffe0000
Loading section .text, size 0x34b8 lma 0x1ffe0a00
Loading section .ARM, size 0x8 lma 0x1ffe3eb8
Loading section .init_array, size 0x4 lma 0x1ffe3ec0
Loading section .fini_array, size 0x4 lma 0x1ffe3ec4
Loading section .data, size 0x68 lma 0x1ffe3ec8
Start address 0x1ffe0ab4, load size 16176
Transfer rate: 303 KB/sec, 1797 bytes/write.
(gdb) monitor go
(gdb) info stack
#0 Reset_Handler () at /home/isaias/SecondSSD/nxp/imx8/MCUXpresso/devices/MIMX8QX6/gcc/startup_MIMX8QX6_cm4.S:680
(gdb)

 

I am connected to the debug UART at port J11 and this is what it shows:

 

 

After many attemps, I found out that to start the hello demo app, I need to execute "Continue" command, then Ctrl+C, then "load" again and then "Continue" again, this way the app would get out of the vector reset and start, but this looks like a "hack"

(gdb) monitor go
(gdb) info stack
#0 Reset_Handler () at /home/isaias/SecondSSD/nxp/imx8/MCUXpresso/devices/MIMX8QX6/gcc/startup_MIMX8QX6_cm4.S:680
(gdb)
#0 Reset_Handler () at /home/isaias/SecondSSD/nxp/imx8/MCUXpresso/devices/MIMX8QX6/gcc/startup_MIMX8QX6_cm4.S:680
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
VPU_VPU_INT_4_IRQHandler () at /home/isaias/SecondSSD/nxp/imx8/MCUXpresso/devices/MIMX8QX6/gcc/startup_MIMX8QX6_cm4.S:867
867 b DefaultISR
(gdb) load
Loading section .interrupts, size 0xa00 lma 0x1ffe0000
Loading section .text, size 0x34b8 lma 0x1ffe0a00
Loading section .ARM, size 0x8 lma 0x1ffe3eb8
Loading section .init_array, size 0x4 lma 0x1ffe3ec0
Loading section .fini_array, size 0x4 lma 0x1ffe3ec4
Loading section .data, size 0x68 lma 0x1ffe3ec8
Start address 0x1ffe0ab4, load size 16176
Transfer rate: 315 KB/sec, 1797 bytes/write.
(gdb) c
Continuing.

 

 

So my question is:

What am I missing something to start the application after the "monitor go" command?

 

Thanks

 

 

Edit:

Nevermind it works now, my problem was that I did not make a bootable SD card with the SCFW, instead I tryed to debbug it with the SD card image that I got from the Yocto build

This is what I skipped:

5.1.3 Run an example application
This section describes steps to run a demo application using J-Link GDB Server application. To perform this exercise, follow these steps:
• Make a bootable SD card with the SCFW (System Controller Firmware) image. See Section 6.3, "Make a bootable SD card with System Controller Firmware (SCFW)"

Outcomes