Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Linker error [E0300] when assembling asm project with two files.

$
0
0

Hi

I am trying to build a simple assembly project for the MSP430FR5739. I have made an simple project where I have two files "testinclude.asm" and "main.asm" but get an [E0300] error when linking. The source is as follows:

testinclude.asm:

****************************************************************

     .text

     mov.w #1, &ADC10CTL0

****************************************************************

main.asm:

****************************************************************

;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------

    .cdecls C,LIST,"msp430.h" ; Include device header file
    .include "testinclude.asm"

;-------------------------------------------------------------------------------
    .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
;-------------------------------------------------------------------------------
     RESET mov.w #__STACK_END,SP ; Initialize stackpointer
     StopWDT mov.w #WDTPW|WDTHOLD,&WDTCTL ; Stop watchdog timer

;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------


;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
     .global __STACK_END
     .sect .stack

;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
     .sect ".reset" ; MSP430 RESET Vector
     .short RESET

****************************************************************

I get the following error when linking:


**** Build of configuration Debug for project TestAssembly ****

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building file: ../main.asm'
'Invoking: MSP430 Compiler'
"C:/ti/ccsv5/tools/compiler/msp430_4.1.4/bin/cl430" -vmspx --abi=eabi -g --include_path="C:/ti/ccsv5/ccs_base/msp430/include" --include_path="C:/ti/ccsv5/tools/compiler/msp430_4.1.4/include" --advice:power=all --define=__MSP430FR5739__ --diag_warning=225 --display_error_number --diag_wrap=off --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="main.pp" "../main.asm"
'Finished building: ../main.asm'
' '
'Building file: ../testinclude.asm'
'Invoking: MSP430 Compiler'
"C:/ti/ccsv5/tools/compiler/msp430_4.1.4/bin/cl430" -vmspx --abi=eabi -g --include_path="C:/ti/ccsv5/ccs_base/msp430/include" --include_path="C:/ti/ccsv5/tools/compiler/msp430_4.1.4/include" --advice:power=all --define=__MSP430FR5739__ --diag_warning=225 --display_error_number --diag_wrap=off --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --printf_support=minimal --preproc_with_compile --preproc_dependency="testinclude.pp" "../testinclude.asm"
"../testinclude.asm", ERROR! at EOF: [E0300] The following symbols are undefined:
ADC10CTL0

Errors in Source - Assembler Aborted
1 Assembly Error, No Assembly Warnings

>> Compilation failure
gmake: *** [testinclude.obj] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

Why am I getting an error when accessing the defined symbols in msp430fr5739.cmd from my included file and not from main? Remember that main accesses WDTCTL without an error?

Kind regards,

Mads Nielsen


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>