cancel
Showing results for 
Search instead for 
Did you mean: 

Memory management fault on start

wywrotj
Associate II
Posted on May 15, 2009 at 07:24

Memory management fault on start

2 REPLIES 2
wywrotj
Associate II
Posted on May 17, 2011 at 13:11

I found something strange when trying to run my application.

I'm trying to run some code from ram (at addr 0x20000000).

I'm using evalboard with STM32F103VBT6, starting the target to boot from RAM memory.

Linker script seems to be configured properly (all necesary sections in RAM).

When starting the application using RIDE as debugger, the program counter never reaches the reset handler.

First executed operation is command from memory management fault handler (MPU violation ?).

It is strange, that memory management fault status register contains 0x00.

It seem that vectors table is not correct, but I see, that adresses of exception handlers are ok, also top of the stack seems to be ok.

Vectors table start (lss file):

20000000 :

20000000: 00 50 00 20 61 01 00 20 79 01 00 20 85 01 00 20

20000010: 91 01 00 20 9d 01 00 20 a9 01 00 20 00 00 00 00

...

2000002c: b5 01 00 20 b5 01 00 20 00 00 00 00 b5 01 00 20

2000003c: b5 01 00 20

Anybody knows what is going on?

Thanks for help in advance.

[ This message was edited by: wywrotj on 08-05-2009 15:28 ]

wywrotj
Associate II
Posted on May 17, 2011 at 13:11

The problem occured, that in boot from SRAM, the PC jumps allways to 0x20000108 (in high density devices). For workaround just take a look at raisonance startup file for STM32, which is by default in this location:

C:\Program Files\Raisonance\Ride\Lib\ARM\crt0_STM32x.c

(void *)0xF1E0F85F //@0x1E0 //this is for boot in RAM mode for high density devices.

This is workaround for PC to be reloaded with reset handler address...

Topic closed.