JMGross wrote:
> Hi Roman,
> 
> yes, adding the attribute puts the functions into FARTEXT. But that's not 
> all. You must be very careful to not mix (and mess up) things.
> Interrupt functions must be near, as the interrupt vectors have only 16 bit. 
> (luckily, the additional address bits are stored in unused status register 
> bits and therefore saved on interrupt call).
> I guess, the compiler will generate FAR calls and returns for any other 
> function (else it would be difficult to track which function can be called 
> from where). Since 'near' functions can only be called from other near 
> functions (their normal 'ret' return code will not poperly return to a far 
> function)
> But that's not all, there are issues when accessing near memory (such as the 
> config memory) from within a function in FARTEXT (look at the device errata 
> sheets e.g. for the 5438), problems with the power-down 
> mechanism and much more.

luckily I am using a 241x device that is not affected from the infomem
access problem.

> Not to mention the fact that far function calls are a tad slower and require 
> more memory than the standard near calls.
> 
> So yes, it is possible, but it is full of possible problems. And in this case 
> I didn't want to go thus far when there was apparently no knowledge at all 
> about the MSP430X. Since his project already touched the 64K 
> boundary, it is obviously more complex than a simple 'hello world' and 
> therefore prone to excessive problems with MSP430X.

I myself have a project that has been growing so that I had to access
the upper memory.

> 
> AFAIK the far attribute is just an alias for the segment FARTEXT attribute. 
> So the compiler will not solve any of the above problems other than just 
> placing the code in the FARTEXT segment and generating 430X 
> entry/exit code and calls. That's not enough if you don't exactly know what 
> you're doing. But maybe the MSP430X branch has made some progress that wasn't 
> discussed here (or I missed it).

when I first used the MSP430X branch, I also observed some severe
problems with jumptables and functions with parameters on the stack. But
these are resolved by now.

Of course it would be a fine thing if the compiler would be able to
place the functions autonomously in NEAR/FARTEXT dependent on type of
function (interrupt, normal) and free memory available.

Roman

> 
> JMGross
> 
> 
> ----- Ursprüngliche Nachricht -----
> Von: Roman Lim
> An: [email protected]
> Gesendet am: 12 Jan 2010 09:50:21
> Betreff: Re: [Mspgcc-users] section .text will not fit in region text
> 
> about MSP430X branch: putting code to fartext works, just add
> __attribute((__far__)) to your function definitions. without any
> hand-crafted assembly code you can spread your code to both memory
> ranges using the c compiler.
> 
> roman
> 
> 
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev 
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to