LockedHot!attribute vector/pragma vector question

Senior Member
  • Total Posts : 175
  • Reward points : 0
  • Joined: 2011/09/29 19:56:29
  • Location: Ljubljana, Slovenia
  • Status: offline
2018/10/10 15:47:07 (permalink)

attribute vector/pragma vector question

WRT to pragma vector / __attribute__((vector)):
It is supposed to be used to mark a function for placement at particular vector address or rather it entry point.
But entry point usually depends on several config options. on PIC32MM0256GPM064 it depends on MVEC setting and vector spacing in some CP0 register i think.
So what should I do to set up compiler to generate correct code ? DEF some preprocessor string or something else ?

2 Replies Related Threads

    Super Member
    • Total Posts : 2548
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: online
    Re: attribute vector/pragma vector question 2018/10/10 16:32:18 (permalink)
    The locations of the dispatch functions in the object code are determined by the linker script.
    Super Member
    • Total Posts : 250
    • Reward points : 0
    • Joined: 2011/09/16 05:16:15
    • Location: 0
    • Status: offline
    Re: attribute vector/pragma vector question 2018/10/11 19:39:34 (permalink)
    +1 (1)
    see sys/attribs.h and chapter 14 in compiler user's guide
    vector attribute places the jump to the function
    at_vector attribute places the whole function
    you are in charge of getting vector table position/sizes correct, but there is nothing to do if using normal/default ways
    there are a couple symbols you can override for the linker script if you are doing something unusual
    you can read the linker script for more info, or search for _ebase_address and _vector_spacing in the manual
    the startup code (crt0.S) will use these linker script symbols to setup the vectors
    Jump to:
    © 2019 APG vNext Commercial Version 4.5