Cannot get GDB's simulator for Cortex-M3 (ARM) to work

1

I need to use the simulator and for a start I wanted to do something real simple: Step thru the first few instructions of my startup code. Here it is:
Reset_Handler:
movs r1, #0
b LoopCopyDataInit
CopyDataInit:
ldr r3, =_sidata
ldr r3, [r3, r1]
str r3, [r0, r1]
adds r1, r1, #4
LoopCopyDataInit:

And this is what happens with GDB:
e:\devtools\Olimex\examples\STM32-P103_UART1>e:/devtools/olimex/yagarto/bin/arm-none-eabi-gdb.exe main.out
GNU gdb (GDB) 7.1
Copyright (C) 2010 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-pc-mingw32 --target=arm-none-eabi".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from e:\devtools\Olimex\examples\STM32-P103_UART1/main.out...done.
(gdb) target sim
Connected to the simulator.
(gdb) load
Loading section .isr_vector, size 0x10c vma 0x8000000
Loading section .text, size 0x1788 vma 0x800010c
Loading section .data, size 0x28 vma 0x20000000
Start address 0x800183d
Transfer rate: 50656 bits in <1 sec.
(gdb) b Reset_Handler
Breakpoint 1 at 0x800183e: file ./lib/startup_stm32f10x_md.s, line 67.
(gdb) b CopyDataInit
Breakpoint 2 at 0x8001840: file ./lib/startup_stm32f10x_md.s, line 71.
(gdb) run
Starting program: e:\devtools\Olimex\examples\STM32-P103_UART1/main.out
sim: unknown SWI encountered - 93 - ignoring
Unhandled v6 thumb insn: b64d
sim: exception: Unhandled Instruction '0x00000004' at 0xea021aca. Stopping.

[Thread ] #1 stopped.
0x00000b90 in ?? ()
(gdb)

The start address looks ok, I set 2 breakpoints after the first few instructions but they are never reached. What am I doing wrong?

Any help will be greatly appreciated.
M'

gdb
arm
simulator
asked on Stack Overflow Jun 12, 2016 by M. Keith

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0