This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

New to Arm cortex m3

Note: This was originally posted on 9th June 2009 at http://forums.arm.com

Hi everyone,
I recently got an Arm cortex m3 microcontroller (stm32f103ret6).  I'm interested in programming in assembly only.  I received some software with the kit I bought (keil uvision, IAR workbench kickstart and ride7) but i find all of these a little confusing to use.  Reading the book "the definitive guide to arm cortex m3", I beleive the simplest way to compile and build assembly code is using arm tools, I found some of these in the keil software directory (armasm, armlink, fromelf).  the book describes assembling using this command line:

armasm --cpu cortex-m3 -o test.o test.s

this however doesn't work I realized i had to replace the "--cpu cortex-m3" with "--device stm32".  This makes me wonder if there are different arm tools or variations in different software or if the book was just wrong? Or is this what your supposed to use on linux (I'm using windows)?

the next thing to do is to link the object I seen an example using the following command:

armlink --rw-base 0x20000000 --ro-base 0x0 --map -o test.elf test.o

my question is: is the ro (read only) supposed to be your code that goes into the flash? and rw is the data that goes to the ram?

My microcontroller's flash starts at 0x80000000 (i think), when linking should i set the ro-base at the address 0x80000000 or at 0x0, I've used flash loader demo to successfully upload sample code to my microcontroller.

I have also seen "startup code" on some programs, looking at the code it looks like it sets up the interrupt vector table and stack.  is this absolutely necessary or can you get away with omitting this code and just setup the vectors you will be using?  If someone can elaborate on this.

Any help would be greatly appreciated
0