Dear friends,
Hi friends..in our company, we are using MC9S12XEQ512 microcontroller for our automotive microcontroller.
specification of the microcontroller is,
flash memory is 512kb
ram memory is 32kb.
1. My doubt is, if i use another microcontroller say MC9S12XEQ384(MC9S12 family) where the ram memory is 20kb. Where will be the allocation ram size would be done in different variants of the microcontroller belonging to the same family ?...
In sense, ram size in mc9s12xeq384 is 20kb and in MC9S12XEQ512 it is 32kb.
Where will be difference in ram size will be framed is it in start_up code? datapage.c?hidef.h?
What makes the system to understand that this microcontroller can acces only 20kb ram or 32 kb ram?
2. Is there way of allocating of memory without actually defining in the prm?
//RAM_F8=F8000 TO F81FFF
//RAM_F9=F9000 TO F91FFF
RAM_FC =FC000 TO FC1FFF
if a particular rampage is commented in the prm, is there any way of using that ram. This may look funny, but in our project they have actually commented 8kb ram pages, but it's claimed it is being used somehow?.... can we preallocate
memory from the compiler end? like CSTV ? cp? commands like that?
3. XGATE ram allocation
Consider a case where we use mc9s12x microncontroller ( where XGATE is in RAM) and in the linker file we have allocated 4kb ram for x-gate. What will happen when the code size exceed 4kb ???.... how start_up code willl push the large amount x gate code in flash to RAM ( CONSIDER CASE WHERE THE CODE SIZE IS MORE THAN 4K BUT THE RAM ALLOCATION IS 4K).
Please clear my doubts.... thanks
1. Compiler and linker just do what you tell them. PRM file for XE384 should not use parts of memory, that are available only on XE512.
Reading PARTID register at runtime you may determine what part maskset you are using, which should tell you how much RAM and FLASH do you have.
2. Yes. Access memory using some pointer. Initialize pointer to point to bottom of memory and use it.
3. For XGATE and big arrays in global address space you may edit your PRM to use contiguos pieces global address areas. For example, instead of two segments
RAM_F8 = READ_WRITE DATA_FAR 0xF81000 TO 0xF81FFF;
RAM_F9 = READ_WRITE DATA_FAR 0xF91000 TO 0xF91FFF;
you may use single global segment
RAM_F8F9 = READ_WRITE 0x0F1000'G TO 0x0F9FFF'G;
Search forum for "using paged RAM" or smth like that.