Hello,
I am new to uVision and assembly. I am trying to build a project that i found on the internet.
When i press the build button in uVision3 it starts assembling my startup.s file. But it gives an error on every line! It says bad instruction! I read somewhere on this forum that uVision should just compile the startup file (with assembly). But it does not with this file?
I am using a GNU compiler (winarm) and the project is for the evaluation board for the LM3S811
I add the startup file because there is maybe a something wrong with?! I think i all so need to fill in some lines because it is a standard startup file for my processor, but i don not know how to do this.
Thanks for all your help already!
Stack EQU 0x00000100
Heap EQU 0x00000000
AREA STACK, NOINIT, READWRITE, ALIGN=3 StackMem SPACE Stack __initial_sp
AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base HeapMem SPACE Heap __heap_limit
PRESERVE8
AREA RESET, CODE, READONLY THUMB
EXPORT __Vectors __Vectors
DCD StackMem + Stack
DCD Reset_Handler
DCD NmiSR
DCD FaultISR
DCD IntDefaultHandler
DCD 0
EXPORT Reset_Handler
Reset_Handler
IMPORT __main B __main
NmiSR B NmiSR
FaultISR B FaultISR
IntDefaultHandler B IntDefaultHandler
ALIGN
AREA |.text|, CODE, READONLY
IF :DEF: __MICROLIB
EXPORT __initial_sp
EXPORT __heap_base
EXPORT __heap_limit
ELSE
IMPORT __use_two_region_memory
EXPORT __user_initial_stackheap
__user_initial_stackheap
LDR R0, =HeapMem
LDR R1, =(StackMem + Stack)
LDR R2, =(HeapMem + Heap)
LDR R3, =StackMem
BX LR
ENDIF
END
Please use the 'pre' markup tags to format the code when posting a message, like so:
code line 1 code line 2 code line 3 code line 4 etc.
Oke thanks for the tip. Here is the code again (now also with comments)
EXPORT Reset_Handler Reset_Handler /* ; Call the C library enty point that handles startup. This will copy ; the .data section initializers from flash to SRAM and zero fill the ; .bss section. It will then call __rt_entry, which will be either the ; C library version or the one supplied here depending on the ; configured startup type. */ IMPORT __main B __main /****************************************************************************** ; ; This is the code that gets called when the processor receives a NMI. This ; simply enters an infinite loop, preserving the system state for examination ; by a debugger. ; ;******************************************************************************/ NmiSR B NmiSR /****************************************************************************** ; ; This is the code that gets called when the processor receives a fault ; interrupt. This simply enters an infinite loop, preserving the system state ; for examination by a debugger. ; ;******************************************************************************/ FaultISR B FaultISR /****************************************************************************** ; ; This is the code that gets called when the processor receives an unexpected ; interrupt. This simply enters an infinite loop, preserving the system state ; for examination by a debugger. ; ;******************************************************************************/ IntDefaultHandler B IntDefaultHandler /****************************************************************************** ; ; Make sure the end of this section is aligned. ; ;******************************************************************************/ ALIGN /****************************************************************************** ; ; Some code in the normal code section for initializing the heap and stack. ; ;******************************************************************************/ AREA |.text|, CODE, READONLY /****************************************************************************** ; ; The function expected of the C library startup code for defining the stack ; and heap memory locations. For the C library version of the startup code, ; provide this function so that the C library initialization code can find out ; the location of the stack and heap. ; ;******************************************************************************/ IF :DEF: __MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, =HeapMem LDR R1, =(StackMem + Stack) LDR R2, =(HeapMem + Heap) LDR R3, =StackMem BX LR ENDIF /****************************************************************************** ; ; Make sure the end of this section is aligned. ; ;******************************************************************************/ ALIGN /****************************************************************************** ; ; Tell the assembler that we're done. ; ******************************************************************************/ END
Can't help you with ARM specific things, sorry. But my suggestion would be to split things into smaller tasks.
- are you sure the (assembly and C) source code is suitable for your toolchain? Does it contain toolchain specific instructions? See also my comment in your other thread http://www.keil.com/forum/docs/thread12940.asp
- did you manage to get a HelloWorld-like demo application to work on the evaluation board, using the default toolchain? It should come with plenty of instructions en demos I assume. The demos should also come with a startup file you might be able to reuse.
- then convert the small demo application to the new toolchain and get it running (I guess you need this to build larger projects because of license issues; but don't forget to check out educational licenses!)
- then modify the demo application to include your own code.
...little steps.
-- Joost