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.

my asm file inclding the example .h files emit a long list of errors

I wanted to implement few hardware accessing ISRs in assembly for which I need to include the TI's example provided common header files. When I try to assemble a small file "ramIsr,asm" I get a long list of errors, objecting to the redefinition unsigned to Uint16 and so on for long/int/float/.. and also the hardware register structure definitions.

I am attaching the file code and capture from the assembly error messages from message window (complier version and options flags are also in it).

What am I missing? Any help will be appreciated.

Thanks

Sayee 

; start of file ramISR.asm

.cdecls C,LIST,"DSP28x_Project.h"

.cdecls C,LIST,"DSP2803x_Device.h"

 

.sect "ramfuncs"

.def _AdcIsr1

_AdcIsr1:

MOVW DP,#AdcRegs.ADCINTFLGCLR

MOV @AdcRegs.ADCINTFLGCLR,#0x01 ; Clear ADCInt1 flag

MOVW DP,#_PieCtrlRegs.PIEACK ; Acknowledge PIE ADC-interrupt Group 1

MOV @_PieCtrlRegs.PIEACK,#0x01

IRET

 

.end

; end of file ramISR.asm

 

 

Assembly error window capture (too long...errors of the same type for all structures... so truncated!) 

[ramISR.asm] "C:\Program Files\Texas Instruments\C2000 Code Generation Tools 5.2.9\bin\cl2000" -g -q -pdr -fr"C:/tidcs/c28/DSP2803x/v124/DSP2803x_examples/ups3-3/Debug" -fs"C:/tidcs/c28/DSP2803x/v124/DSP2803x_examples/ups3-3/Debug" -i"../../DSP2803x_common/include" -i"./include" -i"../../DSP2803x_headers/include" -i"C:/TI/TI_F28xxx_SysSW/~SupportFiles/DSP2803x_headers" -d"_DEBUG" -d"LARGE_MODEL" -ml -mt -v28 -@"Debug.lkf" "ramISR.asm"

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 174: [E0300]

         Structure tag can't be global

ADCCTL1_BITS      .struct 0,1          ; struct size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 190: [E0300]

         Union tag can't be global

ADCCTL1_REG       .union 0,1           ; union size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 195: [E0300]

         Structure tag can't be global

ADCCTL2_BITS      .struct 0,1          ; struct size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 202: [E0300]

         Union tag can't be global

ADCCTL2_REG       .union 0,1           ; union size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 207: [E0300]

         Structure tag can't be global

ADCINT_BITS       .struct 0,1          ; struct size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 221: [E0300]

         Union tag can't be global

ADCINT_REG    .union 0,1           ; union size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 226: [E0300]

         Structure tag can't be global

INTSEL1N2_BITS      .struct 0,1          ; struct size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 238: [E0300]

         Union tag can't be global

INTSEL1N2_REG       .union 0,1           ; union size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 243: [E0300]

         Structure tag can't be global

INTSEL3N4_BITS      .struct 0,1          ; struct size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 255: [E0300]

         Union tag can't be global

INTSEL3N4_REG       .union 0,1           ; union size=(1 bytes|16 bits), alignment=1

 

"C:\DOCUME~1\user\LOCALS~1\Temp\037168", ERROR!   at line 260: [E0300]

         Structure tag can't be global

INTSEL5N6_BITS      .struct 0,1          ; struct size=(1 bytes|16 bits), alignment=1

 

  • Mokan Kanna said:

    .cdecls C,LIST,"DSP28x_Project.h"

    .cdecls C,LIST,"DSP2803x_Device.h"

    Mokan,

    Refer to the assembler reference guide www.ti.com/lit/spru513 for information on the .cdecls syntax and usage.   

    As the guide mentions, the C environment setup by one .cdecls does not follow to the next.  For this reason if you want to load both of these files I suggest the following syntax which will #include both files.

        .cdecls C,LIST
        %{
           #include "DSP28x_Project.h"
           #include "DSP2803x_Device.h"
        %}

    Note that the 2nd h file is not really needed since DSP28x_Project.h also includes Device.h.  So you could just include DSP28x_Project.h.

    As a side note, your code needs an underscore before AdcRegs - for example

    MOVW DP,#AdcRegs.ADCINTFLGCLR   should be MOVW DP,#_AdcRegs.ADCINTFLGCLR

    Regards,

    Lori

     

  • Lori

    Thanks your post with the suggestions and comments. I can now assemble the file without any errors.

    Thanks again.

    Sayee

  • Hello Lori,

    Thank you very much for this it was very helpful.

    Best regards

    Emmanuel Lange