[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x0800000
From: |
Liviu Ionescu |
Subject: |
[Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000 |
Date: |
Mon, 8 Jun 2015 20:32:58 +0300 |
Hi Alistair/Peter,
I am having difficulties to make the armv7m code run if linked from 0x08000000.
based on the tracing info that I have (copied below), it seems that the cpu
throws an early exception, properly caught by the cpu and displayed (see the
indented lines).
this is weird, since displaying these lines inside the UsageFault_Handler means
the alias works and the core can execute code from 0x08000000.
my guess is that there is a bug in the reset code preventing the cpu to fetch
the Reset_Handler address from the first words in memory.
I traced the cpu.c: arm_cpu_reset(CPUState *s) function and around line 170
there are two calls to initialise msp and pc:
initial_msp = ldl_phys(s->as, 0);
initial_pc = ldl_phys(s->as, 4);
in my environment both return 0, probably not being able to fetch data from the
aliased region.
could someone suggest a fix for this problem?
regards,
Liviu
GNU ARM Eclipse 64-bits QEMU v2.3.50 (qemu-system-gnuarmeclipse).
QEMU 2.3.50 monitor - type 'help' for more information
(qemu) memory_region_init("system", 18446744073709551615)
memory_region_init("io", 65536)
memory_region_init("stm32f2xx-syscfg", 1024)
memory_region_init("stm32f2xx-usart", 8192)
memory_region_init("stm32f2xx-usart", 8192)
memory_region_init("stm32f2xx-usart", 8192)
memory_region_init("stm32f2xx-usart", 8192)
memory_region_init("stm32f2xx-usart", 8192)
memory_region_init("stm32f2xx-usart", 8192)
memory_region_init("stm32f2xx_timer", 16384)
memory_region_init("stm32f2xx_timer", 16384)
memory_region_init("stm32f2xx_timer", 16384)
memory_region_init("stm32f2xx_timer", 16384)
memory_region_init("STM32F205.flash", 1048576)
memory_region_init("STM32F205.flash.alias", 1048576)
memory_region_init("STM32F205.sram", 131072)
memory_region_init("bitband", 33554432)
memory_region_init("bitband", 33554432)
armv7m_nvic_instance_init()
armv7m_nvic_realize()
NVIC: 96 irqs
Load 8024 bytes at 0x08000000-0x08001F57.
Load 116 bytes at 0x08001F58-0x08001FCB.
Load 704 bytes at 0x20000074-0x20000333.
memory_region_init("gic_dist", 4096)
memory_region_init("nvic", 4096)
memory_region_init("nvic_sysregs", 4096)
memory_region_init("nvic-gic", 3072)
memory_region_init("armv7m.hack", 4096)
armv7m_nvic_reset()
mr rd32(0xE000ED34) 0x00000000)
mr rd32(0xE000ED38) 0x00000000)
mr rd32(0xE000ED28) 0x00000000)
[UsageFault]
Stack frame:
R0 = 00000000
R1 = 00000000
R2 = 00000000
R3 = 00000000
R12 = 00000000
LR = 00000000
PC = 00000000
PSR = 40000000
FSR/FAR:
CFSR = 00000000
mr rd32(0xE000ED2C) 0x00000000)
HFSR = 00000000
mr rd32(0xE000ED30) 0x00000000)
DFSR = 00000000
mr rd32(0xE000ED3C) 0x00000000)
AFSR = 00000000
Misc
LR/EXC_RETURN= FFFFFFF9
- [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000,
Liviu Ionescu <=
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Peter Maydell, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Liviu Ionescu, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Peter Maydell, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Liviu Ionescu, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Peter Maydell, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Liviu Ionescu, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Peter Maydell, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Liviu Ionescu, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Peter Maydell, 2015/06/08
- Re: [Qemu-devel] armv7m/stm32f205 not starting if code linked from 0x08000000, Liviu Ionescu, 2015/06/08