cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Cortex M3 assembly with Keil uVision

klyhthwy
Associate
Posted on January 09, 2013 at 04:39

I have been working for a couple of weeks trying to simulate a simple assembly program using Keil uVision 4. I have tried the Cortex M3 for a target and I have tried a few of the STM32F10x devices for the target, particularly the STM32F103RC. All with the same results. The program builds with only one warning:

Test3.sct(8): warning: L6314W: No section matches pattern *(InRoot$$Sections). When I run the program the program starts execution at 0x0, but the code is at 0x8000000 where it is supposed to be according to the default Read/Only Memory section. What needs to be done to execute at the instructions?

AREA RESET, CODE, READONLY
ENTRY
start MOV r0, #3
MOV r1, #7
ADD r2, r1, r0
loop B loop
END

#assembly-language #arm-cortex-m3 #cross-post
2 REPLIES 2
Posted on January 09, 2013 at 14:13

Sounds like your scatter file isn't right. Can't you use an startup_stm32f1xx.s and example project from the firmware library as a starting point?

Also the core doesn't start executing code at 0x08000000, it loads a stack pointer (SP) followed by a program counter (PC), from the two 32-bit words starting at 0x08000000

You'd need something like

   dcd  0x20002000

   dcd  start

start:
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Chief II
Posted on January 11, 2013 at 07:18

Fixed - see cross post:

http://www.keil.com/forum/22063/