Hello again...
I'm using CCS 6.1 on openSUSE 13.1. I always program microcontrollers in assembly, so my question is for the assembler of TI v4.4.4.
Suppose I have a file containing all the code for driving a real time clock chip through SPI. I created this file in a way to be able to define if the SPI bus is used only for this device or if the bus is shared with other SPI devices. So, I needed one definition to be global to the whole project, defining at which port lies the Chip Select pin. This is a must in order to create an interrupt dispatcher according to which SPI device is enabled. So much for the introduction of the problem.
When i create the definition:
RTCCTLOUT .equ P1OUT
and then
.global RTCCTLOUT
i get en error message "ERROR! at line 8: [E0300] Cannot equate an external symbol to an external symbol"
The problem can be reproduced using the following code (which is the default main assembly program the CCS created in an assembly-only project), together with the definitions that produce the problem:
;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
.cdecls C,LIST,"msp430.h" ; Include device header file
RTCCTLOUT .equ P1OUT ;Control port of external Real Time Clock
.global RTCCTLOUT ;Must be global to othe files
;-------------------------------------------------------------------------------
.text ; Assemble into program memory
.retain ; Override ELF conditional linking
; and retain current section
.retainrefs ; Additionally retain any sections
; that have references to current
; section
.global RESET ; Entry point must be global
;-------------------------------------------------------------------------------
RESET mov.w #__STACK_END,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer
jmp $ ; Nothing else to do
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
.global __STACK_END
.sect .stack
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET
What am I doing wrong?
Thank you for your help
Ilias