This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I've set the "symbols ignore case" switch in the CCS5.2 assembler options (Properites>C/C++ Build>Settings>Assembler Options), and it seems to work fine for the symbols I define using .equ -- but not for statement labels, although in the Assembly Users guide it says:
"3.6.1 Label Field
Labels are optional for all assembly language instructions and for most (but not all) assembler directives.
When used, a label must begin in column 1 of a source statement. A label can contain up to 400
alphanumeric characters (A-Z, a-z, 0-9, _, and $). Labels are case sensitive (except when the --
syms_ignore_case option is used), and the first character cannot be a number."
Is there some other switch that I need to set to make statement labels case-insensitive too that I'm just not seeing in the setup menus?
All input appreciated. This is no big deal, but I would like to know just for the sake of completeness.
That option --syms_ignore_case which you enabled should work for labels as well. I just tried it with a quick test (CCS 4.2/MSP430 CGT 4.1.0) and it does treat labels as case-insensitive when that option is enabled. Which processor are you working with and which version of compiler tools? Is there a test case you can send us where it is being ignored?
Thanks for the quick reply.
I am using the MSP430 assembler under Code Composer Studio V.5.2.00069.
I follow the path "Properties > C/C++ > Settings > Assembler Options" for my project, and on this CCS tab, I check the "Symbol names are not case-significant (--syms_ignore_case.-ac)" box.
My code contains the instruction sequence
Code1F: mov.b &RxCount,&RxTxCount ; set up # bytes to send back to host
bis.w #fXmitReq,rFlags ; set the request transmission flag
jmp TaskScan
and on a later line
TASKSCAN: mov #010,R10
This generates the following error:
"Code.asm", ERROR! at line 298: [E0004] Non-local label
jmp TaskScan ; go back to main
If I change the TASKSCAN label to TaskScan as contained in the instruction snipet, the error goes away..
Similarly, I have an ISR which contains the single instruction
jmp RESET
and a label "Reset" in the body of my code. This generates the same error, but for the label RESET.
All of my equates, like "CommBuf0 .equ 0200h" work fine regardless of case, so it appears to be a problem only with statement labels -- at least for me here.
This looks like a bug but I can't seem to create a test case that fails with a similar error. Would you be able to share your project (zip it up and attach it here) so we can recreate the error and file a bug if needed?
Following is a short program that should re-create the error. Right after label "MainLoop" I've introduced the lines
**********************************ERROR INTRODUCED HERE***************************************
Test jmp TEST
**********************************************************************************************
This line will generate an error. If you change the label from "Test" to "TEST", the error goes away.
;*******************************************************************************
; MSP430G2x11 Demo - Comp_A, Output Reference Voltages on P1.1
;
; Description: Output comparator_A reference levels on P1.1. Program will
; cycle through the on-chip comparator_A reference voltages with output on
; P1.1. Normal mode is LPM0 with TA0 triggering interrupt for next mode.
; ACLK = n/a, MCLK = SMCLK = default DCO
;
; MSP430G2x11
; -----------------
; /|\| XIN|-
; | | |
; --|RST XOUT|-
; | |
; | CA1/P1.1|-->Vref
; | |
;
; D. Dang
; Texas Instruments Inc.
; October 2010
; Built with Code Composer Essentials Version: 4.2.0
;*******************************************************************************
.cdecls C,LIST, "msp430g2211.h"
;------------------------------------------------------------------------------
.text ; Program Start
;------------------------------------------------------------------------------
RESET mov.w #0280h,SP ; Initialize stackpointer
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
mov.b #P2CA4,&CACTL2 ; CA1
SetupC0 mov.w #CCIE,&CCTL0 ; CCR0 interrupt enabled
SetupTA mov.w #TASSEL_2+ID_3+MC_2,&TACTL ; SMCLK/8, contmode
eint ; General enable interrupts
;
Mainloop clr.b &CACTL1 ; No reference voltage
**********************************ERROR INTRODUCED HERE***************************************
Test jmp TEST
**********************************************************************************************
bis.w #CPUOFF,SR ; CPU off
Ref1 mov.b #CAREF0+CAON,&CACTL1 ; 0.25*Vcc, Comp. on
bis.w #CPUOFF,SR ; CPU off
Ref2 mov.b #CAREF1+CAON,&CACTL1 ; 0.5*Vcc, Comp. on
bis.w #CPUOFF,SR ; CPU off
Ref3 mov.b #CAREF1+CAREF0+CAON,&CACTL1 ; 0.55V on P2.3, Comp. on
bis.w #CPUOFF,SR ; CPU off
jmp Mainloop ;
;-------------------------------------------------------------------------------
TA0_ISR; Exit LPM0
;-------------------------------------------------------------------------------
bic.w #CPUOFF,0(SP) ; Exit LPM0 on RETI
reti ;
;
;------------------------------------------------------------------------------
; Interrupt Vectors
;------------------------------------------------------------------------------
.sect ".reset" ; MSP430 RESET Vector
.short RESET ;
.sect ".int09" ; TimerA0 Vector
.short TA0_ISR ;
.end
Curt,
I still can't seem to reproduce this. I simply created a new MSP430 project in CCS 5.2 (it uses compiler tools v4.1.0 by default, and sets the project output format to EABI), and added the attached file as a .asm file to the project. It compiles without the errors you mentioned. There is a linker error but that is due to a different reason.
Could you confirm in your project properties which version of the compiler you are using?
This is the output of my compile step as seen in the CCS build console (default options + --syms_ignore_case):
C:\CCStudio_v5.2.0.00069\ccsv5\utils\bin\gmake -k all
'Building file: ../test.asm'
'Invoking: MSP430 Compiler'
"C:/CCStudio_v5.2.0.00069/ccsv5/tools/compiler/msp430_4.1.0/bin/cl430" -vmsp --abi=eabi -g --include_path="C:/CCStudio_v5.2.0.00069/ccsv5/ccs_base/msp430/include" --include_path="C:/CCStudio_v5.2.0.00069/ccsv5/tools/compiler/msp430_4.1.0/include" --define=__MSP430G2211__ --diag_warning=225 --display_error_number --printf_support=minimal --syms_ignore_case --preproc_with_compile --preproc_dependency="test.pp" "../test.asm"
'Finished building: ../test.asm'
Hello AartiG:
Following is the CDT Build Console report I get if I include the line
Test jmp TEST
in the Test1.asm program I sent earlier, with the label as "Test" and the jump target as "TEST". (In the Problems window in this case, I get the following errors reported:
[E0001] Undefined symbol msp430g2x11_ca_01.asm/Test1 line 38 C/C++ Problem
[E0004] Non-local label msp430g2x11_ca_01.asm/Test1 line 38 C/C++ Problem
[E0200] Offset out of range, must be [-511,+512] msp430g2x11_ca_01.asm/Test1 line 38 C/C++ Problem )
Here is the Debug report:
-------------------------------------------------------------------------------------------------------------------
**** Build of configuration Debug for project Test1 ****
H:\MSP430\CCS Program Source\ccsv5\utils\bin\gmake -k all
'Building file: ../msp430g2x11_ca_01.asm'
'Invoking: MSP430 Compiler'
"H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/bin/cl430" -vmsp --abi=coffabi -g --include_path="H:/MSP430/CCS Program Source/ccsv5/ccs_base/msp430/include" --include_path="H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/include" --advice:power=all --define=__MSP430G2211__ --diag_warning=225 --display_error_number --diag_wrap=off --printf_support=minimal -k --output_all_syms --syms_ignore_case --preproc_with_compile --preproc_dependency="msp430g2x11_ca_01.pp" "../msp430g2x11_ca_01.asm"
'Finished building: ../msp430g2x11_ca_01.asm'
' '
'Building target: Test1.out'
'Invoking: MSP430 Linker'
"H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/bin/cl430" -vmsp --abi=coffabi -g --advice:power=all --define=__MSP430G2211__ --diag_warning=225 --display_error_number --diag_wrap=off --printf_support=minimal -k --output_all_syms --syms_ignore_case -z --stack_size=0 -m"Test1.map" --heap_size=0 -i"H:/MSP430/CCS Program Source/ccsv5/ccs_base/msp430/include" -i"H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/lib" -i"H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off -o "Test1.out" "./msp430g2x11_ca_01.obj" "../lnk_msp430g2211.cmd"
<Linking>
"../lnk_msp430g2211.cmd", line 79: warning #10374-D: Interrupt vector "PORT1" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 80: warning #10374-D: Interrupt vector "PORT2" does not have an interrupt handler routine.
'Finished building target: Test1.out'
' '
H:/MSP430/CCS Program Source/ccsv5/utils/bin/gmake --no-print-directory post-build
"../lnk_msp430g2211.cmd", line 85: warning #10374-D: Interrupt vector "TIMERA1" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 87: warning #10374-D: Interrupt vector "WDT" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 88: warning #10374-D: Interrupt vector "COMPARATORA" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 91: warning #10374-D: Interrupt vector "NMI" does not have an interrupt handler routine.
warning #10202-D: no suitable entry-point found; setting to 0
H:\MSP430\cl430.exe --absolute_listing H:\MSP430\CCSWork\Test1\Debug\msp430g2x11_ca_01.abs
"H:\MSP430\CCSWork\Test1\msp430g2x11_ca_01.asm", WARNING! at line 23:
[E1000]
error while processing C code in .cdecls directive
.cdecls C,LIST, "msp430g2211.h"
"H:\MSP430\CCSWork\Test1\msp430g2x11_ca_01.asm", ERROR! at line 38:
[E0001]
Undefined symbol
Test jmp TEST
"H:\MSP430\CCSWork\Test1\msp430g2x11_ca_01.asm", ERROR! at line 38:
[E0200]
Offset out of range, must be [-511,+512]
Test jmp TEST
"H:\MSP430\CCSWork\Test1\msp430g2x11_ca_01.asm", ERROR! at line 38:
[E0004]
Non-local label
Test jmp TEST
"H:\MSP430\CCSWork\Test1\Debug\msp430g2x11_ca_01.abs", ERROR! at EOF:
[E0300]
The following symbols are undefined:
4 Assembly Errors, 1 Assembly Warning
CCIE
CAREF1
CAREF0
ID_3
TEST
WDTCTL
P2CA4
CAON
TASSEL_2
CACTL2
CACTL1
TACTL
CCTL0
WDTHOLD
MC_2
CPUOFF
WDTPW
Errors in Source - Assembler Aborted
>> Compilation failure
gmake[1]: [post-build] Error 1 (ignored)
' '
**** Build Finished ****
-------------------------------------------------------------------------------------------------------------------
Following is the CDT Build Console report I get if I include the line
Test jmp Test
in the Test1.asm program with the label "Test" having the same case as the jump target. (No errors are reported in the Problems window in this case -- only warnings as usual.)
Here is the Debug report
-------------------------------------------------------------------------------------------------------------------
**** Build of configuration Debug for project Test1 ****
H:\MSP430\CCS Program Source\ccsv5\utils\bin\gmake -k all
'Building file: ../msp430g2x11_ca_01.asm'
'Invoking: MSP430 Compiler'
"H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/bin/cl430" -vmsp --abi=coffabi -g --include_path="H:/MSP430/CCS Program Source/ccsv5/ccs_base/msp430/include" --include_path="H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/include" --advice:power=all --define=__MSP430G2211__ --diag_warning=225 --display_error_number --diag_wrap=off --printf_support=minimal -k --output_all_syms --syms_ignore_case --preproc_with_compile --preproc_dependency="msp430g2x11_ca_01.pp" "../msp430g2x11_ca_01.asm"
'Finished building: ../msp430g2x11_ca_01.asm'
' '
'Building target: Test1.out'
'Invoking: MSP430 Linker'
"H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/bin/cl430" -vmsp --abi=coffabi -g --advice:power=all --define=__MSP430G2211__ --diag_warning=225 --display_error_number --diag_wrap=off --printf_support=minimal -k --output_all_syms --syms_ignore_case -z --stack_size=0 -m"Test1.map" --heap_size=0 -i"H:/MSP430/CCS Program Source/ccsv5/ccs_base/msp430/include" -i"H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/lib" -i"H:/MSP430/CCS Program Source/ccsv5/tools/compiler/msp430_4.1.0/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off -o "Test1.out" "./msp430g2x11_ca_01.obj" "../lnk_msp430g2211.cmd"
<Linking>
"../lnk_msp430g2211.cmd", line 79: warning #10374-D: Interrupt vector "PORT1" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 80: warning #10374-D: Interrupt vector "PORT2" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 85: warning #10374-D: Interrupt vector "TIMERA1" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 87: warning #10374-D: Interrupt vector "WDT" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 88: warning #10374-D: Interrupt vector "COMPARATORA" does not have an interrupt handler routine.
"../lnk_msp430g2211.cmd", line 91: warning #10374-D: Interrupt vector "NMI" does not have an interrupt handler routine.
warning #10202-D: no suitable entry-point found; setting to 0
'Finished building target: Test1.out'
' '
H:/MSP430/CCS Program Source/ccsv5/utils/bin/gmake --no-print-directory post-build
H:\MSP430\cl430.exe --absolute_listing H:\MSP430\CCSWork\Test1\Debug\msp430g2x11_ca_01.abs
"H:\MSP430\CCSWork\Test1\msp430g2x11_ca_01.asm", WARNING! at line 23:
[E1000]
error while processing C code in .cdecls directive
.cdecls C,LIST, "msp430g2211.h"
"H:\MSP430\CCSWork\Test1\Debug\msp430g2x11_ca_01.abs", ERROR! at EOF:
[E0300]
The following symbols are undefined:
1 Assembly Error, 1 Assembly Warning
CCIE
CAREF1
CAREF0
ID_3
WDTCTL
P2CA4
CAON
TASSEL_2
CACTL2
CACTL1
TACTL
CCTL0
WDTHOLD
MC_2
CPUOFF
WDTPW
Errors in Source - Assembler Aborted
>> Compilation failure
gmake[1]: [post-build] Error 1 (ignored)
' '
**** Build Finished ****
I appreciate your looking at this. It's clearly not a killer problem, but if I have some setup switch set incorrectly or something, I'd like to go ahead and correct it just for the sake of getting things done properly. Thanks again
Curt
PS -- many of the lines in the Debug reports are generated during post-build, when I am creating an absolute assembly listing for the program.
Curt,
It is the absolute lister which is throwing the error with the labels, so it is coming from your post build step. That is why I could not reproduce it earlier, as I did not have any post build steps and was only looking at the build output of the assembler in the CCS build console. If you add the --syms_ignore_case option to the post build step the error should go away.
cl430 --syms_ignore_case --absolute_listing test.abs
Let us know if this works.
Yes, that worked! -- and it makes perfect sense!
Now that I see what I was doing wrong, I think I can take care of my other problems with undefined symbols as well. It's perfectly obvious (now!) that when I do the post-build reassemble, I need to set all of the option switches correctly in the command line. Eureka!
Many thanks for the patience and the help!!