STM32MP157C-DK2 u-boot SPL debug timeout
Hi,
I start working with the new STM32MP157C-DK2 board and after testing the demo i restart from the bottom, compiling just uboot+SPL (no TF-A). I compiled with the last Linaro toolchain 'gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf' and prepared the sd card with minimum just to boot (fsbl1 - fsbl2 -sspl partitions).
All works fine: i reach the u-boot command line with no errors.
Now i'm trying to debug the SPL: i'v never debugged a MPU and i wonna be sure i'm able to do this when i'll work on my own hardware. I follow the guide https://wiki.st.com/stm32mpu/wiki/GDB and i successfully connect the debugger, set some breakpoints (ex. on spl_init function) and contine throuth them. Despite all is very slow (it takes nearly 5s to continue until a break just in the next line) it seams to work. Grate !
Problems starts when i try stepping: it doesn't work and i recieve a "timeout waiting for target halt" error.
I bypassed gdb and i connect directly to the openocd Telnet server on localhost:4444, that's the result:
shell> telnet -r localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> reset halt
ap 0 selected, csw 0x10006000
SRST line asserted
SRST line released
stlink_connect(connect)
SWD DPIDR 0x6ba02477
stm32mp15x.cpu0 rev 5, partnum c07, arch f, variant 0, implementor 41
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x000001d3 pc: 0x2ffc2690
MMU: disabled, D-Cache: disabled, I-Cache: disabled
ap 0 selected, csw 0x10006000
pc (/32): 0x2FFC2690
pc (/32): 0x2FFC2694
stm32mp15x.cpu1 rev 5, partnum c07, arch f, variant 0, implementor 41
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x800001f3 pc: 0x0000060e
MMU: disabled, D-Cache: disabled, I-Cache: enabled
Deferring arp_examine of stm32mp15x.cpu2
Use arp_examine command to examine it manually!
Deferring arp_examine of stm32mp15x.ap2
Use arp_examine command to examine it manually!
> step
stm32mp15x.cpu0 rev 5, partnum c07, arch f, variant 0, implementor 41
stm32mp15x.cpu1 rev 5, partnum c07, arch f, variant 0, implementor 41
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x600001f3 pc: 0x0000060e
MMU: disabled, D-Cache: disabled, I-Cache: enabled
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x000001d3 pc: 0x2ffc2544
MMU: disabled, D-Cache: disabled, I-Cache: disabled
timeout waiting for target halt
./share/openocd/scripts//target/stm32mp15x.cfg:158: Error:
at file "./share/openocd/scripts//target/stm32mp15x.cfg", line 158
>Just the commands 'reset halt' + 'step' produce the error.
I'm using the openocd version provided with the sdk en.SDK-x86_64-stm32mp1-openstlinux-4.19-thud-mp1-19-02-20.tar.xz (here https://wiki.st.com/stm32mpu/wiki/STM32MP1_Developer_Package) and that's its output:
<mysdkpath>/x86_64-openstlinux_weston_sdk-linux/usr$ ./bin/openocd -s ./share/openocd/scripts/ -f board/stm32mp15x_dk2.cfg
Open On-Chip Debugger 0.10.0+dev-00546-g1afec4f-dirty (2019-02-01-13:33)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
cortex_a interrupt mask on
cortex_a interrupt mask on
cortex_a domain access control fixup on
cortex_a domain access control fixup on
3333
none separate
adapter speed: 5000 kHz
adapter_nsrst_assert_width: 200
adapter_nsrst_delay: 200
none srst_pulls_trst
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J33S25 (API v2) VID:PID 0483:3752
Info : using stlink api v2
Info : Target voltage: 3.223311
Info : clock speed 5000 kHz
Info : SRST line released
Info : stlink_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : stm32mp15x.cpu0: hardware has 6 breakpoints, 4 watchpoints
Info : stm32mp15x.cpu0 rev 5, partnum c07, arch f, variant 0, implementor 41
Info : stm32mp15x.cpu0 cluster 0 core 0 multi core
Info : stm32mp15x.cpu1: hardware has 6 breakpoints, 4 watchpoints
Info : stm32mp15x.cpu1 rev 5, partnum c07, arch f, variant 0, implementor 41
Info : stm32mp15x.cpu1 cluster 0 core 1 multi core
Info : Listening on port 3334 for gdb connections
Info : Listening on port 3333 for gdb connections
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst
Info : accepting 'telnet' connection on tcp/4444
ap 0 selected, csw 0x10006000
Info : SRST line asserted
Info : SRST line released
Info : stlink_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : stm32mp15x.cpu0 rev 5, partnum c07, arch f, variant 0, implementor 41
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x000001d3 pc: 0x2ffc2690
MMU: disabled, D-Cache: disabled, I-Cache: disabled
ap 0 selected, csw 0x10006000
pc (/32): 0x2FFC2690
pc (/32): 0x2FFC2694
Info : stm32mp15x.cpu1 rev 5, partnum c07, arch f, variant 0, implementor 41
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x800001f3 pc: 0x0000060e
MMU: disabled, D-Cache: disabled, I-Cache: enabled
Info : Deferring arp_examine of stm32mp15x.cpu2
Info : Use arp_examine command to examine it manually!
Info : Deferring arp_examine of stm32mp15x.ap2
Info : Use arp_examine command to examine it manually!
Info : stm32mp15x.cpu0 rev 5, partnum c07, arch f, variant 0, implementor 41
Info : stm32mp15x.cpu1 rev 5, partnum c07, arch f, variant 0, implementor 41
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x600001f3 pc: 0x0000060e
MMU: disabled, D-Cache: disabled, I-Cache: enabled
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x000001d3 pc: 0x2ffc2544
MMU: disabled, D-Cache: disabled, I-Cache: disabled
Error: timeout waiting for target halt
./share/openocd/scripts//target/stm32mp15x.cfg:158: Error:
at file "./share/openocd/scripts//target/stm32mp15x.cfg", line 158
As you can see (line 19) i'v the latest STLINK firmware. Looking inside the openocd configuration files i can't find something evident but i didn't go into it.
About the hardware i can say that the mcu doesnt restart the execution after the error, it seams to be still connected with the stlink and halted, indeed i can print registers with 'reg' command:
> reg
===== ARM registers
(0) r0 (/32): 0x2FFC0078 (dirty)
(1) r1 (/32): 0x2FFC2500 (dirty)
(2) r2 (/32): 0x00000000
(3) r3 (/32): 0x00000000
(4) r4 (/32): 0x2FFC2400
(5) r5 (/32): 0x0001D6EB
(6) r6 (/32): 0x2FFC0118
(7) r7 (/32): 0x00000005
(8) r8 (/32): 0x2FFC2500
(9) r9 (/32): 0x00000000
(10) r10 (/32): 0x02004002
(11) r11 (/32): 0x00888E45
(12) r12 (/32): 0x04591E45
(13) sp_usr (/32)
(14) lr_usr (/32)
(15) pc (/32): 0x2FFC2544
(16) r8_fiq (/32)
(17) r9_fiq (/32)
(18) r10_fiq (/32)
(19) r11_fiq (/32)
(20) r12_fiq (/32)
(21) sp_fiq (/32)
(22) lr_fiq (/32)
(23) sp_irq (/32)
(24) lr_irq (/32)
(25) sp_svc (/32): 0x2FFC1BC8
(26) lr_svc (/32): 0x0000F28D
(27) sp_abt (/32)
(28) lr_abt (/32)
(29) sp_und (/32)
(30) lr_und (/32)
(31) cpsr (/32): 0x000001D3
(32) spsr_fiq (/32)
(33) spsr_irq (/32)
(34) spsr_svc (/32): 0x000001D3
(35) spsr_abt (/32)
(36) spsr_und (/32)
(37) sp (/32)
(38) lr (/32)
(39) sp_mon (/32)
(40) lr_mon (/32)
(41) spsr_mon (/32)
(42) d0 (/64)
(43) d1 (/64)
(44) d2 (/64)
(45) d3 (/64)
(46) d4 (/64)
(47) d5 (/64)
(48) d6 (/64)
(49) d7 (/64)
(50) d8 (/64)
(51) d9 (/64)
(52) d10 (/64)
(53) d11 (/64)
(54) d12 (/64)
(55) d13 (/64)
(56) d14 (/64)
(57) d15 (/64)
(58) d16 (/64)
(59) d17 (/64)
(60) d18 (/64)
(61) d19 (/64)
(62) d20 (/64)
(63) d21 (/64)
(64) d22 (/64)
(65) d23 (/64)
(66) d24 (/64)
(67) d25 (/64)
(68) d26 (/64)
(69) d27 (/64)
(70) d28 (/64)
(71) d29 (/64)
(72) d30 (/64)
(73) d31 (/64)
(74) fpscr (/32)Someone have suggestions ? Am i doing something wrong ?
Thanks in advice for the halp,
I congratulate ST for this new product and the new wiki.st.com: grate documentation, grate work !
P.S. Forgive my english
