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.

Problem to compile the intvecs.asm in thumb2

Other Parts Discussed in Thread: HALCOGEN

Hello,

With Arm instruction set (codeModel=32), this interrupt vectors compile, but it codeModel=16 and -mt switch, it doesn`t, I got this error:


"../sys_intvecs.asm", ERROR! at line 65: [E0200] Offset out of range, must be
[-255,4095]
ldr pc,[pc,#-0x1b0]

 

Someone could help?

CCS 4.2.3.00004

 

Simon

 

 

;-------------------------------------------------------------------------------
; interrupt vectors

.sect ".intvecs"


.if 1
b _c_int00
.else
b #-8
.endif
.if 0
b _undef
.else
b #-8
.endif
.if 0
b _svc
.else
b #-8
.endif
.if 0
b _prefetch
.else
b #-8
.endif
.if 0
b _data
.else
b #-8
.endif
b #-8
.if 0
b _irqDispatch
.else
  ldr pc,[pc,#-0x1b0]
   .endif
  ldr pc,[pc,#-0x1b0]

  • Simon,

    The intvects code is not supposed to be compiled in thumb mode. I believe this is the code generated by HALCoGen.

    This is the interrupt vector branching code.

    The ldr pc,[pc,#-0x1b0] , directs the pc to point to IRQ and FIQ service routine directly.

    In the CCS Project file settings you can exclude this file and set it to be compiled in 32-bit mode.

    Regards,

    Pratip

  • Thanks Pratip,

    That's right but then I've got a placement error related to my .cmd file as I do that.

    --------------------------------------------------------------------------------------------

    ...

     

       VECTORS (X)      : origin = 0x00000000 length = 0x00000020
    ...

     

    error: placement fails for object ".intvecs",
    size 0x20 (page 0). Available ranges:

    VECTORS size: 0x20 unused: 0x20 max hole: 0x20

    -------------------------------------------------------------------------------------------- 

     So I  have increase the length to 0x0040 (why increase!) and arrange following segment addresses, without to be sure what I'm doing. It then built but it doesn't work.

    I suspect that there are other related code that must be modify.

    My code has been generated by Halcogen. I cannot found anything in Halcogen to taking care of Thumb2 mode.

    I give you a little bunch of low level code procure by Halcogen which I suspect that have to be changed:

    Refer to code.rar

    Simon6523.code.rar

     

  • And sorry I also give you my .cmd file.

    Simo7178.TMS570_link.rarn

     

  • Hi Simon,

    The files seems to be okay.

    Are you using CCS4 with HALCogen for TMS5702021PSGE and targeting http://focus.ti.com/graphics/tool/TMDX570LS20SUSB.jpg ?

    You can try first with the default files generated by HALCoGen without any change in HALCoGen GUI configuration.

    And if you still face any issue , you can share your CCS project compiler and linker settings.

    Best Regards,

    Pratip

  • Hi Simon,

    Your intvecs should be compiled with code model 32, as well as each function it calls !

    Your problem is due to "smart linking", which cares about 32/16 cross mode (or Dual-State Interworking), thus generating extra code, not compatible with intvecs table !!!

    You could have a look at §10.6 of "ARM Optimizing C/C++ Compiler v4.7User's Guide" (spnu151f) for further reading.

    Moreover your intvecs table must not overflow 0x20 ! So don't change its allocation range.

    Regards

    Christophe