We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
I would like to ask help to some expert in armasm.
In my startup.s file I have the following code which reserves 0x400 bytes of RAM to the stack.
; this is the original startup.s file Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp
Well, I would like to be able to initialise Stack_Size with a value which I have in a cfg.h file or with a const value which I have in a cfg.c file
// this is cfg.h file #define STACK_SIZE 0x00000400
// this is cfg.c file #include "cfg.h" extern const int Stack_Size = STACK_SIZE;
The problem is that I dont know how to export the variable from C and import it into assembly.
I tried to use IMPORT, as in the following, but it does not work.
; this is the modified startup.s IMPORT Stack_Size ;Stack_Size EQU 0x00000400 ; EXPORT Stack_Size AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp
Any suggestion?
Thanks in advance, Marco.
> Any thoughts...?
Of course. You are suffering from an issue with armld that I reported in 2008 (case #394129) and has been fixed a short while after that.
The behavior you seem to be experiencing started in RVCT 3.1 Build 700. The include paths are relative to the temporary directory!
Although initially not acknowledged (to me anyway) as bug, ARM reverted the change and returned to the proper behavior a few releases later.
-- Marcus
Marcus,
Thanks for your reply. I'm using MDK-4.11 - I would have thought it is supposed to be solved in it...?