Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/14/11 15:42
Read: times


 
#180587 - Suggested Introductory Material
I am using IAR compiler

My background is reasonably advanced C & C++, and while I have had to take care to manage heap alloc & free and manage small(ish)stack, and allocate enough stack, and use supported flashing tools, etc I have never had to consider things like segment groups and segment over size, memory ranges etc.

So I am begining to get to grips with these new concepts and if any one wants to take a look, here are a couple of issue I have come accross so far. Otherwise, skip to main question.

1) I had an array outside the functions in a .c file. It seemed that the memory for this was allocated to the IDATA_Z segment in the IDATA segment group. I found that the various segments in the group filled up the size I set (0x80) in general options for the group, up until IDATA_Z segment then the remainder upto the IDATA maximum (0xFF not set by me) was taken by ISTACK, which I guess is the stack used in function calls local data etc (depending on the compiler's method). Now, I incresaed the size of my array and recompiled and after a certain size I get a linker error saying the ISTACK segment is too long and giving the address ranges for the segments in the group. I see that the top end of IDATA_Z has exceeded the 0x80 IDATA size I set in the general options. HOWEVER what ever I do to increase it it always says ISTACK is too long, so that confused me.

2) I thought I'd have a go at creating my array on the heap. Once I'd found that the segment group used was XDATA and that I needed to use a particular flavour of malloc, it compiled fine. The XDATA heap size in general options seemed quite large, but when the make linked it, I got a "Error[e18]: Range error, <nothing after the comma>" indicating that certain conditions were not met at link time, but the conditions that failed are supposed to after teh comma.

main question
=============
I have taken a look at the IAR C Compiler guide and the IAR Linker guide, but although I am begining to get a feel for the general terrain and the vocabulary, these documents make too many assumptions to serve as an introduction.

If any can see some quick answers to my two issues above, then that would be appreciated, though I guess the information I have provided is limited. Additionally if any one can suggest a relatively fast track intro for a reasonably proficient low(ish) level programmer who wants to take a step nearer to the comiler and linker activities and hardware, esp' iro 8051 as a good precursor to the two guides I have.

Thanks in advance for any help or advice.

P.S.
I have IAR 8051 libraries for Texas Instruments RF SoCs, which seem to incorporate their own malloc etc functions (component/module name OSAL?), but so far the proect examples wonte compile with the 4K code limit I have on my evaluation copy.



List of 5 messages in thread
TopicAuthorDate
Suggested Introductory Material            01/01/70 00:00      
   Complex Environment            01/01/70 00:00      
      RE: Complex Environment            01/01/70 00:00      
         XDATA            01/01/70 00:00      
            SDCC            01/01/70 00:00      

Back to Subject List