Other Parts Discussed in Thread: MSP430F2013
Hello,
I tried to install and use the LaunchPad and to start a small MSP430F2013-Project.
There are some questions and I kindly ask your assistance.
The program shall be a pure assembler program.
Question 1:
Of course I want to use header files but it doesn't work. Sources:
defines.asm:-------------------------------------------------
...
.cdecls C,LIST,"msp430f2013.h"
.global _c_int00, stack_init
.global app, mnloop
adrOn .equ 80h
adrOff .equ 0
adr2SLi .equ 10h
adr4SNi .equ 20h
adr5SNi .equ 30h
.global adrOn, adrOff, adr2SLi, adr4SNi, adr5SNi
amin.asm:----------------------------------------------------
.copy "defines.asm"
...
.sect ".infoB"
adrQ .byte adrOn|2; Restladung (default, dominant)
adrI .byte adrOn|2; Entladestrom (nur Alarm)
adrBal .byte adr2SLi|2; Balancing-Alarm (nur Alarm)
adrUtot .byte adrOn|2; Gesamt-Spannung (nur Alarm)
rQlLmit .int 2000*2; Alarm-Grenze Restladung
dIuLmit .int 30*2; Alarm-Grenze Entladestrom
tolBalU .int 8*2; Alarm-Grenze Balancing
tUlLmit .int 34*2; Alarm-Grenze Gesamt-Spannung
lParams .equ 12
Error messages:----------------------------------------------
[E0004] Invalid data size for relocation for all 4 lines defining adrQ .. adrUtot
[E0300] The following symbols are indefined: adrOn adr2SLi
but I had already cases where nothing was listed in message E0300.
I directly copied the .equ into the main source (in fact I completely copied defines.asm) and it was assembled without message.
But this cannot be good programming style as I will have several source files.
What am I doing wrong?
The "MSP430 Assembly Language Tools v 3.3, User's Guide" (SLAU131E) gives no hints.
Ok, .equ-defined names are per se local, but when .global doesn't make them global: How shall I prepare a header file with imports, exports and defines, eventually with data structures?
Question 2:
I would like the possibility ti define data structures using .struct and .tag, especially I would like to use a C header file and let it be assembled.
So I could define data structures and constants to be used in my assembler program and also in a cooperating PC program written in C.
But, besides problems very similar than the ones described in question 1:
How can I instanciate such a structure in the information flash and preset it? The guide doesn't describe it.
The other questions are posted in seperate threads to reduce confusion.
Thank you in advance for your help and kind regards,
Helmut